Datasheet

2010 Microchip Technology Inc. Preliminary DS39974A-page 371
PIC18F47J13 FAMILY
The ANCON0 and ANCON1 registers are used to
configure the operation of the I/O pin associated with
each analog channel. Setting any one of the PCFG bits
configures the corresponding pin to operate as a digital
only I/O. Clearing a bit configures the pin to operate as
an analog input for either the A/D Converter or the
comparator module. All digital peripherals are disabled
and digital inputs read as ‘0’. As a rule, I/O pins that are
multiplexed with analog inputs default to analog
operation on device Resets.
In order to correctly perform A/D conversions on the V
BG
band gap reference (ADCON0<5:2> = 1111), the refer-
ence circuit must be powered on first. The VBGEN bit in
the ANCON1 register allows the firmware to manually
request that the band gap reference circuit should be
enabled. For best accuracy, firmware should allow a
settling time of at least 10 ms prior to performing the first
acquisition on this channel after enabling the band gap
reference.
The reference circuit may already have been turned on
if some other hardware module (such as the on-chip
voltage regulator, comparators or HLVD) has already
requested it. In this case, the initial turn-on settling time
may have already elapsed and firmware does not need
to wait as long before measuring V
BG. Once the acqui-
sition is complete, firmware may clear the VBGEN bit,
which will save a small amount of power if no other
modules are still requesting the V
BG reference.
REGISTER 22-4: ANCON0: A/D PORT CONFIGURATION REGISTER 0 (BANKED F48h)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PCFG7
(1)
PCFG6
(1)
PCFG5
(1)
PCFG4 PCFG3 PCFG2 PCFG1 PCFG0
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-0 PCFG<7:0>: Analog Port Configuration bits (AN7-AN0)
1 = Pin configured as a digital port
0 = Pin configured as an analog channel – digital input disabled and reads ‘0
Note 1: These bits are only available only on 44-pin devices.
REGISTER 22-5: ANCON1: A/D PORT CONFIGURATION REGISTER 1 (BANKED F49h)
R/W-0 R U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
VBGEN r PCFG12 PCFG11 PCFG10 PCFG9 PCFG8
bit 7 bit 0
Legend: r = Reserved bit
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7 VBGEN: 1.2V Band Gap Reference Enable bit
1 = 1.2V band gap reference is powered on
0 = 1.2V band gap reference is turned off to save power (if no other modules are requesting it)
bit 6 Reserved: Always maintain as0’ for lowest power consumption
bit 5 Unimplemented: Read as0
bit 4-0 PCFG<12:8>: Analog Port Configuration bits (AN12-AN8)
1 = Pin configured as a digital port
0 = Pin configured as an analog channel – digital input disabled and reads ‘0