
PIC16C717/770/771
DS41120B-page 108
2002 Microchip Technology Inc.
FIGURE 11-2: PIC16C717 10-BIT A/D RESULT FORMAT
After the A/D module has been configured as desired,
the selected channel must be acquired before the con-
version is started. The analog input channels must
have their corresponding TRIS and ANSEL bits
selected as an input. To determine acquisition time, see
the A/D conversion can be started. The following steps
should be followed for doing an A/D conversion:
11.2
Configuring the A/D Module
11.2.1
CONFIGURING ANALOG PORT
PINS
The ANSEL and TRIS registers control the operation
of the A/D port pins. The port pins that are desired as
analog inputs must have their corresponding TRIS bit
set (input). If the TRIS bit is cleared (output), the digital
output level (VOH or VOL) will be converted. The proper
ANSEL bits must be set (analog input) to disable the
digital input buffer.
The A/D operation is independent of the state of the
TRIS bits and the ANSEL bits.
11.2.2
CONFIGURING THE REFERENCE
VOLTAGES
The VCFG bits in the ADCON1 register configure the
A/D module reference inputs. The reference high input
can come from an internal reference (VRH) or (VRL),
an external reference (VREF+), or AVDD. The low refer-
ence input can come from an internal reference (VRL),
an external reference (VREF-), or AVSS. If an external
reference is chosen for the reference high or reference
low inputs, the port pin that multiplexes the incoming
external references is configured as an analog input,
regardless of the values contained in the A/D port con-
figuration bits (PCFG<3:0>).
(ADFM = 0)
MSB
LSB
bit7
10-bit A/D Result
Unused
(ADFM = 1)
MSB
LSB
bit7
Unused
10-bit A/D Result
Unused
Note 1: When reading the PORTA register, all pins
configured as analog input channels will
read as ’0’.
2: When reading the PORTB register, all
pins
configured as
analog
pins
on
PORTB will be read as ’1’.
3: Analog levels on any pin that is defined as
a digital input, including the ANx pins, may
cause the input buffer to consume current
that is out of the devices specification.