Thanks Bruce, but I need A/D on channel a0, all the other pins are I or O.
Regards
Bob
Thanks Bruce, but I need A/D on channel a0, all the other pins are I or O.
Regards
Bob
ANSEL configures port pins for A/D or digital.
ANSEL = %00000001 ' RA0 = A/D, rest digital I/O.
For ADCON0 & ADCON1 configuration options, see
datasheet A/D section. It's very simple to setup.
Thank you Bruce. I have figured it all out now, I think. Wont have time to test it for a day or two. I have:
define OSC 20
define adc_bits 10
define adc_sampleus 50
CMCON = 7 'turns off comparators
ANSEL = 1 'channel 0 analog all others digital
ADCON0 = 129 'right justified, vref = vdd, chan 0 active, A/D converter on
ADCON1 = 96 'fosc/64 (20MHz osc)
Once again thanks for your help.
Regards
Bob...
Bookmarks