--- In , Devon Lee <devonsc@y...> wrote: > Hi there, > > I'm using PIC16F876. With 10-bits ADC module. However, > if I intend to use only 8 bits, is the following > correct? > > Where is is a must for me to use left-justified. Then, > ADRESH are the results of Bit0 to Bit7. Then, ADRESL > are the results of Bit 8 and Bit 9, where I can ignore > them? > > OR the results of the ADC will still be placed from > ADRESL=> Bit 0 and Bit 1. Then ADRESH from bit 2 to > bit 9? If this is the case, mind to advice on how can > I only read the 8 bits result? Thanks in advance Figure 11.4 of the datasheet describes this in detail. If you use left justification you will get the high 8 of 10 bits in ADRESH. In my opinion you are numbering the bits backwards. Left justified, bits 9..2 of the 10 bit conversion are in bits 7..0 of ADRESH. Bits 1..0 of the 10 bit conversion are in bits 7..6 of ADRESL. Right justified, bits 9..8 of the 10 bit conversion are in ADRESH and bits 7..0 of the conversion are in bits 7..0 of ADRESL. > > __________________________________________________ > |