Table 26.1.Boundary Data Register Bit Definitions .............................................................316
18Rev. 1.2
C8051F120/1/2/3/4/5/6/7
1.SYSTEM OVERVIEW
The C8051F12x devices are fully integrated mixed-signal System-on-a-Chip MCUs with 64 digital I/O pins
(C8051F120/2/4/6) or 32 digital I/O pins (C8051F121/3/5/7). Highlighted features are listed below; refer to Table 1.1
for specific product feature selection.
•High-Speed pipelined 8051-compatible CIP-51 microcontroller core (up to 100 MIPS for C8051F120/1/2/3 and
50 MIPS for C8051F124/5/6/7)
•True 12-bit (C8051F120/1/4/5) or 10-bit (C8051F122/3/6/7) 100 ksps ADC with PGA and 8-channel analog
multiplexer
•True 8-bit 500 ksps ADC with PGA and 8-channel analog multiplexer
•Two 12-bit DACs with programmable update scheduling
•2-cycle 16 by 16 Multiply and Accumulate Engine (C8051F120/1/2/3)
•128k bytes of in-system programmable FLASH memory
•8448 (8k + 256) bytes of on-chip RAM
•External Data Memory Interface with 64k byte address space
•SPI, SMBus/I
•Five general purpose 16-bit Timers
•Programmable Counter/Timer Array with 6 capture/compare modules
•On-chip Watchdog Timer, VDD Monitor, and Temperature Sensor
2
C, and (2) UART serial interfaces implemented in hardware
With on-chip VDD monitor, Watchdog Timer, and clock oscillator, the C8051F12x devices are truly stand-alone System-on-a-Chip solutions. All analog and digital peripherals are enabled/disabled and configured by user firmware.
The FLASH memory can be reprogrammed even in-circuit, providing non-volatile data storage, and also allowing
field upgrades of the 8051 firmware.
On-board JTAG debug circuitry allows non-intrusive (uses no on-chip resources), full speed, in-circuit debugging
using the production MCU installed in the final application. This debug system supports inspection and modification
of memory and registers, setting breakpoints, watchpoints, single stepping, run and halt commands. All analog and
digital peripherals are fully functional while debugging using JTAG.
Each MCU is specified for operation over the industrial temperature range (-45° C to +85° C). The Port I/Os, /RST,
and JTAG pins are tolerant for input signals up to 5 V. The C8051F120/2/4/6 are available in a 100-pin TQFP package (see block diagrams in Figure 1.1 and Figure 1.3). The C8051F121/3/5/7 are available in a 64-pin TQFP package
(see block diagrams in Figure 1.2 and Figure 1.4).
The C8051F12x family utilizes Silicon Labs’ proprietary CIP-51 microcontroller core. The CIP-51 is fully compatible with the MCS-51™ instruction set; standard 803x/805x assemblers and compilers can be used to develop software. The core has all the peripherals included with a standard 8052, including five 16-bit counter/timers, two fullduplex UARTs, 256 bytes of internal RAM, 128 byte Special Function Register (SFR) address space, and 8/4 bytewide I/O Ports.
1.1.2.Improved Throughput
The CIP-51 employs a pipelined architecture that greatly increases its instruction throughput over the standard 8051
architecture. In a standard 8051, all instructions except for MUL and DIV take 12 or 24 system clock cycles to execute with a maximum system clock of 12-to-24 MHz. By contrast, the CIP-51 core executes 70% of its instructions in
one or two system clock cycles, with only four instructions taking more than four system clock cycles.
The CIP-51 has a total of 109 instructions. The table below shows the total number of instructions that require each
execution time.
Clocks to Execute122/333/444/558
Number of Instructions265051473121
With the CIP-51's maximum system clock at 100 MHz, the C8051F120/1/2/3 have a peak throughput of 100 MIPS
(the C8051F124/5/6/7 have a peak throughput of 50 MIPS).
Rev. 1.225
C8051F120/1/2/3/4/5/6/7
1.1.3.Additional Features
The C8051F12x MCU family includes several key enhancements to the CIP-51 core and peripherals to improve overall performance and ease of use in end applications.
The extended interrupt handler provides 20 interrupt sources into the CIP-51 (as opposed to 7 for the standard 8051),
allowing the numerous analog and digital peripherals to interrupt the controller. An interrupt driven system requires
less intervention by the MCU, giving it more effective throughput. The extra interrupt sources are very useful when
building multi-tasking, real-time systems.
There are up to seven reset sources for the MCU: an on-board VDD monitor, a Watchdog Timer, a missing clock
detector, a voltage level detection from Comparator0, a forced software reset, the CNVSTR0 input pin, and the /RST
pin. The /RST pin is bi-directional, accommodating an external reset, or allowing the internally generated POR to be
output on the /RST pin. Each reset source except for the VDD monitor and Reset Input pin may be disabled by the
user in software; the VDD monitor is enabled/disabled via the MONEN pin. The Watchdog Timer may be permanently enabled in software after a power-on reset during MCU initialization.
The MCU has an internal, stand alone clock generator which is used by default as the system clock after any reset. If
desired, the clock source may be switched on the fly to the external oscillator, which can use a crystal, ceramic resonator, capacitor, RC, or external clock source to generate the system clock. This can be extremely useful in low power
applications, allowing the MCU to run from a slow (power saving) external crystal source, while periodically switching to the 24.5 MHz internal oscillator as needed. Additionally, an on-chip PLL is provided to achieve higher system
clock speeds for increased throughput.
(Port
I/O)
CP0+
CP0-
XTAL1
XTAL2
Crossbar
Internal
Clock
Generator
PLL
Circuitry
OSC
Figure 1.5. On-Board Clock and Reset
CNVSTR
(CNVSTR
reset
enable)
Comparator0
+
-
(CP0
reset
enable)
System
Clock
Clock Select
VDD
Missing
Clock
Detector
(one-
shot)
EN
MCD
WDT
Enable
CIP-51
Microcontroller
Core
Extended Interrupt
Handler
WDT
EN
Enable
Supply
Monitor
+
-
PRE
WDT
Supply
Reset
Timeout
Strobe
Software Reset
System Reset
(wired-OR)
Reset
Funnel
/RST
26Rev. 1.2
C8051F120/1/2/3/4/5/6/7
1.2.On-Chip Memory
The CIP-51 has a standard 8051 program and data address configuration. It includes 256 bytes of data RAM, with the
upper 128 bytes dual-mapped. Indirect addressing accesses the upper 128 bytes of general purpose RAM, and direct
addressing accesses the 128 byte SFR address space. The lower 128 bytes of RAM are accessible via direct and indirect addressing. The first 32 bytes are addressable as four banks of general purpose registers, and the next 16 bytes
can be byte addressable or bit addressable.
The CIP-51 in the C8051F12x MCUs additionally has an on-chip 8k byte RAM block and an external memory interface (EMIF) for accessing off-chip data memory. The on-chip 8k byte block can be addressed over the entire 64k
external data memory address range (overlapping 8k boundaries). External data memory address space can be
mapped to on-chip memory only, off-chip memory only, or a combination of the two (addresses up to 8k directed to
on-chip, above 8k directed to EMIF). The EMIF is also configurable for multiplexed or non-multiplexed address/data
lines.
The MCU’s program memory consists of 128k bytes of banked FLASH memory. This memory may be reprogrammed in-system in 1024 byte sectors, and requires no special off-chip programming voltage. The 1024 bytes from
addresses 0x1FC00 to 0x1FFFF are reserved. There are also two 128 byte sectors at addresses 0x20000 to 0x200FF,
which may be used by software. See Figure 1.6 for the MCU system memory map.
PROGRAM/DATA MEMORY
(FLASH)
0x200FF
0x20000
0x1FFFF
0x1FC00
0x1FBFF
0x00000
Scrachpad Memory
(DATA only)
RESERVED
FLASH
(In-System
Programmable in 1024
Byte Sectors)
Figure 1.6. On-Chip Memory Map
DATA MEMORY (RAM)
INTERNAL DATA ADDRESS SPACE
0xFF
0x80
0x7F
0x30
0x2F
0x20
0x1F
0x00
0xFFFF
Upper 128 RAM
(Indirect Addressing
Only)
(Direct and Indirect
Addressing)
Bit Addressable
General Purpose
Registers
Special Function
(Direct Addressing Only)
Lower 128 RAM
(Direct and Indirect
Addressing)
EXTERNAL DATA ADDRESS SPACE
Off-chip XRAM space
Registers
0
1
2
3
Up To
256 SFR Pages
0x2000
0x1FFF
0x0000
XRAM - 8192 Bytes
(accessable using MOVX
instruction)
Rev. 1.227
C8051F120/1/2/3/4/5/6/7
1.3.JTAG Debug and Boundary Scan
The C8051F12x device family has on-chip JTAG boundary scan and debug circuitry that provides non-intrusive, full
speed, in-circuit debugging using the production part installed in the end application, via the four-pin JTAG inter-
face. The JTAG port is fully compliant to IEEE 1149.1, providing full boundary scan for test and manufacturing purposes.
Silicon Labs' debugging system supports inspection and modification of memory and registers, breakpoints, watchpoints, a stack monitor, and single stepping. No additional target RAM, program memory, timers, or communications
channels are required. All the digital and analog peripherals are functional and work correctly while debugging. All
the peripherals (except for the ADC and SMBus) are stalled when the MCU is halted, during single stepping, or at a
breakpoint in order to keep them synchronized.
The C8051F120DK development kit provides all the hardware and software necessary to develop application code
and perform in-circuit debugging with the C8051F12x MCUs. The kit includes software with a developer's studio and
debugger, an integrated 8051 assembler, and an RS-232 to JTAG serial adapter. It also has a target application board
with the associated MCU installed, plus the RS-232 and JTAG cables, and wall-mount power supply. The Development Kit requires a Windows 95/98/NT/ME computer with one available RS-232 serial port. As shown in Figure 1.7,
the PC is connected via RS-232 to the Serial Adapter. A six-inch ribbon cable connects the Serial Adapter to the
user's application board, picking up the four JTAG pins and VDD and GND. The Serial Adapter takes its power from
the application board. For applications where there is not sufficient power available from the target system, the provided power supply can be connected directly to the Serial Adapter.
Silicon Labs’ debug environment is a vastly superior configuration for developing and debugging embedded applications compared to standard MCU emulators, which use on-board "ICE Chips" and target cables and require the MCU
in the application board to be socketed. Silicon Labs' debug environment both increases ease of use and preserves the
performance of the precision analog peripherals.
Figure 1.7. Development/In-System Debug Diagram
CYGNAL Integrated
Development Environment
WINDOWS 95/98 /NT/ME/2000
RS-232
Serial
Adapter
JTAG (x4), VDD, GND
C8051
F12x
TARGET PCB
VDD GND
28Rev. 1.2
C8051F120/1/2/3/4/5/6/7
1.4.16 x 16 MAC (Multiply and Accumulate) Engine
The C8051F120/1/2/3 devices include a multiply and accumulate engine which can be used to speed up many mathematical operations. MAC0 contains a 16-by-16 bit multiplier and a 40-bit adder, which can perform integer or fractional multiply-accumulate and multiply operations on signed input values in two SYSCLK cycles. A rounding
engine provides a rounded 16-bit fractional result after an additional (third) SYSCLK cycle. MAC0 also contains a 1bit arithmetic shifter that will left or right-shift the contents of the 40-bit accumulator in a single SYSCLK cycle.
Figure 1.8. MAC0 Block Diagram
MAC0 A Register
MAC0AHMAC0AL
MAC0FM
16 x 16 Multiply
MAC0 B Register
MAC0BHMAC0BL
MAC0MS
1
0
0
40 bit Add
MAC0 Accumulator
MAC0OVRMAC0ACC3MAC0ACC2MAC0ACC1MAC0ACC0
Rounding Engine1 bit Shift
Flag Logic
MAC0 Rounding Register
MAC0RNDHMAC0RNDL
MAC0MS
MAC0FM
MAC0SAT
MAC0CA
MAC0SD
MAC0SC
MAC0CF
MAC0STA
MAC0HO
MAC0SO
MAC0Z
MAC0N
Rev. 1.229
C8051F120/1/2/3/4/5/6/7
1.5.Programmable Digital I/O and Crossbar
The standard 8051 Ports (0, 1, 2, and 3) are available on the MCUs. The C8051F120/2/4/6 have 4 additional ports (4,
5, 6, and 7) for a total of 64 general-purpose port I/O. The Port I/O behave like the standard 8051 with a few enhancements.
Each Port I/O pin can be configured as either a push-pull or open-drain output. Also, the "weak pull-ups" which are
normally fixed on an 8051 can be globally disabled, providing additional power saving capabilities for low-power
applications.
Perhaps the most unique enhancement is the Digital Crossbar. This is a large digital switching network that allows
mapping of internal digital system resources to Port I/O pins on P0, P1, P2, and P3. (See Figure 1.9) Unlike microcontrollers with standard multiplexed digital I/O, all combinations of functions are supported.
The on-chip counter/timers, serial buses, HW interrupts, ADC Start of Conversion inputs, comparator outputs, and
other digital signals in the controller can be configured to appear on the Port I/O pins specified in the Crossbar Control registers. This allows the user to select the exact mix of general purpose Port I/O and digital resources needed for
the particular application.
Highest
Priority
Lowest
Priority
Port
Latches
UART0
SPI
SMBus
UART1
PCA
Comptr.
Outputs
(Internal Digital Signals)
T0, T1,
T2, T2EX,
T4,T4EX
/INT0,
/INT1
/SYSCLK divided by 1,2,4, or 8
CNVSTR0/2
8
P0
(P0.0-P0.7)
8
P1
(P1.0-P1.7)
8
P2
(P2.0-P2.7)
8
P3
(P3.0-P3.7)
Figure 1.9. Digital Crossbar Diagram
2
4
2
2
7
2
XBR0, XBR1,
XBR2, P1MDIN
Registers
Priority
Decoder
Digital
Crossbar
8
2
To External
Memory
Interface
(EMIF)
P0MDOUT, P1MDOUT,
8
8
8
8
P2MDOUT, P3MDOUT
Registers
P0
I/O
Cells
P1
I/O
Cells
P2
I/O
Cells
P3
I/O
Cells
To
ADC2
Input
External
Pins
P0.0
P0.7
P1.0
P1.7
P2.0
P2.7
P3.0
P3.7
Highest
Priority
Lowest
Priority
30Rev. 1.2
C8051F120/1/2/3/4/5/6/7
1.6.Programmable Counter Array
The C8051F12x MCU family includes an on-board Programmable Counter/Timer Array (PCA) in addition to the five
16-bit general purpose counter/timers. The PCA consists of a dedicated 16-bit counter/timer time base with 6 programmable capture/compare modules. The timebase is clocked from one of six sources: the system clock divided by
12, the system clock divided by 4, Timer 0 overflow, an External Clock Input (ECI pin), the system clock, or the
external oscillator source divided by 8.
Each capture/compare module can be configured to operate in one of six modes: Edge-Triggered Capture, Software
Timer, High Speed Output, Frequency Output, 8-Bit Pulse Width Modulator, or 16-Bit Pulse Width Modulator. The
PCA Capture/Compare Module I/O and External Clock Input are routed to the MCU Port I/O via the Digital Crossbar.
Figure 1.10. PCA Block Diagram
SYSCLK/12
SYSCLK/4
Timer 0 Overflow
ECI
SYSCLK
External Clock/8
PCA
CLOCK
MUX
16-Bit Counter/Timer
ECI
Capture/Compare
Module 0
CEX0
Capture/Compare
Module 1
CEX1
Capture/Compare
Module 2
CEX2
Crossbar
Port I/O
Capture/Compare
Module 3
CEX3
Capture/Compare
Module 4
CEX4
Capture/Compare
Module 5
CEX5
Rev. 1.231
C8051F120/1/2/3/4/5/6/7
1.7.Serial Ports
The C8051F12x MCU Family includes two Enhanced Full-Duplex UARTs, SPI Bus, and SMBus/I2C. Each of the
serial buses is fully implemented in hardware and makes extensive use of the CIP-51's interrupts, thus requiring very
little intervention by the CPU. The serial buses do not "share" resources such as timers, interrupts, or Port I/O, so any
or all of the serial buses may be used together with any other.
32Rev. 1.2
C8051F120/1/2/3/4/5/6/7
1.8.12-Bit Analog to Digital Converter
The C8051F120/1/4/5 have an on-chip 12-bit SAR ADC (ADC0) with a 9-channel input multiplexer and programmable gain amplifier. With a maximum throughput of 100 ksps, the ADC offers true 12-bit linearity with an INL of
±1LSB. C8051F122/3/6/7 devices include a 10-bit SAR ADC with similar specifications and configuration options.
The ADC0 voltage reference is selected between the DAC0 output and an external VREF pin. On C8051F120/2/4/6
devices, ADC0 has its own dedicated VREF0 input pin; on C8051F121/3/5/7 devices, the ADC0 shares the VREFA
input pin with the 8-bit ADC2. The on-chip 15 ppm/°C voltage reference may generate the voltage reference for other
system components or the on-chip ADCs via the VREF output pin.
The ADC is under full control of the CIP-51 microcontroller via its associated Special Function Registers. One input
channel is tied to an internal temperature sensor, while the other eight channels are available externally. Each pair of
the eight external input channels can be configured as either two single-ended inputs or a single differential input.
The system controller can also put the ADC into shutdown mode to save power.
A programmable gain amplifier follows the analog multiplexer. The gain can be set in software from 0.5 to 16 in
powers of 2. The gain stage can be especially useful when different ADC input channels have widely varied input
voltage signals, or when it is necessary to "zoom in" on a signal with a large DC offset (in differential mode, a DAC
could be used to provide the DC offset).
Conversions can be started in four ways; a software command, an overflow of Timer 2, an overflow of Timer 3, or an
external signal input. This flexibility allows the start of conversion to be triggered by software events, external HW
signals, or a periodic timer overflow signal. Conversion completions are indicated by a status bit and an interrupt (if
enabled). The resulting 10 or 12-bit data word is latched into two SFRs upon completion of a conversion. The data
can be right or left justified in these registers under software control.
Window Compare registers for the ADC data can be configured to interrupt the controller when ADC data is within
or outside of a specified range. The ADC can monitor a key voltage continuously in background mode, but not interrupt the controller unless the converted data is within the specified window.
Figure 1.11. 12-Bit ADC Block Diagram
AIN0.0
AIN0.1
AIN0.2
AIN0.3
AIN0.4
AIN0.5
AIN0.6
AIN0.7
Analog Multiplexer
TEMP
SENSOR
AGND
+
-
+
-
+
-
+
-
9-to-1
AMUX
(SE or
DIFF)
Configuration, Control, and Data
Programmable Gain
Amplifi er
AV+
+
X
-
External VREF
DAC0 Output
Registers
Pin
12-Bit
SAR
ADC
VREF
Start
Conversion
Window Compare
Logic
12
Write to AD0BUSY
Timer 3 Overflow
CNVSTR0
Timer 2 Overflow
Compare
ADC Data
Registers
Conversion
Complete
Window
Interrupt
Interrupt
Rev. 1.233
C8051F120/1/2/3/4/5/6/7
1.9.8-Bit Analog to Digital Converter
The C8051F12x Family have an on-board 8-bit SAR ADC (ADC2) with an 8-channel input multiplexer and programmable gain amplifier. This ADC features a 500 ksps maximum throughput and true 8-bit linearity with an INL of
±1LSB. Eight input pins are available for measurement. The ADC is under full control of the CIP-51 microcontroller
via the Special Function Registers. The ADC2 voltage reference is selected between the analog power supply (AV+)
and an external VREF pin. On C8051F120/2/4/6 devices, ADC2 has its own dedicated VREF2 input pin; on
C8051F121/3/5/7 devices, ADC2 shares the VREFA input pin with the 12/10-bit ADC0. User software may put
ADC2 into shutdown mode to save power.
A programmable gain amplifier follows the analog multiplexer. The gain stage can be especially useful when different ADC input channels have widely varied input voltage signals, or when it is necessary to "zoom in" on a signal
with a large DC offset (in differential mode, a DAC could be used to provide the DC offset). The PGA gain can be set
in software to 0.5, 1, 2, or 4.
A flexible conversion scheduling system allows ADC2 conversions to be initiated by software commands, timer
overflows, or an external input signal. ADC2 conversions may also be synchronized with ADC0 software-commanded conversions. Conversion completions are indicated by a status bit and an interrupt (if enabled), and the
resulting 8-bit data word is latched into an SFR upon completion.
AIN2.0
AIN2.1
AIN2.2
AIN2.3
AIN2.4
AIN2.5
AIN2.6
AIN2.7
Analog Multiplexer
8-to-1
AMUX
Figure 1.12. 8-Bit ADC Diagram
Configuration, Control, and Data Registers
Programmable Gain
Amplifier
X
AV+
+
-
8-Bit
SAR
ADC
External VREF
Pin
AV+
VREF
Start Conversion
8
Window
Compare
Logic
Window
Compare
Interrupt
ADC Data
Register
Conversion
Complete
Interrupt
Write to AD2BUSY
Timer 3 Overflow
CNVSTR2 Input
Timer 2 Overflow
Write to AD0BUSY
(synchronized with
ADC0)
34Rev. 1.2
C8051F120/1/2/3/4/5/6/7
1.10.Comparators and DACs
Each C8051F12x MCU has two 12-bit DACs and two comparators on chip. The MCU data and control interface to
each comparator and DAC is via the Special Function Registers. The MCU can place any DAC or comparator in low
power shutdown mode.
The comparators have software programmable hysteresis and response time. The response time of the comparators
can be adjusted to minimize power consumption, or to maximize speed. Each comparator can generate an interrupt on
its rising edge, falling edge, or both; these interrupts are capable of waking up the MCU from sleep mode. The comparators' output state can also be polled in software. The comparator outputs can be programmed to appear on the Port
I/O pins via the Crossbar.
The DACs are voltage output mode, and include a flexible output scheduling mechanism. This scheduling mechanism allows DAC output updates to be forced by a software write or a Timer 2, 3, or 4 overflow. The DAC voltage
reference is supplied via the dedicated VREFD input pin on C8051F120/2/4/6 devices or via the internal voltage reference on C8051F121/3/5/7 devices. The DACs are useful as references for the comparators or offsets for the differential inputs of the ADC.
(Port I/O)
(Port I/O)
CP0+
CP0-
CP1+
CP1-
DAC0
Figure 1.13. Comparator and DAC Diagram
CP0
CP1
+
CP0
-
+
CP1
-
REF
DAC0
REF
CROSSBAR
CP0
CP1
SFR's
(Data
and
Cntrl)
CIP-51
and
Interrupt
Handler
DAC1
DAC1
Rev. 1.235
C8051F120/1/2/3/4/5/6/7
2.ABSOLUTE MAXIMUM RATINGS
Table 2.1. Absolute Maximum Ratings
PARAMETERCONDITIONSMINTYPMAXUNITS
Ambient temperature under bias-55125°C
Storage Temperature-65150°C
Voltage on any Pin (except VDD and Port I/O) with
respect to DGND
Voltage on any Port I/O Pin or /RST with respect to
DGND
Voltage on VDD with respect to DGND-0.34.2V
Maximum Total current through VDD, AV+, DGND,
and AGND
Maximum output current sunk by any Port pin100mA
Maximum output current sunk by any other I/O pin50mA
Maximum output current sourced by any Port pin100mA
Maximum output current sourced by any other I/O pin50mA
*
Stresses above those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. This
is a stress rating only and functional operation of the devices at those or any other conditions above those indicated
in the operation listings of this specification is not implied. Exposure to maximum rating conditions for extended
periods may affect device reliability.
*
-0.3VDD +
0.3
-0.35.8V
800mA
V
36Rev. 1.2
C8051F120/1/2/3/4/5/6/7
3.GLOBAL DC ELECTRICAL CHARACTERISTICS
Table 3.1. Global DC Electrical Characteristics (C8051F120/1/2/3)
-40°C TO +85°C, 100 MHZ SYSTEM CLOCK UNLESS OTHERWISE SPECIFIED.
PARAMETERCONDITIONSMINTYPMAXUNITS
Analog Supply Voltage (Note 1) SYSCLK = 0 to 50 MHz
SYSCLK > 50 MHz
Analog Supply CurrentInternal REF, ADC, DAC, Compar-
ators all active
Analog Supply Current with
analog sub-systems inactive
Analog-to-Digital Supply Delta
(|VDD - AV+|)
Digital Supply VoltageSYSCLK = 0 to 50 MHz
Digital Supply Current with
CPU active
Digital Supply Current with
CPU inactive (not accessing
FLASH)
Digital Supply Current (shutdown)
Internal REF, ADC, DAC, Comparators all disabled, oscillator disabled
Note 1: Analog Supply AV+ must be greater than 1 V for VDD monitor to operate.
Note 2: SYSCLK is the internal device clock. For operational speeds in excess of 25 MHz, SYSCLK must be
derived from the Phase-Locked Loop (PLL).
Note 3: SYSCLK must be at least 32 kHz to enable debugging.
VDD, AV+ = 2.7 V to 3.6 V
VDD, AV+ = 3.0 V to 3.6 V
Rev. 1.237
0
0
-40+85°C
1.5V
50
100
MHz
MHz
C8051F120/1/2/3/4/5/6/7
Table 3.2. Global DC Electrical Characteristics (C8051F124/5/6/7)
-40°C TO +85°C, 50 MHZ SYSTEM CLOCK UNLESS OTHERWISE SPECIFIED.
PARAMETERCONDITIONSMINTYPMAXUNITS
Analog Supply Voltage(Note 1)2.73.03.6V
Analog Supply CurrentInternal REF, ADC, DAC, Compar-
ators all active
Analog Supply Current with
analog sub-systems inactive
Analog-to-Digital Supply Delta
(|VDD - AV+|)
Digital Supply Voltage2.73.03.6V
Digital Supply Current with
CPU active
Digital Supply Current with
CPU inactive (not accessing
FLASH)
Digital Supply Current (shutdown)
Digital Supply RAM Data
Retention Voltage
SYSCLK (System Clock)
(Notes 2 and 3)
Internal REF, ADC, DAC, Comparators all disabled, oscillator disabled
Note 1: Analog Supply AV+ must be greater than 1 V for VDD monitor to operate.
Note 2: SYSCLK is the internal device clock. For operational speeds in excess of 25 MHz, SYSCLK must be
derived from the Phase-Locked Loop (PLL).
Note 3: SYSCLK must be at least 32 kHz to enable debugging.
38Rev. 1.2
-40+85°C
C8051F120/1/2/3/4/5/6/7
4.PINOUT AND PACKAGE DEFINITIONS
Table 4.1. Pin Definitions
Pin Numbers
Name
F120/
2/4/6
F121/
3/5/7
Type
Description
VDD37, 64, 9024, 41,
57
DGND38, 63, 8925, 40,
56
AV+11, 146Analog Supply Voltage. Must be tied to +2.7 to +3.6 V.
AGND10, 135Analog Ground. Must be tied to Ground.
TMS158D InJTAG Test Mode Select with internal pull-up.
TCK259D InJTAG Test Clock with internal pull-up.
TDI360D InJTAG Test Data Input with internal pull-up. TDI is latched on the
TDO461D Out JTAG Test Data Output with internal pull-up. Data is shifted out on
/RST562D I/O Device Reset. Open-drain output of internal VDD monitor. Is driven
XTAL12617A InCrystal Input. This pin is the return for the internal oscillator circuit
Digital Supply Voltage. Must be tied to +2.7 to +3.6 V.
Digital Ground. Must be tied to Ground.
rising edge of TCK.
TDO on the falling edge of TCK. TDO output is a tri-state driver.
low when VDD is < V
can initiate a system reset by driving this pin low.
for a crystal or ceramic resonator. For a precision internal clock,
connect a crystal or ceramic resonator from XTAL1 to XTAL2. If
overdriven by an external CMOS clock, this becomes the system
clock.
and MONEN is high. An external source
RST
XTAL22718A Out Crystal Output. This pin is the excitation driver for a crystal or
MONEN2819D InVDD Monitor Enable. When tied high, this pin enables the internal
VREF127A I/O Bandgap Voltage Reference Output (all devices).
VREFA8A InADC0 and ADC2 Voltage Reference Input.
VREF016A InADC0 Voltage Reference Input.
VREF217A InADC2 Voltage Reference Input.
VREFD15A InDAC Voltage Reference Input.
ceramic resonator.
VDD monitor, which forces a system reset when VDD is < V
When tied low, the internal VDD monitor is disabled.
This pin must be tied high or low.
DAC Voltage Reference Input (C8051F121/3/5/7 only).
Rev. 1.239
RST
.
C8051F120/1/2/3/4/5/6/7
Table 4.1. Pin Definitions
Pin Numbers
Name
AIN0.0189A InADC0 Input Channel 0 (See ADC0 Specification for complete
AIN0.11910A InADC0 Input Channel 1 (See ADC0 Specification for complete
AIN0.22011A InADC0 Input Channel 2 (See ADC0 Specification for complete
AIN0.32112A InADC0 Input Channel 3 (See ADC0 Specification for complete
AIN0.42213A InADC0 Input Channel 4 (See ADC0 Specification for complete
F120/
2/4/6
F121/
3/5/7
description).
description).
description).
description).
description).
Type
Description
AIN0.52314A InADC0 Input Channel 5 (See ADC0 Specification for complete
description).
AIN0.62415A InADC0 Input Channel 6 (See ADC0 Specification for complete
description).
AIN0.72516A InADC0 Input Channel 7 (See ADC0 Specification for complete
description).
CP0+94A InComparator 0 Non-Inverting Input.
CP0-83A InComparator 0 Inverting Input.
CP1+72A InComparator 1 Non-Inverting Input.
CP1-61A InComparator 1 Inverting Input.
DAC010064A Out Digital to Analog Converter 0 Voltage Output. (See DAC Specifica-
tion for complete description).
DAC19963A Out Digital to Analog Converter 1 Voltage Output. (See DAC Specifica-
tion for complete description).
P0.06255D I/O Port 0.0. See Port Input/Output section for complete description.
P0.16154D I/O Port 0.1. See Port Input/Output section for complete description.
P0.26053D I/O Port 0.2. See Port Input/Output section for complete description.
P0.35952D I/O Port 0.3. See Port Input/Output section for complete description.
P0.45851D I/O Port 0.4. See Port Input/Output section for complete description.
ALE/P0.55750D I/OALE Strobe for External Memory Address bus (multiplexed mode)
40Rev. 1.2
Port 0.5
See Port Input/Output section for complete description.
C8051F120/1/2/3/4/5/6/7
Table 4.1. Pin Definitions
Pin Numbers
Name
/RD/P0.65649D I/O/RD Strobe for External Memory Address bus
/WR/P0.75548D I/O/WR Strobe for External Memory Address bus
F120/
2/4/6
F121/
3/5/7
Port 0.6
See Port Input/Output section for complete description.
Port 0.7
See Port Input/Output section for complete description.
Type
Description
AIN2.0/A8/P1.03629A In
D I/O
AIN2.1/A9/P1.13528A In
D I/O
AIN2.2/A10/P1.23427A In
D I/O
AIN2.3/A11/P1.33326A In
D I/O
AIN2.4/A12/P1.43223A In
D I/O
AIN2.5/A13/P1.53122A In
D I/O
AIN2.6/A14/P1.63021A In
D I/O
AIN2.7/A15/P1.72920A In
D I/O
ADC2 Input Channel 0 (See ADC2 Specification for complete
description).
Bit 8 External Memory Address bus (Non-multiplexed mode)
Port 1.0
See Port Input/Output section for complete description.
Port 1.1. See Port Input/Output section for complete description.
Port 1.2. See Port Input/Output section for complete description.
Port 1.3. See Port Input/Output section for complete description.
Port 1.4. See Port Input/Output section for complete description.
Port 1.5. See Port Input/Output section for complete description.
Port 1.6. See Port Input/Output section for complete description.
Port 1.7. See Port Input/Output section for complete description.
A8m/A0/P2.04637D I/O Bit 8 External Memory Address bus (Multiplexed mode)
A9m/A1/P2.14536D I/O Port 2.1. See Port Input/Output section for complete description.
A10m/A2/P2.24435D I/OPort 2.2. See Port Input/Output section for complete description.
A11m/A3/P2.34334D I/O Port 2.3. See Port Input/Output section for complete description.
A12m/A4/P2.44233D I/OPort 2.4. See Port Input/Output section for complete description.
A13m/A5/P2.54132D I/OPort 2.5. See Port Input/Output section for complete description.
A14m/A6/P2.64031D I/OPort 2.6. See Port Input/Output section for complete description.
Bit 0 External Memory Address bus (Non-multiplexed mode)
Port 2.0
See Port Input/Output section for complete description.
Rev. 1.241
C8051F120/1/2/3/4/5/6/7
Table 4.1. Pin Definitions
Pin Numbers
Name
A15m/A7/P2.73930D I/OPort 2.7. See Port Input/Output section for complete description.
AD0/D0/P3.05447D I/OBit 0 External Memory Address/Data bus (Multiplexed mode)
AD1/D1/P3.15346D I/OPort 3.1. See Port Input/Output section for complete description.
AD2/D2/P3.25245D I/OPort 3.2. See Port Input/Output section for complete description.
AD3/D3/P3.35144D I/OPort 3.3. See Port Input/Output section for complete description.
AD4/D4/P3.45043D I/OPort 3.4. See Port Input/Output section for complete description.
F120/
2/4/6
F121/
3/5/7
Bit 0 External Memory Data bus (Non-multiplexed mode)
Port 3.0
See Port Input/Output section for complete description.
Type
Description
AD5/D5/P3.54942D I/OPort 3.5. See Port Input/Output section for complete description.
AD6/D6/P3.64839D I/OPort 3.6. See Port Input/Output section for complete description.
AD7/D7/P3.74738D I/OPort 3.7. See Port Input/Output section for complete description.
P4.098D I/OPort 4.0. See Port Input/Output section for complete description.
P4.197D I/OPort 4.1. See Port Input/Output section for complete description.
P4.296D I/OPort 4.2. See Port Input/Output section for complete description.
P4.395D I/OPort 4.3. See Port Input/Output section for complete description.
P4.494D I/OPort 4.4. See Port Input/Output section for complete description.
ALE/P4.593D I/O ALE Strobe for External Memory Address bus (multiplexed mode)
Port 4.5
See Port Input/Output section for complete description.
/RD/P4.692D I/O/RD Strobe for External Memory Address bus
Port 4.6
See Port Input/Output section for complete description.
/WR/P4.791D I/O/WR Strobe for External Memory Address bus
Port 4.7
See Port Input/Output section for complete description.
A8/P5.088D I/OBit 8 External Memory Address bus (Non-multiplexed mode)
A9/P5.187D I/OPort 5.1. See Port Input/Output section for complete description.
A10/P5.286D I/OPort 5.2. See Port Input/Output section for complete description.
A11/P5.385D I/OPort 5.3. See Port Input/Output section for complete description.
42Rev. 1.2
Port 5.0
See Port Input/Output section for complete description.
C8051F120/1/2/3/4/5/6/7
Table 4.1. Pin Definitions
Pin Numbers
Name
A12/P5.484D I/OPort 5.4. See Port Input/Output section for complete description.
A13/P5.583D I/OPort 5.5. See Port Input/Output section for complete description.
A14/P5.682D I/OPort 5.6. See Port Input/Output section for complete description.
A15/P5.781D I/OPort 5.7. See Port Input/Output section for complete description.
A8m/A0/P6.080D I/O Bit 8 External Memory Address bus (Multiplexed mode)
A9m/A1/P6.179D I/O Port 6.1. See Port Input/Output section for complete description.
F120/
2/4/6
F121/
3/5/7
Bit 0 External Memory Address bus (Non-multiplexed mode)
Port 6.0
See Port Input/Output section for complete description.
Type
Description
A10m/A2/P6.278D I/OPort 6.2. See Port Input/Output section for complete description.
A11m/A3/P6.377D I/O Port 6.3. See Port Input/Output section for complete description.
A12m/A4/P6.476D I/OPort 6.4. See Port Input/Output section for complete description.
A13m/A5/P6.575D I/OPort 6.5. See Port Input/Output section for complete description.
A14m/A6/P6.674D I/OPort 6.6. See Port Input/Output section for complete description.
A15m/A7/P6.773D I/OPort 6.7. See Port Input/Output section for complete description.
AD0/D0/P7.072D I/OBit 0 External Memory Address/Data bus (Multiplexed mode)
Bit 0 External Memory Data bus (Non-multiplexed mode)
Port 7.0
See Port Input/Output section for complete description.
AD1/D1/P7.171D I/OPort 7.1. See Port Input/Output section for complete description.
AD2/D2/P7.270D I/OPort 7.2. See Port Input/Output section for complete description.
AD3/D3/P7.369D I/OPort 7.3. See Port Input/Output section for complete description.
AD4/D4/P7.468D I/OPort 7.4. See Port Input/Output section for complete description.
AD5/D5/P7.567D I/OPort 7.5. See Port Input/Output section for complete description.
AD6/D6/P7.666D I/OPort 7.6. See Port Input/Output section for complete description.
AD7/D7/P7.765D I/OPort 7.7. See Port Input/Output section for complete description.
Rev. 1.243
C8051F120/1/2/3/4/5/6/7
Figure 4.1. TQFP-100 Pinout Diagram
DAC0
DAC1
P4.0
P4.1
P4.2
P4.3
P4.4
ALE/P4.5
/RD/P4.6
/WR/P4.7
VDD
DGND
A8/P5.0
A9/P5.1
A10/P5.2
A11/P5.3
A12/P5.4
A13/P5.5
A14/P5.6
A15/P5.7
A8m/A0/P6.0
A9m/A1/P6.1
A10m/A2/P6.2
A11m/A3/P6.3
A12m/A4/P6.4
TMS
TCK
TDI
TDO
/RST
CP1-
CP1+
CP0-
CP0+
AGND
AV+
VREF
AGND
AV+
VREFD
VREF0
VREF2
AIN0.0
AIN0.1
AIN0.2
AIN0.3
AIN0.4
AIN0.5
AIN0.6
AIN0.7
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
9998979695949392919089888786858483828180797877
100
1
2
3
4
5
6
7
8
9
C8051F120
C8051F122
C8051F124
C8051F126
76
75
A13m/A5/P6.5
74
A14m/A6/P6.6
73
A15m/A7/P6.7
72
AD0/D0/P7.0
71
AD1/D1/P7.1
70
AD2/D2/P7.2
69
AD3/D3/P7.3
68
AD4/D4/P7.4
67
AD5/D5/P7.5
66
AD6/D6/P7.6
65
AD7/D7/P7.7
64
VDD
63
DGND
62
P0.0
61
P0.1
60
P0.2
59
P0.3
58
P0.4
57
ALE/P0.5
56
/RD/P0.6
55
/WR/P0.7
54
AD0/D0/P3.0
53
AD1/D1/P3.1
52
AD2/D2/P3.2
51
AD3/D3/P3.3
262728293031323334353637383940
XTAL1
XTAL2
MONEN
AIN2.7/A15/P1.7
AIN2.6/A14/P1.6
44Rev. 1.2
AIN2.5/A13/P1.5
AIN2.4/A12/P1.4
AIN2.3/A11/P1.3
AIN2.2/A10/P1.2
41
424344454647484950
VDD
DGND
AD7/D7/P3.7
AD6/D6/P3.6
AD5/D5/P3.5
A9m/A1/P2.1
A15m/A7/P2.7
A14m/A6/P2.6
A13m/A5/P2.5
A12m/A4/P2.4
AIN2.1/A9/P1.1
AIN2.0/A8/P1.0
A11m/A3/P2.3
A10m/A2/P2.2
A8m/A0/P2.0
AD4/D4/P3.4
C8051F120/1/2/3/4/5/6/7
Figure 4.2. TQFP-100 Package Drawing
100
PIN 1
DESIGNATOR
D
D1
E1E
1
A
A1
A2
b
D
D1
e
E
E1
MIN
(mm)
-
0.05
0.95
0.17
-
-
-
-
-
NOM
(mm)
-
-
1.00
0.22
16.00
14.00
0.50
16.00
14.00
MAX
(mm)
1.20
0.15
1.05
0.27
-
-
-
-
-
A2
e
A
b
Rev. 1.245
A1
C8051F120/1/2/3/4/5/6/7
Figure 4.3. TQFP-64 Pinout Diagram
DAC0
DAC1
/RST
TDO
TDI
TCK
64
63
62
61
60
59
TMS
58
VDD
57
DGND
56
P0.0
55
P0.1
54
P0.2
53
P0.3
52
P0.4
51
ALE/P0.5
/RD/P0.6
50
49
CP1-
CP1+
CP0-
CP0+
AGND
AV+
VREF
VREFA
AIN0.0
AIN0.1
AIN0.2
AIN0.3
AIN0.4
AIN0.5
AIN0.6
AIN0.7
10
11
12
13
14
15
16
1
2
3
4
5
6
7
8
9
C8051F121
C8051F123
C8051F125
C8051F127
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
48
/WR/P0.7
47
AD0/D0/P3.0
46
AD1/D1/P3.1
45
AD2/D2/P3.2
44
AD3/D3/P3.3
43
AD4/D4/P3.4
42
AD5/D5/P3.5
41
VDD
40
DGND
39
AD6/D6/P3.6
38
AD7/D7/P3.7
37
A8m/A0/P2.0
36
A9m/A1/P2.1
35
A10m/A2/P2.2
34
A11m/A3/P2.3
33
A12m/A4/P2.4
XTAL1
XTAL2
46Rev. 1.2
MONEN
AIN2.7/A15/P1.7
AIN2.6/A14/P1.6
AIN2.5/A13/P1.5
AIN2.4/A12/P1.4
VDD
DGND
A15m/A7/P2.7
A14m/A6/P2.6
AIN2.3/A11/P1.3
AIN2.1/A9/P1.1
AIN2.2/A10/P1.2
AIN2.0/A8/P1.0
A13m/A5/P2.5
C8051F120/1/2/3/4/5/6/7
Figure 4.4. TQFP-64 Package Drawing
D
D1
64
PIN 1
DESIGNATOR
A2
MIN
(mm)
A
A1
0.05
E1
E
A2
b
0.95
0.17
D
D1
1
e
A
e
E
E1
b
A1
NOM
(mm)
-
0.22
-
12.00
-
10.00
-
0.50
-
12.00
-
10.00
MAX
(mm)
-
1.20
-
0.15
-
1.05
0.27
-
-
-
-
-
Rev. 1.247
C8051F120/1/2/3/4/5/6/7
48Rev. 1.2
C8051F120/1/2/3/4/5/6/7
5.ADC0 (12-BIT ADC, C8051F120/1/4/5 ONLY)
The ADC0 subsystem for the C8051F120/1/4/5 consists of a 9-channel, configurable analog multiplexer (AMUX0), a
programmable gain amplifier (PGA0), and a 100 ksps, 12-bit successive-approximation-register ADC with integrated
track-and-hold and Programmable Window Detector (see block diagram in Figure 5.1). The AMUX0, PGA0, Data
Conversion Modes, and Window Detector are all configurable under software control via the Special Function Registers shown in Figure 5.1. The voltage reference used by ADC0 is selected as described in Section “9. VOLTAGE
REFERENCE (C8051F120/2/4/6)” on page 107 for C8051F120/2/4/6 devices, or Section “10. VOLTAGE REFERENCE (C8051F121/3/5/7)” on page 109 for C8051F121/3/5/7 devices. The ADC0 subsystem (ADC0, track-
and-hold and PGA0) 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.
Figure 5.1. 12-Bit ADC0 Functional Block Diagram
ADC0LTLADC0LTHADC0GTLADC0GTH
24
AIN0.0
AIN0.1
AIN0.2
AIN0.3
AIN0.4
AIN0.5
AIN0.6
AIN0.7
TEMP
SENSOR
AGND
+
-
+
-
+
-
+
-
9-to-1
AMUX
(SE or
DIFF)
X
+
-
AD0EN
AV+
AGND
AV+
12-Bit
SAR
ADC
SYSCLK
AD0CM
REF
12
Start Conversion
Comb.
Logic
12
ADC0LADC0H
00
01
10
11
AD0WINT
AD0BUSY (W)
Timer 3 Overflow
CNVSTR0
Timer 2 Overflow
AIN01IC
AIN23IC
AIN45IC
AIN67IC
AMX0CF
5.1.Analog Multiplexer and PGA
Eight of the AMUX channels are available for external measurements while the ninth channel is internally connected
to an on-chip temperature sensor (temperature transfer function is shown in Figure 5.2). AMUX input pairs can be
programmed to operate in either differential or single-ended mode. This allows the user to select the best measurement technique for each input channel, and even accommodates mode changes "on-the-fly". The AMUX defaults to
all single-ended inputs upon reset. There are two registers associated with the AMUX: the Channel Selection register
AMX0SL (Figure 5.6), and the Configuration register AMX0CF (Figure 5.5). The table in Figure 5.6 shows AMUX
functionality by channel, for each possible configuration. The PGA amplifies the AMUX output signal by an amount
determined by the states of the AMP0GN2-0 bits in the ADC0 Configuration register, ADC0CF (Figure 5.7). The
PGA can be software-programmed for gains of 0.5, 2, 4, 8 or 16. Gain defaults to unity on reset.
AMX0AD3
AMX0SL
AMX0AD1
AMX0AD2
AMX0AD0
AD0SC4
AD0SC3
ADC0CF
AD0INT
AD0TM
AD0EN
ADC0CN
AD0BUSY
AD0LJST
AD0WINT
AD0CM0
AD0CM1
AD0CM
AMP0GN0
AMP0GN1
AMP0GN2
AD0SC0
AD0SC1
AD0SC2
Rev. 1.249
C8051F120/1/2/3/4/5/6/7
The Temperature Sensor transfer function is shown in Figure 5.2. The output voltage (V
) is the PGA input when
TEMP
the Temperature Sensor is selected by bits AMX0AD3-0 in register AMX0SL; this voltage will be amplified by the
PGA according to the user-programmed PGA settings.
Figure 5.2. Typical Temperature Sensor Transfer Function
(Volts)
1.000
0.900
0.800
V
= 0.00286(TEMPC) + 0.776
0.700
0.600
0.500
0-5050100
TEMP
for PGA Gain = 1
(Celsius)
50Rev. 1.2
C8051F120/1/2/3/4/5/6/7
5.2.ADC Modes of Operation
ADC0 has a maximum conversion speed of 100 ksps. The ADC0 conversion clock is derived from the system clock
divided by the value held in the ADCSC bits of register ADC0CF.
5.2.1.Starting a Conversion
A conversion can be initiated in one of four ways, depending on the programmed states of the ADC0 Start of Conversion Mode bits (AD0CM1, AD0CM0) in ADC0CN. Conversions may be initiated by:
The AD0BUSY bit is set to logic 1 during conversion and restored to logic 0 when conversion is complete. The falling edge of AD0BUSY triggers an interrupt (when enabled) and sets the AD0INT interrupt flag (ADC0CN.5). Converted data is available in the ADC0 data word MSB and LSB registers, ADC0H, ADC0L. Converted data can be
either left or right justified in the ADC0H:ADC0L register pair (see example in Figure 5.11) depending on the programmed state of the AD0LJST bit in the ADC0CN register.
When initiating conversions by writing a ‘1’ to AD0BUSY, the AD0INT bit should be polled to determine when a
conversion has completed (ADC0 interrupts may also be used). The recommended polling procedure is shown below.
Step 1. Write a ‘0’ to AD0INT;
Step 2. Write a ‘1’ to AD0BUSY;
Step 3. Poll AD0INT for ‘1’;
Step 4. Process ADC0 data.
When CNVSTR0 is used as a conversion start source, it must be enabled in the crossbar, and the corresponding pin
must be set to open-drain, high-impedance mode (see Section “19. PORT INPUT/OUTPUT” on page 215 for more
details on Port I/O configuration).
Rev. 1.251
C8051F120/1/2/3/4/5/6/7
5.2.2.Tracking Modes
The AD0TM bit in register ADC0CN controls the ADC0 track-and-hold mode. In its default state, the ADC0 input is
continuously tracked when a conversion is not in progress. When the AD0TM bit is logic 1, ADC0 operates in lowpower track-and-hold mode. In this mode, each conversion is preceded by a tracking period of 3 SAR clocks (after
the start-of-conversion signal). When the CNVSTR0 signal is used to initiate conversions in low-power tracking
mode, ADC0 tracks only when CNVSTR0 is low; conversion begins on the rising edge of CNVSTR0 (see
Figure 5.3). Tracking can also be disabled (shutdown) when the entire chip is in low power standby or sleep modes.
Low-power track-and-hold mode is also useful when AMUX or PGA settings are frequently changed, to ensure that
settling time requirements are met (see Section “5.2.3. Settling Time Requirements” on page 53).
Figure 5.3. ADC0 Track and Conversion Example Timing
A. ADC Timing for External Trigger Source
CNVSTR0
(AD0CM[1:0]=10)
12345678910111213141516
SAR Clocks
ADC0TM=1
ADC0TM=0
Timer 2, Timer 3 Overflow;
Write '1' to AD0BUSY
(AD0CM[1:0]=00, 01, 11)
SAR Clocks
ADC0TM=1
SAR Clocks
ADC0TM=0
Low Power
or Convert
Track Or ConvertConvertTrack
TrackConvertLow Power Mode
B. ADC Timing for Internal Trigger Sources
1234567891011121314151617 18 19
Low Power
or Convert
Track or
Convert
TrackConvertLow Power Mode
12345678910111213141516
ConvertTrack
52Rev. 1.2
C8051F120/1/2/3/4/5/6/7
5.2.3.Settling Time Requirements
When the ADC0 input configuration is changed (i.e., a different MUX or PGA selection is made), a minimum tracking time is required before an accurate conversion can be performed. This tracking time is determined by the ADC0
MUX resistance, the ADC0 sampling capacitance, any external source resistance, and the accuracy required for the
conversion. Figure 5.4 shows the equivalent ADC0 input circuits for both Differential and Single-ended modes.
Notice that the equivalent time constant for both input circuits is the same. The required settling time for a given settling accuracy (SA) may be approximated by Equation 5.1. When measuring the Temperature Sensor output, R
reduces to R
. An absolute minimum settling time of 1.5 µs is required after any MUX or PGA selection. Note
MUX
that in low-power tracking mode, three SAR clocks are used for tracking at the start of every conversion. For most
applications, these three SAR clocks will meet the tracking requirements.
Equation 5.1. ADC0 Settling Time Requirements
n
2
t
-------
×ln=
SA
R
TOTALCSAMPLE
TOTAL
Where:
SA is the settling accuracy, given as a fraction of an LSB (for example, 0.25 to settle within 1/4 LSB)
t is the required settling time in seconds
R
is the sum of the ADC0 MUX resistance and any external source resistance.
Bits3-2:AD0CM1-0: ADC0 Start of Conversion Mode Select.
Bit1:AD0WINT: ADC0 Window Compare Interrupt Flag.
Bit0:AD0LJST: ADC0 Left Justify Select.
0
0xE8(bit addressable)
0: ADC0 Disabled. ADC0 is in low-power shutdown.
1: ADC0 Enabled. ADC0 is active and ready for data conversions.
0: When the ADC is enabled, tracking is continuous unless a conversion is in process.
1: Tracking Defined by ADCM1-0 bits.
This flag must be cleared by software.
0: ADC0 has not completed a data conversion since the last time this flag was cleared.
1: ADC0 has completed a data conversion.
Read:
0: ADC0 Conversion is complete or a conversion is not currently in progress. AD0INT is set to
logic 1 on the falling edge of AD0BUSY.
1: ADC0 Conversion is in progress.
Write:
0: No Effect.
1: Initiates ADC0 Conversion if AD0CM1-0 = 00b.
If AD0TM = 0:
00: ADC0 conversion initiated on every write of ‘1’ to AD0BUSY.
01: ADC0 conversion initiated on overflow of Timer 3.
10: ADC0 conversion initiated on rising edge of external CNVSTR0.
11: ADC0 conversion initiated on overflow of Timer 2.
If AD0TM = 1:
00: Tracking starts with the write of ‘1’ to AD0BUSY and lasts for 3 SAR clocks, followed by conversion.
01: Tracking started by the overflow of Timer 3 and lasts for 3 SAR clocks, followed by conversion.
10: ADC0 tracks only when CNVSTR0 input is logic low; conversion starts on rising CNVSTR0
edge.
11: Tracking started by the overflow of Timer 2 and lasts for 3 SAR clocks, followed by conversion.
This bit must be cleared by software.
0: ADC0 Window Comparison Data match has not occurred since this flag was last cleared.
1: ADC0 Window Comparison Data match has occurred.
0: Data in ADC0H:ADC0L registers are right-justified.
1: Data in ADC0H:ADC0L registers are left-justified.
Rev. 1.257
C8051F120/1/2/3/4/5/6/7
Figure 5.9. ADC0H: ADC0 Data Word MSB Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
0
0xBF
Bits7-0:ADC0 Data Word High-Order Bits.
For AD0LJST = 0: Bits 7-4 are the sign extension of Bit3. Bits 3-0 are the upper 4 bits of the 12-bit
ADC0 Data Word.
For AD0LJST = 1: Bits 7-0 are the most-significant bits of the 12-bit ADC0 Data Word.
Figure 5.10. ADC0L: ADC0 Data Word LSB Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Bits7-0:ADC0 Data Word Low-Order Bits.
0
0xBE
For AD0LJST = 0: Bits 7-0 are the lower 8 bits of the 12-bit ADC0 Data Word.
For AD0LJST = 1: Bits 7-4 are the lower 4 bits of the 12-bit ADC0 Data Word. Bits3-0 will always
read ‘0’.
00000000
00000000
58Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 5.11. ADC0 Data Word Example
12-bit ADC0 Data Word appears in the ADC0 Data Word Registers as follows:
ADC0H[3:0]:ADC0L[7:0], if AD0LJST = 0
(ADC0H[7:4] will be sign-extension of ADC0H.3 for a differential reading, otherwise =
0000b).
ADC0H[7:0]:ADC0L[7:4], if AD0LJST = 1
(ADC0L[3:0] = 0000b).
Example: ADC0 Data Word Conversion Map, AIN0.0 Input in Single-Ended Mode
(AMX0CF = 0x00, AMX0SL = 0x00)
AIN0.0-AGND
(Volts)
VREF * (4095/4096)0x0FFF0xFFF0
VREF / 20x08000x8000
VREF * (2047/4096)0x07FF0x7FF0
00x00000x0000
ADC0H:ADC0L
(AD0LJST = 0)
ADC0H:ADC0L
(AD0LJST = 1)
Example: ADC0 Data Word Conversion Map, AIN0.0-AIN0.1 Differential Input Pair
(AMX0CF = 0x01, AMX0SL = 0x00)
AIN0.0-AIN0.1
(Volts)
VREF * (2047/2048)0x07FF0x7FF0
VREF / 20x04000x4000
VREF * (1/2048)0x00010x0010
00x00000x0000
-VREF * (1/2048)0xFFFF (-1d)0xFFF0
-VREF / 20xFC00 (-1024d)0xC000
-VREF0xF800 (-2048d)0x8000
For AD0LJST = 0:
CodeVin
×2n×=
ADC0H:ADC0L
(AD0LJST = 0)
Gain
---------------
VREF
ADC0H:ADC0L
(AD0LJST = 1)
; ‘n’ = 12 for Single-Ended; ‘n’=11 for Differential.
Rev. 1.259
C8051F120/1/2/3/4/5/6/7
5.3.ADC0 Programmable Window Detector
The ADC0 Programmable Window Detector continuously compares the ADC0 output to user-programmed limits,
and notifies the system when an out-of-bound condition is detected. This is especially effective in an interrupt-driven
system, saving code space and CPU bandwidth while delivering faster system response times. The window detector
interrupt flag (AD0WINT in ADC0CN) can also be used in polled mode. The high and low bytes of the reference
words are loaded into the ADC0 Greater-Than and ADC0 Less-Than registers (ADC0GTH, ADC0GTL, ADC0LTH,
and ADC0LTL). Reference comparisons are shown starting on page 62. Notice that the window detector flag can be
asserted when the measured data is inside or outside the user-programmed limits, depending on the programming of
the ADC0GTx and ADC0LTx registers.
Figure 5.12. ADC0GTH: ADC0 Greater-Than Data High Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
0
0xC5
Bits7-0:High byte of ADC0 Greater-Than Data Word.
Figure 5.13. ADC0GTL: ADC0 Greater-Than Data Low Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Bits7-0:Low byte of ADC0 Greater-Than Data Word.
0
0xC4
11111111
11111111
60Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 5.14. ADC0LTH: ADC0 Less-Than Data High Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
0
0xC7
Bits7-0:High byte of ADC0 Less-Than Data Word.
Figure 5.15. ADC0LTL: ADC0 Less-Than Data Low Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Bits7-0:Low byte of ADC0 Less-Than Data Word.
0
0xC6
00000000
00000000
Rev. 1.261
C8051F120/1/2/3/4/5/6/7
Figure 5.16. 12-Bit ADC0 Window Interrupt Example: Right Justified Single-Ended Data
Input Voltage
(AD0.0 - AGND)
REF x (4095/4096)
REF x (512/4096)
REF x (256/4096)
0
ADC Data
Word
0x0FFF
0x0201
0x0200
0x01FF
0x0101
0x0100
0x00FF
0x0000
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x00
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0x0200,
ADC0GTH:ADC0GTL = 0x0100.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x0200 and
> 0x0100.
Input Voltage
(AD0.0 - AGND)
REF x (4095/4096)
REF x (512/4096)
REF x (256/4096)
0
ADC Data
Word
0x0FFF
0x0201
0x0200
0x01FF
0x0101
0x0100
0x00FF
0x0000
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x00,
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0x0100,
ADC0GTH:ADC0GTL = 0x0200.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is > 0x0200 or
< 0x0100.
62Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 5.17. 12-Bit ADC0 Window Interrupt Example: Right Justified Differential Data
Input Voltage
(AD0.0 - AD0.1)
REF x (2047/2048)
REF x (256/2048)
REF x (-1/2048)
-REF
ADC Data
Word
0x07FF
0x0101
0x0100
0x00FF
0x0000
0xFFFF
0xFFFE
0xF800
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0x0100,
ADC0GTH:ADC0GTL = 0xFFFF.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x0100 and
> 0xFFFF. (In two’s-complement math,
0xFFFF = -1.)
Input Voltage
(AD0.0 - AD0.1)
REF x (2047/2048)
REF x (256/2048)
REF x (-1/2048)
-REF
ADC Data
Word
0x07FF
0x0101
0x0100
0x00FF
0x0000
0xFFFF
0xFFFE
0xF800
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0xFFFF,
ADC0GTH:ADC0GTL = 0x0100.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0xFFFF or
> 0x0100. (In two’s-complement math,
0xFFFF = -1.)
Rev. 1.263
C8051F120/1/2/3/4/5/6/7
Figure 5.18. 12-Bit ADC0 Window Interrupt Example: Left Justified Single-Ended Data
Input Voltage
(AD0.0 - AGND)
REF x (4095/4096)
REF x (512/4096)
REF x (256/4096)
0
ADC Data
Word
0xFFF0
0x2010
0x2000
0x1FF0
0x1010
0x1000
0x0FF0
0x0000
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x00,
AD0LJST = ‘1’,
ADC0LTH:ADC0LTL = 0x2000,
ADC0GTH:ADC0GTL = 0x1000.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x2000 and
> 0x1000.
Input Voltage
(AD0.0 - AGND)
REF x (4095/4096)
REF x (512/4096)
REF x (256/4096)
0
ADC Data
Word
0xFFF0
0x2010
0x2000
0x1FF0
0x1010
0x1000
0x0FF0
0x0000
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x00,
AD0LJST = ‘1’
ADC0LTH:ADC0LTL = 0x1000,
ADC0GTH:ADC0GTL = 0x2000.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x1000 or
> 0x2000.
64Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 5.19. 12-Bit ADC0 Window Interrupt Example: Left Justified Differential Data
Input Voltage
(AD0.0 - AD0.1)
REF x (2047/2048)
REF x (256/2048)
REF x (-1/2048)
-REF
ADC Data
Word
0x7FF0
0x1010
0x1000
0x0FF0
0x0000
0xFFF0
0xFFE0
0x8000
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘1’,
ADC0LTH:ADC0LTL = 0x1000,
ADC0GTH:ADC0GTL = 0xFFF0.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x1000 and
> 0xFFF0. (Two’s-complement math.)
Input Voltage
(AD0.0 - AD0.1)
REF x (2047/2048)
REF x (256/2048)
REF x (-1/2048)
-REF
ADC Data
Word
0x7FF0
0x1010
0x1000
0x0FF0
0x0000
0xFFF0
0xFFE0
0x8000
AD0WINT=1
ADC0GTH:ADC0GTL
AD0WINT
not affected
ADC0LTH:ADC0LTL
AD0WINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘1’,
ADC0LTH:ADC0LTL = 0xFFF0,
ADC0GTH:ADC0GTL = 0x1000.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0xFFF0 or
> 0x1000. (Two’s-complement math.)
DYNAMIC PERFORMANCE (10 kHz sine-wave input, 0 to 1 dB below Full Scale, 100 ksps
Signal-to-Noise Plus Distortion66dB
Total Harmonic Distortion
Spurious-Free Dynamic Range80dB
CONVERSION RATE
SAR Clock Frequency2.5MHz
Conversion Time in SAR Clocks16clocks
Track/Hold Acquisition Time1.5µs
Throughput Rate100ksps
ANALOG INPUTS
Input Voltage RangeSingle-ended operation0VREFV
*Common-mode Voltage RangeDifferential operationAGNDAV+V
Input Capacitance10pF
TEMPERATURE SENSOR
LinearityNote 1±0.2°C
GainNote 22.86
OffsetNote 1, Note 2, (Temp = 0 °C)776
POWER SPECIFICATIONS
Power Supply Current (AV+ supplied to ADC)
Power Supply Rejection±0.3mV/V
Note 1: Includes ADC offset, gain, and linearity variations.
Note 2: Represents one standard deviation from the mean.
Up to the 5
Operating Mode, 100 ksps450900µA
th
harmonic
-75dB
mV / °C
±0.034
mV
±8.5
66Rev. 1.2
C8051F120/1/2/3/4/5/6/7
6.ADC0 (10-BIT ADC, C8051F122/3/6/7 ONLY)
The ADC0 subsystem for the C8051F122/3/6/7 consists of a 9-channel, configurable analog multiplexer (AMUX0), a
programmable gain amplifier (PGA0), and a 100 ksps, 10-bit successive-approximation-register ADC with integrated
track-and-hold and Programmable Window Detector (see block diagram in Figure 6.1). The AMUX0, PGA0, Data
Conversion Modes, and Window Detector are all configurable under software control via the Special Function Registers shown in Figure 6.1. The voltage reference used by ADC0 is selected as described in Section “9. VOLTAGE
REFERENCE (C8051F120/2/4/6)” on page 107 for C8051F120/2/4/6 devices, or Section “10. VOLTAGE REFERENCE (C8051F121/3/5/7)” on page 109 for C8051F121/3/5/7 devices. The ADC0 subsystem (ADC0, track-
and-hold and PGA0) 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.
Figure 6.1. 10-Bit ADC0 Functional Block Diagram
ADC0LTLADC0LTHADC0GTLADC0GTH
20
AIN0.0
AIN0.1
AIN0.2
AIN0.3
AIN0.4
AIN0.5
AIN0.6
AIN0.7
TEMP
SENSOR
AGND
+
-
+
-
+
-
+
-
9-to-1
AMUX
(SE or
DIFF)
X
+
-
AD0EN
AV+
AGND
AV+
10-Bit
SAR
ADC
SYSCLK
AD0CM
REF
10
Start Conversion
Comb.
Logic
10
ADC0LADC0H
00
01
10
11
AD0WINT
AD0BUSY (W)
Timer 3 Overflow
CNVSTR0
Timer 2 Overflow
AIN01IC
AIN23IC
AIN45IC
AIN67IC
AMX0CF
6.1.Analog Multiplexer and PGA
Eight of the AMUX channels are available for external measurements while the ninth channel is internally connected
to an on-chip temperature sensor (temperature transfer function is shown in Figure 6.2). AMUX input pairs can be
programmed to operate in either differential or single-ended mode. This allows the user to select the best measurement technique for each input channel, and even accommodates mode changes "on-the-fly". The AMUX defaults to
all single-ended inputs upon reset. There are two registers associated with the AMUX: the Channel Selection register
AMX0SL (Figure 6.6), and the Configuration register AMX0CF (Figure 6.5). The table in Figure 6.6 shows AMUX
functionality by channel, for each possible configuration. The PGA amplifies the AMUX output signal by an amount
determined by the states of the AMP0GN2-0 bits in the ADC0 Configuration register, ADC0CF (Figure 6.7). The
PGA can be software-programmed for gains of 0.5, 2, 4, 8 or 16. Gain defaults to unity on reset.
AMX0AD3
AMX0SL
AMX0AD1
AMX0AD2
AMX0AD0
AD0SC4
AD0SC3
ADC0CF
AD0INT
AD0TM
AD0EN
ADC0CN
AD0BUSY
AD0LJST
AD0WINT
AD0CM0
AD0CM1
AD0CM
AMP0GN0
AMP0GN1
AMP0GN2
AD0SC0
AD0SC1
AD0SC2
Rev. 1.267
C8051F120/1/2/3/4/5/6/7
The Temperature Sensor transfer function is shown in Figure 6.2. The output voltage (V
) is the PGA input when
TEMP
the Temperature Sensor is selected by bits AMX0AD3-0 in register AMX0SL; this voltage will be amplified by the
PGA according to the user-programmed PGA settings.
Figure 6.2. Typical Temperature Sensor Transfer Function
(Volts)
1.000
0.900
0.800
V
= 0.00286(TEMPC) + 0.776
0.700
0.600
0.500
0-5050100
TEMP
for PGA Gain = 1
(Celsius)
68Rev. 1.2
C8051F120/1/2/3/4/5/6/7
6.2.ADC Modes of Operation
ADC0 has a maximum conversion speed of 100 ksps. The ADC0 conversion clock is derived from the system clock
divided by the value held in the ADCSC bits of register ADC0CF.
6.2.1.Starting a Conversion
A conversion can be initiated in one of four ways, depending on the programmed states of the ADC0 Start of Conversion Mode bits (AD0CM1, AD0CM0) in ADC0CN. Conversions may be initiated by:
The AD0BUSY bit is set to logic 1 during conversion and restored to logic 0 when conversion is complete. The falling edge of AD0BUSY triggers an interrupt (when enabled) and sets the AD0INT interrupt flag (ADC0CN.5). Converted data is available in the ADC0 data word MSB and LSB registers, ADC0H, ADC0L. Converted data can be
either left or right justified in the ADC0H:ADC0L register pair (see example in Figure 6.11) depending on the programmed state of the AD0LJST bit in the ADC0CN register.
When initiating conversions by writing a ‘1’ to AD0BUSY, the AD0INT bit should be polled to determine when a
conversion has completed (ADC0 interrupts may also be used). The recommended polling procedure is shown below.
Step 1. Write a ‘0’ to AD0INT;
Step 2. Write a ‘1’ to AD0BUSY;
Step 3. Poll AD0INT for ‘1’;
Step 4. Process ADC0 data.
When CNVSTR0 is used as a conversion start source, it must be enabled in the crossbar, and the corresponding pin
must be set to open-drain, high-impedance mode (see Section “19. PORT INPUT/OUTPUT” on page 215 for more
details on Port I/O configuration).
Rev. 1.269
C8051F120/1/2/3/4/5/6/7
6.2.2.Tracking Modes
The AD0TM bit in register ADC0CN controls the ADC0 track-and-hold mode. In its default state, the ADC0 input is
continuously tracked when a conversion is not in progress. When the AD0TM bit is logic 1, ADC0 operates in lowpower track-and-hold mode. In this mode, each conversion is preceded by a tracking period of 3 SAR clocks (after
the start-of-conversion signal). When the CNVSTR0 signal is used to initiate conversions in low-power tracking
mode, ADC0 tracks only when CNVSTR0 is low; conversion begins on the rising edge of CNVSTR0 (see
Figure 6.3). Tracking can also be disabled (shutdown) when the entire chip is in low power standby or sleep modes.
Low-power track-and-hold mode is also useful when AMUX or PGA settings are frequently changed, to ensure that
settling time requirements are met (see Section “6.2.3. Settling Time Requirements” on page 71).
Figure 6.3. ADC0 Track and Conversion Example Timing
A. ADC Timing for External Trigger Source
CNVSTR0
(AD0CM[1:0]=10)
12345678910111213141516
SAR Clocks
ADC0TM=1
ADC0TM=0
Timer 2, Timer 3 Overflow;
Write '1' to AD0BUSY
(AD0CM[1:0]=00, 01, 11)
SAR Clocks
ADC0TM=1
SAR Clocks
ADC0TM=0
Low Power
or Convert
Track Or ConvertConvertTrack
TrackConvertLow Power Mode
B. ADC Timing for Internal Trigger Sources
1234567891011121314151617 18 19
Low Power
or Convert
Track or
Convert
TrackConvertLow Power Mode
12345678910111213141516
ConvertTrack
70Rev. 1.2
C8051F120/1/2/3/4/5/6/7
6.2.3.Settling Time Requirements
When the ADC0 input configuration is changed (i.e., a different MUX or PGA selection is made), a minimum tracking time is required before an accurate conversion can be performed. This tracking time is determined by the ADC0
MUX resistance, the ADC0 sampling capacitance, any external source resistance, and the accuracy required for the
conversion. Figure 6.4 shows the equivalent ADC0 input circuits for both Differential and Single-ended modes.
Notice that the equivalent time constant for both input circuits is the same. The required settling time for a given settling accuracy (SA) may be approximated by Equation 6.1. When measuring the Temperature Sensor output, R
reduces to R
. An absolute minimum settling time of 1.5 µs is required after any MUX or PGA selection. Note
MUX
that in low-power tracking mode, three SAR clocks are used for tracking at the start of every conversion. For most
applications, these three SAR clocks will meet the tracking requirements.
Equation 6.1. ADC0 Settling Time Requirements
n
2
t
-------
×ln=
SA
R
TOTALCSAMPLE
TOTAL
Where:
SA is the settling accuracy, given as a fraction of an LSB (for example, 0.25 to settle within 1/4 LSB)
t is the required settling time in seconds
R
is the sum of the ADC0 MUX resistance and any external source resistance.
Bits3-2:AD0CM1-0: ADC0 Start of Conversion Mode Select.
Bit1:AD0WINT: ADC0 Window Compare Interrupt Flag.
Bit0:AD0LJST: ADC0 Left Justify Select.
0
0xE8(bit addressable)
0: ADC0 Disabled. ADC0 is in low-power shutdown.
1: ADC0 Enabled. ADC0 is active and ready for data conversions.
0: When the ADC is enabled, tracking is continuous unless a conversion is in process.
1: Tracking Defined by ADCM1-0 bits.
This flag must be cleared by software.
0: ADC0 has not completed a data conversion since the last time this flag was cleared.
1: ADC0 has completed a data conversion.
Read:
0: ADC0 Conversion is complete or a conversion is not currently in progress. AD0INT is set to
logic 1 on the falling edge of AD0BUSY.
1: ADC0 Conversion is in progress.
Write:
0: No Effect.
1: Initiates ADC0 Conversion if AD0CM1-0 = 00b.
If AD0TM = 0:
00: ADC0 conversion initiated on every write of ‘1’ to AD0BUSY.
01: ADC0 conversion initiated on overflow of Timer 3.
10: ADC0 conversion initiated on rising edge of external CNVSTR0.
11: ADC0 conversion initiated on overflow of Timer 2.
If AD0TM = 1:
00: Tracking starts with the write of ‘1’ to AD0BUSY and lasts for 3 SAR clocks, followed by conversion.
01: Tracking started by the overflow of Timer 3 and lasts for 3 SAR clocks, followed by conversion.
10: ADC0 tracks only when CNVSTR0 input is logic low; conversion starts on rising CNVSTR0
edge.
11: Tracking started by the overflow of Timer 2 and lasts for 3 SAR clocks, followed by conversion.
This bit must be cleared by software.
0: ADC0 Window Comparison Data match has not occurred since this flag was last cleared.
1: ADC0 Window Comparison Data match has occurred.
0: Data in ADC0H:ADC0L registers are right-justified.
1: Data in ADC0H:ADC0L registers are left-justified.
Rev. 1.275
C8051F120/1/2/3/4/5/6/7
Figure 6.9. ADC0H: ADC0 Data Word MSB Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
0
0xBF
Bits7-0:ADC0 Data Word High-Order Bits.
For AD0LJST = 0: Bits 7-4 are the sign extension of Bit3. Bits 3-0 are the upper 4 bits of the 10-bit
ADC0 Data Word.
For AD0LJST = 1: Bits 7-0 are the most-significant bits of the 10-bit ADC0 Data Word.
Figure 6.10. ADC0L: ADC0 Data Word LSB Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Bits7-0:ADC0 Data Word Low-Order Bits.
0
0xBE
For AD0LJST = 0: Bits 7-0 are the lower 8 bits of the 10-bit ADC0 Data Word.
For AD0LJST = 1: Bits 7-4 are the lower 4 bits of the 10-bit ADC0 Data Word. Bits3-0 will always
read ‘0’.
00000000
00000000
76Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 6.11. ADC0 Data Word Example
10-bit ADC0 Data Word appears in the ADC0 Data Word Registers as follows:
ADC0H[1:0]:ADC0L[7:0], if AD0LJST = 0
(ADC0H[7:2] will be sign-extension of ADC0H.1 for a differential reading, otherwise =
000000b).
ADC0H[7:0]:ADC0L[7:6], if AD0LJST = 1
(ADC0L[5:0] = 00b).
Example: ADC0 Data Word Conversion Map, AIN0.0 Input in Single-Ended Mode
(AMX0CF = 0x00, AMX0SL = 0x00)
AIN0.0-AGND
(Volts)
VREF * (1023/1024)0x03FF0xFFC0
VREF / 20x08000x8000
VREF * (511/1024)0x01FF0x7FC0
00x00000x0000
ADC0H:ADC0L
(AD0LJST = 0)
ADC0H:ADC0L
(AD0LJST = 1)
Example: ADC0 Data Word Conversion Map, AIN0.0-AIN0.1 Differential Input Pair
(AMX0CF = 0x01, AMX0SL = 0x00)
AIN0.0-AIN0.1
(Volts)
VREF * (511/512)0x01FF0x7FC0
VREF / 20x01000x4000
VREF * (1/512)0x00010x0040
00x00000x0000
-VREF * (1/512)0xFFFF (-1d)0xFFC0
-VREF / 20xFF00 (-256d)0xC000
-VREF0xFE00 (-512d)0x8000
For AD0LJST = 0:
CodeVin
×2n×=
ADC0H:ADC0L
(AD0LJST = 0)
Gain
---------------
VREF
ADC0H:ADC0L
(AD0LJST = 1)
; ‘n’ = 10 for Single-Ended; ‘n’= 9 for Differential.
Rev. 1.277
C8051F120/1/2/3/4/5/6/7
6.3.ADC0 Programmable Window Detector
The ADC0 Programmable Window Detector continuously compares the ADC0 output to user-programmed limits,
and notifies the system when an out-of-bound condition is detected. This is especially effective in an interrupt-driven
system, saving code space and CPU bandwidth while delivering faster system response times. The window detector
interrupt flag (AD0WINT in ADC0CN) can also be used in polled mode. The high and low bytes of the reference
words are loaded into the ADC0 Greater-Than and ADC0 Less-Than registers (ADC0GTH, ADC0GTL, ADC0LTH,
and ADC0LTL). Reference comparisons are shown starting on page 80. Notice that the window detector flag can be
asserted when the measured data is inside or outside the user-programmed limits, depending on the programming of
the ADC0GTx and ADC0LTx registers.
Figure 6.12. ADC0GTH: ADC0 Greater-Than Data High Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
0
0xC5
Bits7-0:High byte of ADC0 Greater-Than Data Word.
Figure 6.13. ADC0GTL: ADC0 Greater-Than Data Low Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Bits7-0:Low byte of ADC0 Greater-Than Data Word.
0
0xC4
11111111
11111111
78Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 6.14. ADC0LTH: ADC0 Less-Than Data High Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
0
0xC7
Bits7-0:High byte of ADC0 Less-Than Data Word.
Figure 6.15. ADC0LTL: ADC0 Less-Than Data Low Byte Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Bits7-0:Low byte of ADC0 Less-Than Data Word.
0
0xC6
00000000
00000000
Rev. 1.279
C8051F120/1/2/3/4/5/6/7
Figure 6.16. 10-Bit ADC0 Window Interrupt Example: Right Justified Single-Ended Data
Input Voltage
(AD0.0 - AGND)
REF x (1023/1024)
REF x (512/1024)
REF x (256/1024)
0
ADC Data
Word
0x03FF
0x0201
0x0200
0x01FF
0x0101
0x0100
0x00FF
0x0000
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x00
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0x0200,
ADC0GTH:ADC0GTL = 0x0100.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x0200 and
> 0x0100.
Input Voltage
(AD0.0 - AGND)
REF x (1023/1024)
REF x (512/1024)
REF x (256/1024)
0
ADC Data
Word
0x03FF
0x0201
0x0200
0x01FF
0x0101
0x0100
0x00FF
0x0000
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x00,
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0x0100,
ADC0GTH:ADC0GTL = 0x0200.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is > 0x0200 or
< 0x0100.
80Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 6.17. 10-Bit ADC0 Window Interrupt Example: Right Justified Differential Data
Input Voltage
(AD0.0 - AD0.1)
REF x (511/512)
REF x (256/512)
REF x (-1/512)
-REF
ADC Data
Word
0x01FF
0x0101
0x0100
0x00FF
0x0000
0xFFFF
0xFFFE
0xFE00
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0x0100,
ADC0GTH:ADC0GTL = 0xFFFF.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x0100 and
> 0xFFFF. (In two’s-complement math,
0xFFFF = -1.)
Input Voltage
(AD0.0 - AD0.1)
REF x (511/512)
REF x (256/512)
REF x (-1/512)
-REF
ADC Data
Word
0x01FF
0x0101
0x0100
0x00FF
0x0000
0xFFFF
0xFFFE
0xFE00
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘0’,
ADC0LTH:ADC0LTL = 0xFFFF,
ADC0GTH:ADC0GTL = 0x0100.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0xFFFF or
> 0x0100. (In two’s-complement math,
0xFFFF = -1.)
Rev. 1.281
C8051F120/1/2/3/4/5/6/7
Figure 6.18. 10-Bit ADC0 Window Interrupt Example: Left Justified Single-Ended Data
Input Voltage
(AD0.0 - AGND)
REF x (1023/1024)
REF x (512/1024)
REF x (256/1024)
0
ADC Data
Word
0xFFC0
0x8040
0x8000
0x7FC0
0x4040
0x4000
0x3FC0
0x0000
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x00,
AD0LJST = ‘1’,
ADC0LTH:ADC0LTL = 0x2000,
ADC0GTH:ADC0GTL = 0x1000.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x2000 and
> 0x1000.
Input Voltage
(AD0.0 - AGND)
REF x (1023/1024)
REF x (512/1024)
REF x (256/1024)
0
ADC Data
Word
0xFFC0
0x8040
0x8000
0x7FC0
0x4040
0x4000
0x3FC0
0x0000
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x00,
AD0LJST = ‘1’
ADC0LTH:ADC0LTL = 0x1000,
ADC0GTH:ADC0GTL = 0x2000.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x1000 or
> 0x2000.
82Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 6.19. 10-Bit ADC0 Window Interrupt Example: Left Justified Differential Data
Input Voltage
(AD0.0 - AD0.1)
REF x (511/512)
REF x (128/512)
REF x (-1/512)
-REF
ADC Data
Word
0x7FC0
0x2040
0x2000
0x1FC0
0x0000
0xFFC0
0xFF80
0x8000
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘1’,
ADC0LTH:ADC0LTL = 0x2000,
ADC0GTH:ADC0GTL = 0xFFC0.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0x2000 and
> 0xFFC0. (Two’s-complement math.)
Input Voltage
(AD0.0 - AD0.1)
REF x (511/512)
REF x (128/512)
REF x (-1/512)
-REF
ADC Data
Word
0x7FC0
0x2040
0x2000
0x1FC0
0x0000
0xFFC0
0xFF80
0x8000
ADWINT=1
ADC0GTH:ADC0GTL
ADWINT
not affected
ADC0LTH:ADC0LTL
ADWINT=1
Given:
AMX0SL = 0x00, AMX0CF = 0x01,
AD0LJST = ‘1’,
ADC0LTH:ADC0LTL = 0xFFC0,
ADC0GTH:ADC0GTL = 0x2000.
An ADC0 End of Conversion will cause an ADC0
Window Compare Interrupt (AD0WINT = ‘1’) if
the resulting ADC0 Data Word is < 0xFFC0 or
> 0x2000. (Two’s-complement math.)
DYNAMIC PERFORMANCE (10 kHz sine-wave input, 0 to 1 dB below Full Scale, 100 ksps
Signal-to-Noise Plus Distortion59dB
Total Harmonic Distortion
Spurious-Free Dynamic Range80dB
CONVERSION RATE
SAR Clock Frequency2.5MHz
Conversion Time in SAR Clocks16clocks
Track/Hold Acquisition Time1.5µs
Throughput Rate100ksps
ANALOG INPUTS
Input Voltage RangeSingle-ended operation0VREFV
*Common-mode Voltage RangeDifferential operationAGNDAV+V
Input Capacitance10pF
TEMPERATURE SENSOR
LinearityNote 1±0.2°C
GainNote 22.86
OffsetNote 1, Note 2, (Temp = 0 °C)776
POWER SPECIFICATIONS
Power Supply Current (AV+ supplied to ADC)
Power Supply Rejection±0.3mV/V
Note 1: Includes ADC offset, gain, and linearity variations.
Note 2: Represents one standard deviation from the mean.
Up to the 5
Operating Mode, 100 ksps450900µA
th
harmonic
-70dB
mV / °C
±0.034
mV
±8.5
84Rev. 1.2
C8051F120/1/2/3/4/5/6/7
7.ADC2 (8-BIT ADC)
The ADC2 subsystem for the C8051F120/1/2/3/4/5/6/7 consists of an 8-channel, configurable analog multiplexer
(AMUX2), a programmable gain amplifier (PGA2), and a 500 ksps, 8-bit successive-approximation-register ADC
with integrated track-and-hold (see block diagram in Figure 7.1). The AMUX2, PGA2, and Data Conversion Modes
are all configurable under software control via the Special Function Registers shown in Figure 7.1. The ADC2 subsystem (8-bit ADC, track-and-hold and PGA) is enabled only when the AD2EN bit in the ADC2 Control register
(ADC2CN) is set to logic 1. The ADC2 subsystem is in low power shutdown when this bit is logic 0. The voltage reference used by ADC2 is selected as described in Section “9. VOLTAGE REFERENCE (C8051F120/2/4/6)” on
page 107 for C8051F120/2/4/6 devices, or Section “10. VOLTAGE REFERENCE (C8051F121/3/5/7)” on
page 109 for C8051F121/3/5/7 devices.
Figure 7.1. ADC2 Functional Block Diagram
PIN67IC
AMX2CF
+
-
+
-
8-to-1
AMUX
+
-
+
-
PIN01IC
PIN23IC
PIN45IC
X
AMX2SLADC2CN
AIN2.0 (P1.0)
AIN2.1 (P1.1)
AIN2.2 (P1.2)
AIN2.3 (P1.3)
AIN2.4 (P1.4)
AIN2.5 (P1.5)
AIN2.6 (P1.6)
AIN2.7 (P1.7)
7.1.Analog Multiplexer and PGA
AD2EN
AV+
AV+
ADC2LTHADC2GTH
REF
SYSCLK
8
16
Dig
Comp
AD2WINT
8-Bit
+
SAR
-
AD2SC0
ADC
AMP2GN0
AMP2GN1
AD2BUSY
AD2INT
AD2TM
AD2EN
AGND
AMX2AD0
AMX2AD1
AMX2AD2
AD2SC3
AD2SC4
ADC2CF
AD2SC1
AD2SC2
8
Start Conversion
AD2CM
AD2WINT
AD2CM0
AD2CM1
AD2CM2
8
ADC2
000
001
010
011
1xx
AD2CM
Write to AD2BUSY
Timer 3 Overflow
CNVSTR2
Timer 2 Overflow
Write to AD0BUSY
(synchronized with
ADC0)
Eight ADC2 channels are available for measurement, as selected by the AMX2SL register (see Figure 7.5). The PGA
amplifies the ADC2 output signal by an amount determined by the states of the AMP2GN2-0 bits in the ADC2 Configuration register, ADC2CF (Figure 7.6). The PGA can be software-programmed for gains of 0.5, 1, 2, or 4. Gain
defaults to 0.5 on reset.
Important Note: AIN2 pins also function as Port 1 I/O pins, and must be configured as analog inputs when used as
ADC2 inputs. To configure an AIN2 pin for analog input, set to ‘0’ the corresponding bit in register P1MDIN. Port 1
pins selected as analog inputs are skipped by the Digital I/O Crossbar. See Section “19.1.5. Configuring Port 1 Pins
as Analog Inputs” on page 219 for more information on configuring the AIN2 pins.
Rev. 1.285
C8051F120/1/2/3/4/5/6/7
7.2.ADC2 Modes of Operation
ADC2 has a maximum conversion speed of 500 ksps. The ADC2 conversion clock (SAR2 clock) is a divided version
of the system clock, determined by the AD2SC bits in the ADC2CF register. The maximum ADC2 conversion clock
is 7.5 MHz.
7.2.1.Starting a Conversion
A conversion can be initiated in one of five ways, depending on the programmed states of the ADC2 Start of Conversion Mode bits (AD2CM2-0) in ADC2CN. Conversions may be initiated by:
5.Writing a ‘1’ to the AD0BUSY of register ADC0CN (initiate conversion of ADC2 and ADC0 with a
single software command).
During conversion, the AD2BUSY bit is set to logic 1 and restored to 0 when conversion is complete. The falling
edge of AD2BUSY triggers an interrupt (when enabled) and sets the interrupt flag in ADC2CN. Converted data is
available in the ADC2 data word, ADC2.
When a conversion is initiated by writing a ‘1’ to AD2BUSY, it is recommended to poll AD2INT to determine when
the conversion is complete. The recommended procedure is:
Step 1. Write a ‘0’ to AD2INT;
Step 2. Write a ‘1’ to AD2BUSY;
Step 3. Poll AD2INT for ‘1’;
Step 4. Process ADC2 data.
When CNVSTR2 is used as a conversion start source, it must be enabled in the crossbar, and the corresponding pin
must be set to open-drain, high-impedance mode (see Section “19. PORT INPUT/OUTPUT” on page 215 for more
details on Port I/O configuration).
7.2.2.Tracking Modes
The AD2TM bit in register ADC2CN controls the ADC2 track-and-hold mode. In its default state, the ADC2 input is
continuously tracked, except when a conversion is in progress. When the AD2TM bit is logic 1, ADC2 operates in
low-power track-and-hold mode. In this mode, each conversion is preceded by a tracking period of 3 SAR clocks
(after the start-of-conversion signal). When the CNVSTR2 signal is used to initiate conversions in low-power tracking mode, ADC2 tracks only when CNVSTR2 is low; conversion begins on the rising edge of CNVSTR2 (see
Figure 7.2). Tracking can also be disabled (shutdown) when the entire chip is in low power standby or sleep modes.
Low-power Track-and-Hold mode is also useful when AMUX or PGA settings are frequently changed, due to the settling time requirements described in Section “7.2.3. Settling Time Requirements” on page 88.
86Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 7.2. ADC2 Track and Conversion Example Timing
A. ADC Timing for External Trigger Source
CNVSTR2
(AD2CM[2:0]=010)
123456789
SAR Clocks
AD2TM=1
Write '1' to AD2BUSY,
Timer 3 Overflow,
Timer 2 Overflow,
Write '1' to AD0BUSY
(AD2CM[2:0]=000, 001, 011, 1xx)
SAR Clocks
AD2TM=1
SAR Clocks
AD2TM=0
Low Power
or Convert
Track or ConvertConvertTrackAD2TM=0
TrackConvertLow Power Mode
B. ADC Timing for Internal Trigger Source
123456789101112
Low Power
or Convert
Track or
Convert
TrackConvertLow Power Mode
123456789
ConvertTrack
Rev. 1.287
C8051F120/1/2/3/4/5/6/7
7.2.3.Settling Time Requirements
When the ADC2 input configuration is changed (i.e., a different MUX or PGA selection), a minimum tracking time is
required before an accurate conversion can be performed. This tracking time is determined by the ADC2 MUX resistance, the ADC2 sampling capacitance, any external source resistance, and the accuracy required for the conversion.
Figure 7.3 shows the equivalent ADC2 input circuit. The required ADC2 settling time for a given settling accuracy
(SA) may be approximated by Equation 7.1. Note: An absolute minimum settling time of 800 ns required after any
MUX selection. Note that in low-power tracking mode, three SAR2 clocks are used for tracking at the start of every
conversion. For most applications, these three SAR2 clocks will meet the tracking requirements.
Equation 7.1. ADC2 Settling Time Requirements
n
2
t
-------
SA
Where:
SA is the settling accuracy, given as a fraction of an LSB (for example, 0.25 to settle within 1/4 LSB)
t is the required settling time in seconds
R
is the sum of the ADC2 MUX resistance and any external source resistance.
Bits3-1:AD2CM2-0: ADC2 Start of Conversion Mode Select.
Bit0:AD2WINT: ADC2 Window Compare Interrupt Flag.
2
0xE8(bit addressable)
0: ADC2 Disabled. ADC2 is in low-power shutdown.
1: ADC2 Enabled. ADC2 is active and ready for data conversions.
0: Normal Track Mode: When ADC2 is enabled, tracking is continuous unless a conversion is in process.
1: Low-power Track Mode: Tracking Defined by AD2CM2-0 bits (see below).
This flag must be cleared by software.
0: ADC2 has not completed a data conversion since the last time this flag was cleared.
1: ADC2 has completed a data conversion.
Read:
0: ADC2 Conversion is complete or a conversion is not currently in progress. AD2INT is set to
logic 1 on the falling edge of AD2BUSY.
1: ADC2 Conversion is in progress.
Write:
0: No Effect.
1: Initiates ADC2 Conversion if AD2CM2-0 = 000b
AD2TM = 0:
000: ADC2 conversion initiated on every write of ‘1’ to AD2BUSY.
001: ADC2 conversion initiated on overflow of Timer 3.
010: ADC2 conversion initiated on rising edge of external CNVSTR2.
011: ADC2 conversion initiated on overflow of Timer 2.
1xx: ADC2 conversion initiated on write of ‘1’ to AD0BUSY (synchronized with ADC0 softwarecommanded conversions).
AD2TM = 1:
000: Tracking initiated on write of ‘1’ to AD2BUSY and lasts 3 SAR2 clocks, followed by conversion.
001: Tracking initiated on overflow of Timer 3 and lasts 3 SAR2 clocks, followed by conversion.
010: ADC2 tracks only when CNVSTR2 input is logic low; conversion starts on rising CNVSTR2
edge.
011: Tracking initiated on overflow of Timer 2 and lasts 3 SAR2 clocks, followed by conversion.
1xx: Tracking initiated on write of ‘1’ to AD0BUSY and lasts 3 SAR2 clocks, followed by conversion.
This bit must be cleared by software.
0: ADC2 Window Comparison Data match has not occurred since this flag was last cleared.
1: ADC2 Window Comparison Data match has occurred.
92Rev. 1.2
C8051F120/1/2/3/4/5/6/7
Figure 7.8. ADC2: ADC2 Data Word Register
SFR Page:
SFR Address:
R/WR/WR/WR/WR/WR/WR/WR/WReset Value
Bit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0
Bits7-0:ADC2 Data Word.
2
0xBE
Figure 7.9. ADC2 Data Word Example
Single-Ended Example:
8-bit ADC Data Word appears in the ADC2 Data Word Register as follows:
Example: ADC2 Data Word Conversion Map, Single-Ended AIN2.0 Input
(AMX2CF = 0x00; AMX2SL = 0x00)
AIN2.0-AGND
(Volts)
VREF * (255/256)0xFF
VREF * (128/256)0x80
VREF * (64/256)0x40
00x00
ADC2
00000000
Gain
CodeVin
Differential Example:
8-bit ADC Data Word appears in the ADC2 Data Word Register as follows:
Example: ADC2 Data Word Conversion Map, Differential AIN2.0-AIN2.1 Input
(AMX2CF = 0x01; AMX2SL = 0x00)
AIN2.0-AIN2.1
(Volts)
VREF * (127/128)0x7F
VREF * (64/128)0x40
00x00
-VREF * (64/128)0xC0 (-64d)
-VREF * (128/128)0x80 (-128d)
CodeVin
---------------
×256×=
VREF
Gain
-------------------------
×256×=
2V×REF
ADC2
Rev. 1.293
C8051F120/1/2/3/4/5/6/7
7.3.ADC2 Programmable Window Detector
The ADC2 Programmable Window Detector continuously compares the ADC2 output to user-programmed limits,
and notifies the system when a desired condition is detected. This is especially effective in an interrupt-driven system,
saving code space and CPU bandwidth while delivering faster system response times. The window detector interrupt
flag (AD2WINT in register ADC2CN) can also be used in polled mode. The ADC2 Greater-Than (ADC2GT) and
Less-Than (ADC2LT) registers hold the comparison values. Example comparisons for Differential and Single-ended
modes are shown in Figure 7.11 and Figure 7.10, respectively. Notice that the window detector flag can be programmed to indicate when measured data is inside or outside of the user-programmed limits, depending on the contents of the ADC2LT and ADC2GT registers.
7.3.1.Window Detector In Single-Ended Mode
Figure 7.10 shows two example window comparisons for Single-ended mode, with ADC2LT = 0x20 and
ADC2GT = 0x10. Notice that in Single-ended mode, the codes vary from 0 to VREF*(255/256) and are represented
as 8-bit unsigned integers. In the left example, an AD2WINT interrupt will be generated if the ADC2 conversion
word (ADC2) is within the range defined by ADC2GT and ADC2LT (if 0x10 < ADC2 < 0x20). In the right example,
and AD2WINT interrupt will be generated if ADC2 is outside of the range defined by ADC2GT and ADC2LT
(if ADC2 < 0x10 or ADC2 > 0x20).
Figure 7.11 shows two example window comparisons for differential mode, with ADC2LT = 0x10 (+16d) and
ADC2GT = 0xFF (-1d). Notice that in Differential mode, the codes vary from -VREF to VREF*(127/128) and are
represented as 8-bit 2’s complement signed integers. In the left example, an AD2WINT interrupt will be generated if
the ADC2 conversion word (ADC2L) is within the range defined by ADC2GT and ADC2LT (if 0xFF (-1d) < ADC2
< 0x0F (16d)). In the right example, an AD2WINT interrupt will be generated if ADC2 is outside of the range
defined by ADC2GT and ADC2LT (if ADC2 < 0xFF (-1d) or ADC2 > 0x10 (+16d)).
DYNAMIC PERFORMANCE (10 kHz sine-wave input, 1 dB below Full Scale, 500 ksps
Signal-to-Noise Plus DistortionTBD47dB
Total Harmonic Distortion
Spurious-Free Dynamic Range52dB
CONVERSION RATE
SAR Clock Frequency7.5MHz
Conversion Time in SAR Clocks8clocks
Track/Hold Acquisition Time800ns
Throughput Rate500ksps
ANALOG INPUTS
Input Voltage Range0VREFV
Input Capacitance5pF
POWER SPECIFICATIONS
Power Supply Current (AV+ supplied to ADC2)
Power Supply Rejection±0.3mV/V
Up to the 5
Operating Mode, 500 ksps420TBDµA
th
harmonic
51dB
Rev. 1.297
C8051F120/1/2/3/4/5/6/7
98Rev. 1.2
C8051F120/1/2/3/4/5/6/7
8.DACS, 12-BIT VOLTAGE MODE
Each C8051F12x device includes two on-chip 12-bit voltage-mode Digital-to-Analog Converters (DACs). Each
DAC has an output swing of 0 V to (VREF-1LSB) for a corresponding input code range of 0x000 to 0xFFF. The
DACs may be enabled/disabled via their corresponding control registers, DAC0CN and DAC1CN. While disabled,
the DAC output is maintained in a high-impedance state, and the DAC supply current falls to 1 µA or less. The voltage reference for each DAC is supplied at the VREFD pin (C8051F120/2/4/6 devices) or the VREF pin (C8051F121/
3/5/7 devices). Note that the VREF pin on C8051F121/3/5/7 devices may be driven by the internal voltage reference
or an external source. If the internal voltage reference is used it must be enabled in order for the DAC outputs to be
valid. See Section “9. VOLTAGE REFERENCE (C8051F120/2/4/6)” on page 107 or Section “10. VOLTAGE
REFERENCE (C8051F121/3/5/7)” on page 109 for more information on configuring the voltage reference for the
DACs.
8.1.DAC Output Scheduling
Each DAC features a flexible output update mechanism which allows for seamless full-scale changes and supports
jitter-free updates for waveform generation. The following examples are written in terms of DAC0, but DAC1 operation is identical.
8.1.1.Update Output On-Demand
In its default mode (DAC0CN.[4:3] = ‘00’) the DAC0 output is updated “on-demand” on a write to the high-byte of
the DAC0 data register (DAC0H). It is important to note that writes to DAC0L are held, and have no effect on the
DAC0 output until a write to DAC0H takes place. If writing a full 12-bit word to the DAC data registers, the 12-bit
data word is written to the low byte (DAC0L) and high byte (DAC0H) data registers. Data is latched into DAC0 after
Figure 8.1. DAC Functional Block Diagram
DAC0EN
DAC0H
Timer 3
Timer 4
Timer 2
DAC0MD1
DAC0MD0
DAC0DF2
DAC0CN
DAC0DF1
DAC0DF0
DAC1EN
DAC1MD1
DAC1MD0
DAC1DF2
DAC1CN
DAC1DF1
DAC1DF0
8
DAC0HDAC0L
8
DAC1H
8
DAC1HDAC1L
8
8
8
LatchLatch
Timer 3
Timer 4
Timer 2
8
8
LatchLatch
REF
AV+
12
DAC0
Dig. MUX
AGND
REF
AV+
12
DAC1
Dig. MUX
AGND
DAC0
DAC1
Rev. 1.299
C8051F120/1/2/3/4/5/6/7
a write to the corresponding DAC0H register, so the write sequence should be DAC0L followed by DAC0H if the
full 12-bit resolution is required. The DAC can be used in 8-bit mode by initializing DAC0L to the desired value (typically 0x00), and writing data to only DAC0H (also see Section 8.2 for information on formatting the 12-bit DAC
data word within the 16-bit SFR space).
8.1.2.Update Output Based on Timer Overflow
Similar to the ADC operation, in which an ADC conversion can be initiated by a timer overflow independently of the
processor, the DAC outputs can use a Timer overflow to schedule an output update event. This feature is useful in
systems where the DAC is used to generate a waveform of a defined sampling rate by eliminating the effects of variable interrupt latency and instruction execution on the timing of the DAC output. When the DAC0MD bits
(DAC0CN.[4:3]) are set to ‘01’, ‘10’, or ‘11’, writes to both DAC data registers (DAC0L and DAC0H) are held until
an associated Timer overflow event (Timer 3, Timer 4, or Timer 2, respectively) occurs, at which time the
DAC0H:DAC0L contents are copied to the DAC input latches allowing the DAC output to change to the new value.
8.2.DAC Output Scaling/Justification
In some instances, input data should be shifted prior to a DAC0 write operation to properly justify data within the
DAC input registers. This action would typically require one or more load and shift operations, adding software overhead and slowing DAC throughput. To alleviate this problem, the data-formatting feature provides a means for the
user to program the orientation of the DAC0 data word within data registers DAC0H and DAC0L. The three
DAC0DF bits (DAC0CN.[2:0]) allow the user to specify one of five data word orientations as shown in the DAC0CN
register definition.
DAC1 is functionally the same as DAC0 described above. The electrical specifications for both DAC0 and DAC1 are
given in Table 8.1.
100Rev. 1.2
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.