English
Language : 

PIC16F946 Datasheet, PDF (152/274 Pages) Microchip Technology – 64-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
PIC16F946
12.1 A/D Configuration and Operation
There are three registers available to control the
functionality of the A/D module:
1. ANSEL (Register 12-1)
2. ADCON0 (Register 12-2)
3. ADCON1 (Register 12-3)
12.1.1 ANALOG PORT PINS
The ANS<7:0> bits (ANSEL<7:0>) and the TRIS bits
control the operation of the A/D port pins. Set the
corresponding TRIS bits to set the pin output driver to
its high-impedance state. Likewise, set the correspond-
ing ANSEL bit to disable the digital input buffer.
Note:
Analog voltages on any pin that is defined
as a digital input may cause the input
buffer to conduct excess current.
12.1.2 CHANNEL SELECTION
There are up to eight analog channels on the PIC16F946,
AN<7:0>. The CHS<2:0> bits (ADCON0<4:2>) control
which channel is connected to the sample and hold
circuit.
12.1.3 VOLTAGE REFERENCE
There are two options for each reference to the A/D
converter, VREF+ and VREF-. VREF+ can be connected to
either VDD or an externally applied voltage. Alternatively,
VREF- can be connected to either VSS or an externally
applied voltage. VCFG<1:0> bits are used to select the
reference source.
12.1.4 CONVERSION CLOCK
The A/D conversion cycle requires 11 TAD. The source
of the conversion clock is software selectable via the
ADCS bits (ADCON1<6:4>). There are seven possible
clock options:
• FOSC/2
• FOSC/4
• FOSC/8
• FOSC/16
• FOSC/32
• FOSC/64
• FRC (dedicated internal oscillator)
For correct conversion, the A/D conversion clock
(1/TAD) must be selected to ensure a minimum TAD of
1.6 μs. Table 12-1 shows a few TAD calculations for
selected frequencies.
TABLE 12-1: TAD vs. DEVICE OPERATING FREQUENCIES
A/D Clock Source (TAD)
Device Frequency
Operation
2 TOSC
4 TOSC
8 TOSC
16 TOSC
32 TOSC
64 TOSC
A/D RC
ADCS<2:0>
000
100
001
101
010
110
x11
20 MHz
100 ns(2)
200 ns(2)
400 ns(2)
800 ns(2)
1.6 μs
3.2 μs
2-6 μs(1,4)
5 MHz
400 ns(2)
800 ns(2)
1.6 μs
3.2 μs
6.4 μs
12.8 μs(3)
2-6 μs(1,4)
4 MHz
500 ns(2)
1.0 μs(2)
2.0 μs
4.0 μs
8.0 μs(3)
16.0 μs(3)
2-6 μs(1,4)
1.25 MHz
1.6 μs
3.2 μs
6.4 μs
12.8 μs(3)
25.6 μs(3)
51.2 μs(3)
2-6 μs(1,4)
Legend: Shaded cells are outside of recommended range.
Note 1: The A/D RC source has a typical TAD time of 4 μs for VDD > 3.0V.
2: These values violate the minimum required TAD time.
3: For faster conversion times, the selection of another clock source is recommended.
4: When the device frequency is greater than 1 MHz, the A/D RC clock source is only recommended if the
conversion will be performed during Sleep.
DS41265A-page 150
Preliminary
© 2005 Microchip Technology Inc.