ADC external comp pins

hax

New Member
Hi all,

I want to use the comparator pins on a 40x2 chip for reading adc10 voltages using an external precision voltage source for best accuracy.

The manual says the adcconfig Vref+ pin is A.3 and the Vref- pin is A.2, but in the picaxe pinouts section here http://www.picaxe.com/What-is-PICAXE/PICAXE-Pinouts/

it says that those pins are Comp2+ and Comp1+ respectively. Shouldn't they be Comp1+ and Comp1-? Also, looking at the pinouts page, what are the other A.0 and A.1 reference pins? How are they used, and are they used by another command?
 

hax

New Member
oh I have just found the Compsetup command. Never knew it could do that. So it looks like the ADCCONFIG command uses both internal comparators.
 

hippy

Technical Support
Staff member
The ADC and Comparators are separate pieces of on-chip hardware, and it is common for on-chip hardware to share I/O pins. Looking at the PICmicro datasheet shows -

Leg 4 is C2IN+ and Vref-
Leg 5 is C1IN+ and Vref+

So it appears the PICAXE documentation is correct -

Leg 4, A.4 is Comp2+ and Vref-
Leg 5, A.5 is Comp1+ and Vref+
 
Top