I had a problem with ADCIN on my 18F2221's. I solved the problem by doing it the "old fashioned way":
Code:ADCON0 = (channel << 2) + $3 ;Set up the ADC channel, turn on the A/D PAUSEUS 20 ; wait for the analog switch 'glitch' to die down ADCON1.1 = 1 ;Set the Go/Done bit PAUSEUS 2 ; insure minimum time WHILE ADCON1.1 = 1:WEND ; wait for the go/done bit to clear Result.HighByte = ADRESH Result.LowByte = ADRESL
Bookmarks