Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F876A 10-BIT ADC RESULT FORMATTING.

Status
Not open for further replies.

codewiz

Member level 5
Joined
Sep 14, 2008
Messages
80
Helped
10
Reputation
20
Reaction score
8
Trophy points
1,288
Activity points
1,717
Hi. this is my first post. pls, i had been using 8-bit ADC with 255 as maximum meaning that i can use just one register for the result and table is not an issue. BUT now i am using the inbuilt ADC of 16f876a which is 10-bit with maximum of 1023 meaning that i will use 2registers and table is a problem for me in this regard. please, how do i convert the results in the registers to match temperature range of 0 to 100 degree celsius. pls help.
 

You have to left align the ADC Reading by clearing ADFM bit in ADCON1 register.
Then you can just read the ADC Value in 8 Most Significant bits by reading the ADRESH register.Hope this helps you.
 

Thanks for ur reply. it gave me hope. But what happens to the remaining 2-bits(LSB) in the ADRESL won't it affect my result?
I will like to know how it affects my result or what to do in my program to compensate for any error as regards using only the ADRESH at left justify.

I am actually using LM35 temperature sensor connected to AN0 of 16F876A and i really want to get reading of ADC and accurately display the temperature. Thanks. Expecting your help
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top