simple one: adc_on_lcd, why is adcon1=0x82??
Posted: 05 Dec 2010 10:47
Hello!
Let's just say that I'm kinda new with mikroC, I'm using 8.2 version and, in the following example
C:\Program Files\Mikroelektronika\mikroC\Examples\EasyPic5\P16F887\ADC_on_LCD
there is one line that I can't understand:
because in pic's datasheet ADCON1 register:
so why do you assign 1 to a 0 bit, and why do you need the "Right justified" option??
Thanks for the help!
Let's just say that I'm kinda new with mikroC, I'm using 8.2 version and, in the following example
C:\Program Files\Mikroelektronika\mikroC\Examples\EasyPic5\P16F887\ADC_on_LCD
there is one line that I can't understand:
Code: Select all
ADCON1 = 0x82; // configure VDD as Vref, and analog channels
Code: Select all
bit 7 ADFM: A/D Conversion Result Format Select bit
1 = Right justified
0 = Left justified
bit 6 Unimplemented: Read as ‘0’
bit 5 VCFG1: Voltage Reference bit
1 = VREF- pin
0 = VSS
bit 4 VCFG0: Voltage Reference bit
1 = VREF+ pin
0 = VDD
bit 3-0 Unimplemented: Read as ‘0’
Thanks for the help!