If you plan to use a pin that has A/D on it for digital I/O, then you for sure want to disable
the A/D feature for that pin. Otherwise it reads as 0.
ADCON1 = 15 turns off all A/D. See the data sheet REGISTER 19-2: ADCON1: A/D CONTROL
REGISTER 1 section.
Where you see a D in the A/D Port Configuration Control Bits chart, this indicates Digital for
that pin. Where you see an A, this indicates the pin is configured for Analog.
Another option is to use PBADEN config bit. If PBADEN = 0 then AN0-AN7 are analog by default at POR
(power on reset). AN8 to AN12 are digital. If PBADEN = 1 then PCFG 2 to 0 = 1, which means AN0 to AN12
pins are analog
Look at the chart in your data sheet. If ADCON1 = 0 then all pins with analog capabilities are
Analog. If ADCON1 = 15 what are they?
Bookmarks