let's review it together you declared..
There you set correctly the FRC as ADCS BUT you set only GPIO.0(ANS0) as analog. If this is what you want... it's not what you said
GPIO.5 for Analog input
.
.
.
.
' Set ADC clock to Frc and GP0 & GP1 to analog mode
So if you want to use ANS0 (GPIO.0) as analog input for your ADC, you should also disable the analog comparator multiplexed on GPIO<1:0>
CMCON=7
Later you set ADCON0=%10000001 which says correctly you want to read from ANS0.
That must be it... or a part of. Personnaly i'll enable the POWER-UP timer to keep boot settle time safe.
Depending of your hardware, you can also try to use a slower ClockSource and or adding a little pause after the Go/Done bit test.
Where your signal come from?
Is it met the maximum impedance of the A/D as stated in the datasheet?
Last edited by mister_e; - 20th May 2006 at 10:25.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks