adcsetup on 20X2 [Solved]

kfjl

Member
Hi,

What should I set adcsetup to in order to use ADC3 (pin C.7) on a 20X2? There's no ADC0 so is it %00001000 (my bet), or %00000100?

Thanks.
 

hippy

Technical Support
Staff member
On the 20X2 the bits represent ADC Channels -
Code:
;              111
;     Vref+ -. 2109876543210
;            | |||||||||||||
adcSetup = %0x0xxxxxxxxxxxxx
So to use ADC3 (C.7) -
Code:
;              111
;     Vref+ -. 2109876543210
;            | |||||||||||||
adcSetup = %0000000000001000
 

kfjl

Member
OK, thanks, Hippy.

23133

Since I'm on a winning streak, I'll put my money on C.6 as being the mysterious ADC0.

:)
 

hippy

Technical Support
Staff member
Since I'm on a winning streak, I'll put my money on C.6 as being the mysterious ADC0.
Luckily we aren't a casino so won't be round to empty your wallet - ADC0 is actually A.0, Download Serial Out (leg 19).

I can't recall if I have ever tested what making that pin an ADC actually does. I expect the firmware either masks out that bit or setting it as output keeps it as a digital output.

C.6 (leg 4) is the MCLR/Reset/Programming pin on the underlying PIC which is digital input only and does not have ADC capabilities. If it did we would have made it available because there'd be no reason not to.
 
Top