Hi All,
I need to set all AN inputs as Analog in PIC18F452. How would i set ADCON1 and ADCON0. Is this ok?
further more i need to read values of ADC if changed, Continuously in a sync. Like an analog combination lock (itx an example, i dont really want to do that). Advise on that to i you can, it would be a great help!
PS: I m using MikroC Pro 4.6 for PIC
I need to set all AN inputs as Analog in PIC18F452. How would i set ADCON1 and ADCON0. Is this ok?
Rich (BB code):
ADRESH = 0xFF;
ADRESL = 0xFF;
ADCON1 = 0x80;
ADCON0 = 0x80; //Turn all pins as analog
CCP1CON = 0x00; //Turn off all comparators
CCP2CON = 0x00;
TRISA = 0xFF;
TRISB = 0x00;
TRISC = 0x7D;
TRISD = 0xFF;
TRISE = 0xFF;
PS: I m using MikroC Pro 4.6 for PIC