PDA

View Full Version : analog issues, what am I missing?



cpayne
- 5th April 2008, 21:54
I am using a PIC18F2220. AN2 is impacted by AN1. I think I have the compators turned off, but AN2 is acting like they are on.... ANy ideas. Thanks

This is how I have initialized the analog...

ADCON0 = %00000001 ' Enable A/D
ADCON1 = %00001100 ' Anolog AN0-AN2, all else digital
ADCON2 = %10000111 ' right justify result
CMCON = %00000111 ' Comparators OFF to allow inputs on pins CMCON = 7
INTCON = %00000000 ' all interrupts OFF
Define ADC_BITS 10 ' Set number of bits in result
Define ADC_CLOCK 3 ' Set clock source (3=rc)
Define ADC_SAMPLEUS 50 ' Set sampling time in uS

cpayne
- 5th April 2008, 22:29
It helps if you have your analog souce attached to the correct pin...

Sorry for the unessary post, I guess I just needed to step away from it a while to see the obvious.