Microchip Technology MCP1630DM-DDBS1 数据表

下载
页码 176
©
 2007 Microchip Technology Inc.
DS41211D-page 61
PIC12F683
9.0
ANALOG-TO-DIGITAL 
CONVERTER (ADC) MODULE
The Analog-to-Digital Converter (ADC) allows
conversion of an analog input signal to a 10-bit binary
representation of that signal. This device uses analog
inputs, which are multiplexed into a single sample and
hold circuit. The output of the sample and hold is
connected to the input of the converter. The converter
generates a 10-bit binary result via successive
approximation and stores the conversion result into the
ADC result registers (ADRESL and ADRESH).
The ADC voltage reference is software selectable to
either V
DD
 or a voltage applied to the external reference
pins.
The ADC can generate an interrupt upon completion of
a conversion. This interrupt can be used to wake-up the
device from Sleep.
Figure 9-1 shows the block diagram of the ADC.
FIGURE 9-1:
ADC BLOCK DIAGRAM   
9.1
ADC Configuration 
When configuring and using the ADC the following
functions must be considered:
• GPIO configuration
• Channel selection
• ADC voltage reference selection
• ADC conversion clock source
• Interrupt control
• Results formatting
9.1.1
GPIO CONFIGURATION
The ADC can be used to convert both analog and digital
signals. When converting analog signals, the I/O pin
should be configured for analog by setting the associated
TRIS and ANSEL bits. See the corresponding GPIO
section for more information.
9.1.2
CHANNEL SELECTION
The CHS bits of the ADCON0 register determine which
channel is connected to the sample and hold circuit.
When changing channels, a delay is required before
starting the next conversion. Refer to Section 9.2
“ADC Operation”
 for more information.
GP0/AN0
A/D
GP1/AN1/V
REF
GP2/AN2
V
DD
V
REF
ADON
GO/DONE
VCFG = 
1
VCFG = 
0
CHS
ADRESH
ADRESL
10
10
ADFM
GP4/AN3
0
 = Left Justify
1
 = Right Justify
Note:
Analog voltages on any pin that is defined
as a digital input may cause the input
buffer to conduct excess current.