Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

A/D 10 bit to 8 bit

Status
Not open for further replies.

AZdave

New Member
I have a analog input to a 16F877A, RA0 (AN0). The A/D result is stored as 10 bits - ADRESH (BANK0) and ADRESL (BANK1). I have the A/D result left justified, i.e. 8 bits of ADRESH + bits 7:6 of ADRESL. What I need is an 8 bit number (0-255) to send serially to a graphic LCD.

Will need to use the 6 least significant bits of ADRESH and combine them with the 2 most significant bits of ADRESL to get an 8 bit number? or will the 8 bits of ADRESH be the correct 8 bits?
 
Thanks Nigel,

Yes, ADFM is set to 0. Needing only the ADRESH result makes life easier. :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top