
Rev. 1.7
51
C8051F310/1/2/3/4/5/6/7
5.
10-Bit ADC (ADC0, C8051F310/1/2/3/6 only)
The ADC0 subsystem for the C8051F310/1/2/3/6 consists of two analog multiplexers (referred to collec-
tively as AMUX0) with 25 total input selections, and a 200 ksps, 10-bit successive-approximation-register
ADC with integrated track-and-hold and programmable window detector. The AMUX0, data conversion
modes, and window detector are all configurable under software control via the Special Function Registers
shown in
Figure 5.1. ADC0 operates in both Single-ended and Differential modes, and may be configured
to measure P1.0–P3.4, the Temperature Sensor output, or VDD with respect to P1.0–P3.4, VREF, or GND.
The ADC0 subsystem is enabled only when the AD0EN bit in the ADC0 Control register (ADC0CN) is set
to logic 1. The ADC0 subsystem is in low power shutdown when this bit is logic 0.
ADC0CF
AD0
L
JST
AD
0
S
C
0
AD
0
S
C
1
AD
0
S
C
2
AD
0
S
C
3
AD
0
S
C
4
10-Bit
SAR
ADC
REF
SY
S
C
L
K
ADC
0
H
32
ADC0CN
AD0
C
M
0
AD0
C
M
1
AD0
C
M
2
AD
0
W
IN
T
AD0
B
USY
AD0
INT
AD0
T
M
AD
0
EN
Timer 0 Overflow
Timer 2 Overflow
Timer 1 Overflow
Start
Conversion
000
AD0BUSY (W)
VDD
ADC0LTH
23-to-1
AMUX
AD0WINT
Temp
Sensor
23-to-1
AMUX
VDD
P1.0
P1.7
001
010
011
100
CNVSTR Input
Window
Compare
Logic
P2.0
P2.7
GND
P1.0
P1.7
P2.0
P2.7
P3.0
P3.4
101
Timer 3 Overflow
ADC0LTL
ADC0GTH ADC0GTL
A
DC0
L
AMX0P
AMX0
P4
AMX0
P3
AMX0
P2
AMX0
P1
AMX0
P0
AMX0N
AM
X0
N
4
AM
X0
N
3
AM
X0
N
2
AM
X0
N
1
AM
X0
N
0
P3.0
P3.4
P3.1-3.4
available on
C8051F310/2
P3.1-3.4
available on
C8051F310/2
(+)
(-)
VREF
P2.6-2.7 available on
C8051F310/1/2/3/4/5
P1.6-1.7 available on
C8051F310/1/2/3/4/5
P2.6-2.7 available on
C8051F310/1/2/3/4/5
P1.6-1.7 available on
C8051F310/1/2/3/4/5
Figure 5.1. ADC0 Functional Block Diagram
5.1.
Analog Multiplexer
AMUX0 selects the positive and negative inputs to the ADC. Any of the following may be selected as the
positive input: P1.0-P3.4, the on-chip temperature sensor, or the positive power supply (VDD). Any of the
following may be selected as the negative input: P1.0-P3.4, VREF, or GND. When GND is selected as
the negative input, ADC0 operates in Single-ended Mode; all other times, ADC0 operates in Differ-
ential Mode. The ADC0 input channels are selected in the AMX0P and AMX0N registers as described in
The conversion code format differs between Single-ended and Differential modes. The registers ADC0H
and ADC0L contain the high and low bytes of the output conversion code from the ADC at the completion
of each conversion. Data can be right-justified or left-justified, depending on the setting of the AD0LJST bit
(ADC0CN.0). When in Single-ended Mode, conversion codes are represented as 10-bit unsigned integers.