Probably you have disable the ADCs but not the comparator? Both have to be disable.
And yes i'm talking about doing a A/D conversion... that's already built-in, free and far better than POT
Probably you have disable the ADCs but not the comparator? Both have to be disable.
And yes i'm talking about doing a A/D conversion... that's already built-in, free and far better than POT
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
by just using a pot on that pin, wont I have to use a voltage divider. If I just put a pot, then it will the same voltage and the convertion will be the same.
Right now with this I am getting weird characters on the lcd.
I did not touch portB..
To disable I guess by using the ADCON1 = 0 it is disable (bit 2 and 3)
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
B0 var byte
Start:
TRISA = 3 ' Set PORTA to all input
ADCON1 = 0 ' PORTA is analog
ADCIN 0, B0 ' Read channel 0 to B0
Lcdout $fe, 1 'Clear screen
Lcdout "Pot: ", Dec B0 'Display the decimal value
Pause 300
Bookmarks