English
Language : 

PIC18F44J50-I Datasheet, PDF (349/562 Pages) Microchip Technology – 28/44-Pin, Low-Power, High-Performance USB Microcontrollers
PIC18F46J50 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 VBG
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 VBG. 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 VBG reference.
REGISTER 21-3: ANCON0: A/D PORT CONFIGURATION REGISTER 2 (BANKED F48h)
R/W-0
PCFG7(1)
bit 7
R/W-0
PCFG6(1)
R/W-0
PCFG5(1)
R/W-0
PCFG4
R/W-0
PCFG3
R/W-0
PCFG2
R/W-0
PCFG1
R/W-0
PCFG0
bit 0
Legend:
R = Readable bit
-n = Value at POR
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘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 is disabled and reads ‘0’
Note 1: These bits are only available on 44-pin devices.
REGISTER 21-4: ANCON1: A/D PORT CONFIGURATION REGISTER 1 (BANKED F49h)
R/W-0
U-0
VBGEN
r
bit 7
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
—
PCFG12
PCFG11
PCFG10
PCFG9
PCFG8
bit 0
Legend:
R = Readable bit
-n = Value at POR
r = Reserved bit
W = Writable bit
‘1’ = Bit is set
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
x = Bit is unknown
bit 7
bit 6
bit 5
bit 4-0
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)
Reserved: Always maintain as ‘0’ for lowest power consumption
Unimplemented: Read as ‘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 is disabled and reads ‘0’
 2011 Microchip Technology Inc.
DS39931D-page 349