Datasheet
2003-2013 Microchip Technology Inc. DS39609C-page 219
PIC18F6520/8520/6620/8620/6720/8720
19.2 Selecting the A/D
Conversion Clock
The A/D conversion time per bit is defined as TAD. The
A/D conversion requires 12 T
AD per 10-bit conversion.
The source of the A/D conversion clock is software
selectable. There are seven possible options for T
AD:
•2 T
OSC
•4 TOSC
•8 TOSC
•16 TOSC
•32 TOSC
•64 TOSC
• Internal RC oscillator
For correct A/D conversions, the A/D conversion clock
(T
AD) must be selected to ensure a minimum TAD time
of 1.6 s.
Table 19-1 shows the resultant T
AD times derived from
the device operating frequencies and the A/D clock
source selected.
19.3 Configuring Analog Port Pins
The ADCON1, TRISA, TRISF and TRISH registers
control the operation of the A/D port pins. The port pins
needed as analog inputs must have their correspond-
ing TRIS bits set (input). If the TRIS bit is cleared
(output), the digital output level (V
OH or VOL) will be
converted.
The A/D operation is independent of the state of the
CHS3:CHS0 bits and the TRIS bits.
TABLE 19-1: TAD vs. DEVICE OPERATING FREQUENCIES
Note 1: When reading the port register, all pins
configured as analog input channels will
read as cleared (a low level). Pins config-
ured as digital inputs will convert as an
analog input. Analog levels on a digitally
configured input will not affect the
conversion accuracy.
2: Analog levels on any pin defined as a dig-
ital input may cause the input buffer to
consume current out of the device’s
specification limits.
AD Clock Source (TAD) Maximum Device Frequency
Operation ADCS2:ADCS0 PIC18FXX20 PIC18LFXX20
2 T
OSC 000 1.25 MHz 666 kHz
4 T
OSC 100 2.50 MHz 1.33 MHz
8 TOSC 001 5.00 MHz 2.67 MHz
16 TOSC 101 10.0 MHz 5.33 MHz
32 T
OSC 010 20.0 MHz 10.67 MHz
64 TOSC 110 40.0 MHz 21.33 MHz
RC x11 ——