Two Independent ADCs (16- and 24-Bit Resolution)
24-Bit No Missing Codes, Primary ADC
13-Bit p-p Resolution @ 20 Hz, 20 mV Range
18-Bit p-p Resolution @ 20 Hz, 2.56 V Range
Memory
AIN1
AIN2
62Kbytes On-Chip Flash/EE Program Memory
4 KBytes On-Chip Flash/EE Data Memory
Flash/EE, 100 Yr Retention, 100 Kcycles Endurance
In Circuit Serial Download
AIN3
AIN4
AIN5
High Speed User Bootload (5s Download)
2304 Bytes On-Chip Data RAM
8051 Based Core
8051-Compatible Instruction Set (12.58 MHz Max)
32 kHz External Crystal, On-Chip Programmable PLL
11 Interrupt Sources, Two Priority Levels
Dual Data Pointer
Extended 11-bit Stack Pointer
On-Chip Peripherals
12-Bit Voltage Output DAC
Dual 16-Bit
Σ∆Σ∆
Σ∆ DACs/PWMs
Σ∆Σ∆
On-Chip Temperature Sensor
Dual Excitation Current Sources
Time Interval Counter (Real Time Clock/WakeUp Cct)
UART and SPI
®
Serial I/O
Timer 3 for high speed UART baud rates (incl 115,200)
Watchdog Timer (WDT), Power Supply Monitor (PSM)
Power
Specified for 3 V and 5 V Operation
Normal: 3 mA @ 3 V (Core CLK = 1.5 MHz)
Power-Down: 20µA max with wake-up cct running
GENERAL DESCRIPTION
The ADuC834 is a complete smart transducer front-end, integrating two high-resolution sigma delta ADCs, an 8-bit MCU,
and program/data Flash/EE Memory on a single chip.
The two independent ADCs (Primary and Auxiliary) include a
temperature sensor and a PGA (allowing direct measurement of
low-level signals). The ADCs with on-chip digital filtering and
programmable output data rates are intended for the measurement of wide dynamic range, low frequency signals, such as those
in weigh scale, strain-gauge, pressure transducer, or temperature
measurement applications.
The device operates from a 32 kHz crystal with an on-chip PLL
generating a high-frequency clock of 12.58 MHz. This clock is,
routed through a programmable clock divider from which the
MCU core clock operating frequency is generated. The microcontroller core is an 8052 and therefore 8051 instruction set
compatible with 12 core clock periods per machine cycle.
FUNCTIONAL BLOCK DIAGRAM
AVDD
12-BIT
DAC
16-BIT
Σ∆
DAC
16-BIT
Σ∆
DAC
16-BIT
PWM
16-BIT
PWM
PERIPHERALS
2304 BYTES USER R A M
POWER SUPPLY MON
WATCHDOG TIMER
UART AND SP I
SERIAL I/O
CURRE NT
SOURCE
BUF
MUX
IEX C 1
IEX C 2
DAC
PWM0
PWM1
AVDD
MUX
MUX
TEMP
SENSOR
INTERNAL
BANDGAP
VREF
EXTERNAL
VREF
DETEC T
REFIN+REFIN›
ADuC834
BUF
AGND
PROG.
CLOCK
DIVIDER
OSC
PLL
PGA
AUXILIARY
16-BIT Σ∆ ADC
&
XTAL2XTAL1
PRIMARY
Σ∆
ADC
24-BIT
8051-BASED MCU WITH ADDITIONAL
62 KBYTES FLASH/EE PROGRAM MEMORY
4 KBYTES FLASH/EE DATA MEMORY
3 × 16 BIT TIMERS
×
REAL TIME CLOCK
1
4 × PARALLE L
PORTS
62 Kbytes of nonvolatile Flash/EE program memory are provided
on-chip. 4 Kbytes of nonvolatile Flash/EE data memory, 256 bytes
RAM and 2 KBytes of extended RAM are also integrated on-chip.
The program memory can be configured as data memory in
datalogging applications.
The ADuC834 also incorporates additional analog functionality
with a 12-bit DAC, dual current sources, power supply monitor,
and a bandgap reference. On-chip digital peripherals include two
16-bit Σ∆ DACs/PWM, watchdog timer, real time clock (time
interval counter), four timers/counters, and two serial I/O ports
(UART and SPI).
On-chip factory firmware supports in-circuit serial download (via
UART), as well as single-pin emulation mode via the EA pin. A
functional block diagram of the ADuC834 is shown above with a
more detailed block diagram shown in figure 11 (page 18).
The part operates from a 3V or a 5V supply. When operating from
3V the power dissipation for the part is below 10mW. The
ADuC834 is housed in a 52-lead MQFP package.
Information furnished by Analog Devices is believed to be accurate and
reliable. However, no responsibility is assumed by Analog Devices for its
use, nor for any infringements of patents or other rights of third parties
which may result from its use. No license is granted by implication or
otherwise under any patent or patent rights of Analog Devices.
MicroConverter is a registered trademark of Analog Devices, Inc.
SPI is a registered trademark of Motorola Inc.
(AVDD = 2.7 V to 3.6 V or 4.75 V to 5.25 V, DVDD = 2.7 V to 3.6 V or 4.75 V to 5.25 V,
1
SPECIFICATIONS
ParameterADuC834BSTest Conditions/CommentsUnit
ADC SPECIFICATIONS
Conversion Rate5.4On Both ChannelsHz min
Primary ADC
No Missing Codes
Resolution13Range = ±20 mV, 20 Hz Update RateBits p-p typ
Output NoiseSee Table X and XIOutput Noise Varies with Selected
Integral Nonlinearity±151 LSB
Offset Error
Offset Error Drift±10nV/°C typ
Full-Scale Error
Gain Error Drift
ADC Range Matching±2AIN = 18 mVµV typ
Power Supply Rejection (PSR)113AIN = 7.8 mV, Range = ±20 mVdBs typ
Common-Mode DC Rejection
On AIN95At DC, AIN = 7.8 mV, Range = ±20 mV dBs min
On AIN113At DC, AIN = 1 V, Range = ±2.56 VdBs typ
On REFIN125At DC, AIN = 1 V, Range = ±2.56 VdBs typ
Common-Mode 50 Hz/60 Hz Rejection
On AIN9550 Hz/60 Hz ±1 Hz, AIN = 7.8 mV,dBs min
On REFIN9050 Hz/60 Hz ±1 Hz, AIN = 1 V,dBs min
Normal Mode 50 Hz/60 Hz Rejection
On AIN6050 Hz/60 Hz ±1 Hz, 20 Hz Update RatedBs min
On REFIN6050 Hz/60 Hz ±1 Hz, 20 Hz Update RatedBs min
Auxiliary ADC
No Missing Codes
Resolution16Range = ±2.5 V, 20 Hz Update RateBits p-p typ
Output NoiseSee Table XII inOutput Noise Varies with Selected
Integral Nonlinearity±1 5ppm of FSR max
Offset Error
Offset Error Drift1µV/°C typ
Full-Scale Error
Gain Error Drift
Power Supply Rejection (PSR)80AIN = 1 V, 20 Hz Update RatedBs min
Normal Mode 50 Hz/60 Hz Rejection
On AIN6050 Hz/60 Hz ±1 HzdBs min
On REFIN6050 Hz/60 Hz ±1 Hz, 20 Hz Update RatedBs min
DAC PERFORMANCE
DC Specifications
Resolution12Bits
Relative Accuracy±3LSB typ
Differential Nonlinearity–1Guaranteed 12-Bit MonotonicLSB max
Offset Error±50mV max
Gain Error
8
AC Specifications
Voltage Output Settling Time15Settling Time to 1 LSB of Final Valueµs typ
Digital-to-Analog Glitch Energy101 LSB Change at Major CarrynVs typ
105Programmable in 0.732 ms IncrementsHz max
2420 Hz Update RateBits min
18Range = ±2.56 V, 20 Hz Update RateBits p-p typ
in ADuC834 ADCUpdate Rate and Gain Range
Description (pg 30)
±3µV typ
16
±10µV typ
±0.5ppm/°C typ
80AIN = 1 V, Range = ±2.56 VdBs min
2
20 Hz Update Rate
Range = ±20 mV
9050 Hz/60 Hz ±1 Hz, AIN = 1 V ,dBs min
Range = ±2.56 V
2
Range = ±2.56 V
16Bits min
ADuC834 ADCUpdate Rate
Description (pg 30)
–2LSB typ
–2.5LSB typ
±0.5ppm/°C typ
2
±1AVDD Range% max
±1V
Range% typ
REF
ADuC834
ppm of FSR max
REV. PrC (12 March 2002)
–3–
Page 4
PRELIMINAR Y TECHNICAL D A TA
ADuC834–SPECIFICATIONS
1
ParameterADuC834BSTest Conditions/CommentsUnit
INTERNAL REFERENCE
ADC Reference
Reference Voltage1.25 ± 1%Initial Tolerance @ 25°C, V
Power Supply Rejection45dBs typ
Reference Tempco100ppm/°C typ
DAC Reference
Reference Voltage2.5 ± 1%Initial Tolerance @ 25°C, V
Power Supply Rejection50dBs typ
Reference Tempco±100ppm/°C typ
ANALOG INPUTS/REFERENCE INPUTS
Primary ADC
Differential Input Voltage Ranges
9, 10
External Reference Voltage = 2.5 V
RN2, RN1, RN0 of ADC0CON Set to
Bipolar Mode (ADC0CON3 = 0)±200 0 0(Unipolar Mode 0 to 20 mV)m V
±400 0 1(Unipolar Mode 0 to 40 mV)m V
±800 1 0(Unipolar Mode 0 to 80 mV)m V
±1600 1 1(Unipolar Mode 0 to 160 mV)m V
±3201 0 0(Unipolar Mode 0 to 320 mV)m V
±6401 0 1(Unipolar Mode 0 to 640 mV)m V
±1.281 1 0(Unipolar Mode 0 to 1.28 V)V
±2.561 1 1(Unipolar Mode 0 to 2.56 V)V
±1nA max
Analog Input Current
2
Analog Input Current Drift±5pA/°C typ
Absolute AIN Voltage LimitsAGND + 100 mVV min
– 100 mVV max
AV
Auxiliary ADC
Input Voltage Range
9, 10
DD
0 to V
REF
Unipolar Mode, for Bipolar ModeV
See Note 11
Average Analog Input Current125Input Current Will Vary with InputnA/V typ
Average Analog Input Current Drift
Absolute AIN Voltage Limits
External Reference Inputs
REFIN(+) to REFIN(–) Range
2
11
2
±2Voltage on the Unbuffered Auxiliary ADC pA/V/°C typ
AGND – 30 mVV min
AV
+ 30 mVV max
DD
1V min
AV
DD
Average Reference Input Current1Both ADCs EnabledµA/V typ
Average Reference Input Current Drift±0.1nA/V/°C typ
‘NO Ext. REF’ Trigger Voltage0. 3NOXREF Bit Active if V
0.65NOXREF Bit Inactive if V
ADC SYSTEM CALIBRATION
Full-Scale Calibration Limit+1.05 × FSV max
Zero-Scale Calibration Limit–1.05 × FSV min
Input Span0.8 × FSV min
2.1 × FSV max
ANALOG (DAC) OUTPUTS
Voltage Range0 to V
0 to AV
REF
DD
DACRN = 0 in DACCON SFRV typ
DACRN = 1 in DACCON SFRV typ
Resistive Load10From DAC Output to AGNDΩ typ
Capacitive Load100From DAC Output to AGNDpF typ
Output Impedance0.5Ω typ
I
SINK
50µA typ
TEMPERATURE SENSOR
Accuracy±2°C typ
Thermal Impedance (θJA)90°C/Ω typ
= 5 VV min/max
DD
= 5 VV min/max
DD
< 0.3 VV min
REF
> 0.65 VV max
REF
V max
–4–
(12 March 2002) REV. PrC
Page 5
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ParameterADuC834BSTest Conditions/CommentsUnit
TRANSDUCER BURNOUT CURRENT SOURCES
AIN+ Current–100AIN+ is the Selected Positive Input tonA typ
the Primary ADC
AIN– Current+100AIN– is the Selected Negative Input tonA typ
the Auxiliary ADC
Initial Tolerance @ 25°C±10% typ
Drift0.03%/°C typ
EXCITATION CURRENT SOURCES
Output Current–200Available from Each Current SourceµA typ
Initial Tolerance @ 25°C±10% typ
Drift200ppm/°C typ
Initial Current Matching @ 25°C± 1Matching Between Both Current Sources % typ
Drift Matching20ppm/°C typ
Line Regulation (AV
)1 AV
DD
Load Regulation0.1µA/V typ
Output ComplianceAV
– 0.6V max
DD
AGNDMin
LOGIC INPUTS
All Inputs Except SCLOCK, RESET,
and XTAL1
, Input Low Voltage0.8DVDD = 5 VV max
V
INL
0.4DV
, Input High Voltage2.0V min
V
INH
SCLOCK and RESET Only
(Schmitt-Triggered Inputs)
V
T+
2
1.3/3DVDD = 5 VV min/V max
0.95/2.5DV
V
T–
0.8/1.4DVDD = 5 VV min/V max
0.4/1.1DV
V
T+
– V
T–
0.3/0.85DVDD = 5 VV min/V max
0.3/0.85DV
Input Currents
Port 0, P1.2–P1.7, EA±10V
SCLOCK, MOSI, MISO, SS
12
–10 min, –40 maxVIN = 0 V, DVDD = 5 V, Internal Pull-Up µA min/µA ma x
±10V
RESET±10V
35 min, 105 maxV
P1.0, P1.1, Ports 2 and 3±1 0V
–180V
–660µA max
–20V
–75µA max
Input Capacitance5All Digital InputspF typ
CRYSTAL OSCILLATOR (XTAL1 AND XTAL2)
Logic Inputs, XTAL1 Only
V
, Input Low Voltage0.8DVDD = 5 VV max
INL
0.4DV
V
, Input High Voltage3.5DVDD = 5 VV min
INH
2.5DV
XTAL1 Input Capacitance18pF typ
XTAL2 Output Capacitance18pF typ
= 5 V + 5%µA/V typ
DD
= 3 VV max
DD
= 3 VV min/V max
DD
= 3 VV min/V max
DD
= 3 VV min/V max
DD
= 0 V or V
IN
= VDD, DVDD = 5 VµA max
IN
= 0 V, DVDD = 5 VµA max
IN
= VDD, DVDD = 5 V,µA min/µA max
IN
DD
µA max
Internal Pull-Down
= VDD, DVDD = 5 VµA max
IN
= 2 V, DVDD = 5 VµA min
IN
= 450 mV, DVDD = 5 VµA min
IN
= 3 VV max
DD
= 3 VV min
DD
REV. PrC (12 March 2002)
–5–
Page 6
PRELIMINAR Y TECHNICAL D A TA
ADuC834–SPECIFICATIONS
1
ParameterADuC834BSTest Conditions/CommentsUnit
LOGIC OUTPUTS (Not Including XTAL2)
VOH, Output High Voltage2.4VDD = 5 V, I
V
, Output Low Voltage
OL
13
Floating State Leakage Current± 10µA max
Floating State Output Capacitance5pF typ
POWER SUPPLY MONITOR (PSM)
AVDD Trip Point Selection Range2.63Four Trip Points Selectable in This Range V mi n
Power Supply Trip Point Accuracy±3.5% max
AV
DD
DV
Trip Point Selection Range2.63Four Trip Points Selectable in This Range V m in
DD
DVDD Power Supply Trip Point Accuracy±3.5% max
WATCHDOG TIMER (WDT)
Timeout Period0Nine Timeout Periods in This Rangems min
MCU CORE CLOCK RATEClock Rate Generated via On-Chip PLL
MCU Clock Rate
2
START-UP TIME
At Power-On300ms typ
From Idle Mode1ms typ
From Power-Down Mode
Oscillator RunningOSC_PD Bit = 0 in PLLCON SFR
Wakeup with INT0 Interrupt1ms typ
Wakeup with SPI Interrupt1ms typ
Wakeup with TIC Interrupt1ms typ
Wakeup with External RESET3.4ms typ
Oscillator Powered DownOSC_PD Bit = 1 in PLLCON SFR
Wakeup with External RESET0.9sec typ
After External RESET in Normal Mode3.3ms typ
After WDT Reset in Normal Mode3.3Controlled via WDCON SFRms typ
FLASH/EE MEMORY RELIABILITY CHARACTERISTICS
Endurance
Data Retention
15
16
POWER REQUIREMENTSDV
Power Supply Voltages
, 3 V Nominal Operation2.7V min
AV
DD
AV
, 5 V Nominal Operation4.75V min
DD
, 3 V Nominal Operation2.7V min
DV
DD
, 5 V Nominal Operation4.75V min
DV
DD
2
= 80 µAV min
2.4V
0.4I
= 3 V, I
DD
= 8 mA, SCLOCK/D0,V max
SINK
SOURCE
= 20 µAV min
SOURCE
MOSI/D1
0.4I
0.4I
= 10 mA, P1.0 and P1.1V max
SINK
= 1.6 mA, All Other OutputsV max
SINK
4.63Programmed via TPA1–0 in PSMCONV max
4.63Programmed via TPD1–0 in PSMCONV max
2000Programmed via PRE3–0 in WDCONms max
98.3Programmable via CD2–0 Bits inkHz min
PLLCON SFR
12.58MHz max
14
100,000Cycles min
100Years min
and AVDD Can Be Set
DD
Independently
3.6V max
5.25V max
3.6V max
5.25V max
–6–
(12 March 2002) REV. PrC
Page 7
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ParameterADuC834BSTest Conditions/CommentsUnit
POWER REQUIREMENTS (continued)
Power Supply Currents Normal Mode
DVDD Current4DVDD = 4.75 V to 5.25 V, Core CLK = 1.57 MHzmA max
Current170AVDD = 5.25 V, Core CLK = 1.57 MHzµA max
AV
DD
DV
Current15DVDD = 4.75 V to 5.25 V, Core CLK = 12.58 MH zmA max
DD
Current170AVDD = 5.25 V, Core CLK = 12.58 MHzµA max
AV
DD
Power Supply Currents Idle Mode
DVDD Current1.2DVDD = 4.75 V to 5.25 V, Core CLK = 1.57 MHzmA max
AV
Current2DVDD = 4.75 V to 5.25 V, Core CLK = 12.58 MH zmA typ
DD
AV
Current140Measured at AVDD = 5.25 V, Core CLK = 12.58 MHz µA typ
DD
Power Supply Currents Power-Down Mode
Current50DVDD = 4.75 V to 5.25 V, Osc. On, TIC OnµA max
DV
DD
AV
Current1Measured at AVDD = 5.25 V, Osc. On or Osc. OffµA max
DD
Current20DVDD = 4.75 V to 5.25 V, Osc. OffµA max
DV
DD
Typical Additional Power Supply CurrentsCore CLK = 1.57 MHz, AV
and DIDD)
(AI
DD
PSM Peripheral50µA typ
Primary ADC1mA typ
Auxiliary ADC500µA typ
DAC150µA typ
Dual Current Sources400µA typ
NOTES
1
Temperature Range –40°C to +85°C.
2
These numbers are not production tested but are guaranteed by Design and/or Characterization data on production release.
3
System Zero-Scale Calibration can remove this error.
4
The primary ADC is factory calibrated at 25°C with AVDD = DVDD = 5 V yielding this full-scale error of 10 µV. If user power supply or temperature conditions
are significantly different than these, an Internal Full-Scale Calibration will restore this error to 10 µV. A system zero-scale and full-scale calibration will remove
this error altogether.
5
Gain Error Drift is a span drift. To calculate Full-Scale Error Drift, add the Offset Error Drift to the Gain Error Drift times the full-scale input.
6
The auxiliary ADC is factory calibrated at 25°C with AVDD = DVDD = 5 V yielding this full-scale error of –2.5 LSB. A system zero-scale and full-scale calibration
will remove this error altogether.
7
DAC linearity and AC Specifications are calculated using:
reduced code range of 48 to 4095, 0 to V
reduced code range of 48 to 3995, 0 to VDD.
8
Gain Error is a measure of the span error of the DAC.
9
In general terms, the bipolar input voltage range to the primary ADC is given by Range
V
= REFIN(+) to REFIN(–) voltage and V
REF
RN = decimal equivalent of RN2, RN1, RN0,
e.g., V
In unipolar mode the effective range is 0 V to 1.28 V in our example.
10
1.25 V is used as the reference voltage to the ADC when internal V
11
In bipolar mode, the Auxiliary ADC can only be driven to a minimum of A
bipolar range is still –V
12
Pins configured in SPI mode, pins configured as digital inputs during this test.
13
Pins configured in High Current Output mode only.
14
Flash/EE Memory Reliability Characteristics apply to both the Flash/EE program memory and Flash/EE data memory.
15
Endurance is qualified to 100 Kcycles as per JEDEC Std. 22 method A117 and measured at –40°C, +25°C and +85°C, typical endurance at 25°C is 700
Kcycles.
16
Retention lifetime equivalent at junction temperature (TJ) = 55°C as per JEDEC Std. 22, Method A117. Retention lifetime based on an activation energy of
0.6eV will derate with junction temperature as shown in Figure 27 in the Flash/EE Memory description section of this data sheet.
17
Power Supply current consumption is measured in Normal, Idle, and Power-Down Modes under the following conditions:
Normal Mode: Reset = 0.4 V, Digital I/O pins = open circuit, Core Clk changed via CD bits in PLLCON, Core Executing internal software loop.
18
DVDD power supply current will increase typically by 3 mA (3 V operation) and 10 mA (5 V operation) during a Flash/EE memory program or erase cycle.
Specifications subject to change without notice
= 2.5 V and RN2, RN1, RN0 = 1, 1, 0 the Range
REF
to +V
REF
Idle Mode: Reset = 0.4 V, Digital I/O pins = open circuit, Core Clk changed via CD bits in PLLCON, PCON.0 = 1, Core Execution suspended in idle mode.
Power-Down Mode: Reset = 0.4 V, All P0 pins and P1.2–P1.7 pins = 0.4 V, All other digital I/O pins are open circuit, Core Clk changed via CD bits in
PLLCON, PCON.1 = 1, Core Execution suspended in power-down mode, OSC turned ON or OFF via OSC_PD bit (PLLCON.7) in
PLLCON SFR.
; however, the negative voltage is limited to –30 mV.
REF
17, 18
2.1DV
8DV
17, 18
750DV
1DV
17, 18
20DV
5DV
,
REF
= 1.25 V when internal ADC V
REF
= ±1.28 V.
ADC
REF
= 2.7 V to 3.6 V, Core CLK = 1.57 MH zmA max
DD
= 2.7 V to 3.6 V, Core CLK = 12.58 MH zmA max
DD
= 2.7 V to 3.6 V, Core CLK = 1.57 MH zµA typ
DD
= 2.7 V to 3.6 V, Core CLK = 12.58 MH zmA typ
DD
Core CLK = 1.57 MHz or 12.58 MHz
= 2.7 V to 3.6 V, Osc. On, TIC OnµA max
DD
= 2.7 V to 3.6 V, Osc. OffµA typ
DD
= ±(V
ADC
is selected.
REF
is selected via XREF0 and XREF1 bits in ADC0CON and ADC1CON respectively.
– 30 mV as indicated by the Auxiliary ADC absolute AIN voltage limits. The
GND
2RN)/125, where:
REF
= DVDD = 5 V
DD
REV. PrC (12 March 2002)
–7–
Page 8
ADuC834
PRELIMINAR Y TECHNICAL D A T A
(AVDD = 2.7 V to 3.6 V or 4.75 V to 5.25 V, DVDD = 2.7 V to 3.6 V or 4.75 V to 5.25 V; all
specifications T
MIN
to T
unless otherwise noted.)
MAX
TIMING SPECIFICATIONS
1, 2, 3
32.768 kHz External Crystal
ParameterMinTypMaxUnitFigure
CLOCK INPUT (External Clock Driven XTAL1)
t
CK
t
CKL
t
CKH
t
CKR
t
CKF
1/t
CORE
t
CORE
t
CYC
NOTES
1
AC inputs during testing are driven at DVDD – 0.5 V for a Logic 1, and 0.45 V for a Logic 0. Timing measurements are made at VIH min for a Logic 1, and VIL max
for a Logic 0 as shown in Figure 2.
2
For timing purposes, a port pin is no longer floating when a 100 mV change from load voltage occurs. A port pin begins to float when a 100 mV change from the
loaded VOH/VOL level occurs as shown in Figure 2.
3
C
for Port0, ALE, PSEN outputs = 100 pF; C
LOAD
4
ADuC834 internal PLL locks onto a multiple (384 times) the external crystal frequency of 32.768 kHz to provide a Stable 12.583 MHz internal clock for the
system. The core can operate at this frequency or at a binary submultiple called Core_Clk, selected via the PLLCON SFR.
5
This number is measured at the default Core_Clk operating frequency of 1.57 MHz.
6
ADuC834 Machine Cycle Time is nominally defined as 12/Core_CLK.
XTAL1 Period30.52µs1
XTAL1 Width Low15.16µs1
XTAL1 Width High15.16µs1
XTAL1 Rise Time20ns1
XTAL1 Fall Time20ns1
ADuC834 Core Clock Frequency
ADuC834 Core Clock Period
ADuC834 Machine Cycle Time
LOAD
4
5
6
0.09812.58MHz
0.636µs
0.957.6122.45µs
for all other outputs = 80 pF unless otherwise noted.
t
CHK
t
CKR
DVDD › 0.5 V
0.45V
t
CKL
t
CK
Figure 1. XTAL1 Input
+ 0.9V
0.2DV
DD
TEST POINTS
0.2DVDD › 0.1V
V
LOAD
V
LOAD
LOAD
+ 0.1V
› 0.1V
V
Figure 2. Timing Waveform Characteristics
t
TIMING
REFEREN CE
POINTS
CKF
V
V
LOAD
LOAD
› 0.1V
+ 0.1V
V
LOAD
–8–
(12 March 2002) REV. PrC
Page 9
PRELIMINAR Y TECHNICAL D A T A
ADuC834
12.58 MHz Core_ClkVariable Core_Clk
ParameterMinMaxMinMaxUnitFigure
EXTERNAL PROGRAM MEMORY
t
LHLL
t
AVLL
t
LLAX
t
LLIV
t
LLPL
t
PLPH
t
PLIV
t
PXIX
t
PXIZ
t
AVIV
t
PLAZ
t
PHAX
ALE Pulsewidth1192t
Address Valid to ALE Low39t
Address Hold after ALE Low49t
ALE Low to Valid Instruction In2184t
ALE Low to PSEN Low49t
PSEN Pulsewidth1933t
PSEN Low to Valid Instruction In1333t
– 40ns3
CORE
– 40ns3
CORE
– 30ns3
CORE
– 30ns3
CORE
– 45ns3
CORE
– 100ns3
CORE
– 105ns3
CORE
Input Instruction Hold after PSEN00ns3
Input Instruction Float after PSEN54t
Address to Valid Instruction In2925t
– 25ns3
CORE
– 105ns3
CORE
PSEN Low to Address Float2525ns3
Address Hold after PSEN High00ns3
CORE_C LK
ALE (O)
PSEN
(O)
PORT 0 (I/O)
PORT 2 (O)
t
LHLL
PLAZ
PCH
t
PLPH
t
LLIV
t
PLIV
t
PXIX
INSTRUCTION
(IN)
t
AVLL
PCL
(OUT )
t
LLPL
t
LLAX
t
t
AVIV
Figure 3. External Program Memory Read Cycle
t
PXIZ
t
PHAX
REV. PrC (12 March 2002)
–9–
Page 10
PRELIMINAR Y TECHNICAL D A T A
ADuC834
12.58 MHz Core_ClkVariable Core_Clk
ParameterMinMaxMinMaxUnitFigure
EXTERNAL DATA MEMORY READ CYCLE
t
RLRH
t
AVLL
t
LLAX
t
RLDV
t
RHDX
t
RHDZ
t
LLDV
t
AVDV
t
LLWL
t
AVWL
t
RLAZ
t
WHLH
RD Pulsewidth3776t
Address Valid after ALE Low39t
Address Hold after ALE Low44t
RD Low to Valid Data In2325t
– 100ns4
CORE
– 40ns4
CORE
– 35ns4
CORE
– 165ns4
CORE
Data and Address Hold after RD00ns4
Data Float after RD892t
ALE Low to Valid Data In4868t
Address to Valid Data In5509t
ALE Low to RD Low1882883t
Address Valid to RD Low1884t
– 503t
CORE
– 130ns4
CORE
– 70ns4
CORE
– 150ns4
CORE
– 165ns4
CORE
+ 50ns4
CORE
RD Low to Address Float00ns4
RD High to ALE High39119t
CORE_CLK
– 40t
CORE
+ 40ns4
CORE
ALE (O)
PSEN
(O)
RD
(O)
POR T 0 (I/O)
PORT 2 (O)
t
LLDV
t
AVLL
A0 › A7
(OUT )
t
A16
AVDV
› A23
t
LLAX
t
AVWL
t
LLWL
t
RLAZ
t
RLDV
A8
› A15
t
RLRH
t
RHDX
DATA (IN)
Figure 4. External Data Memory Read Cycle
t
WHLH
t
RHDZ
–10–
(12 March 2002) REV. PrC
Page 11
PRELIMINAR Y TECHNICAL D A T A
ADuC834
12.58 MHz Core_ClkVariable Core_Clk
ParameterMinMaxMinMaxUnitFigure
EXTERNAL DATA MEMORY WRITE CYCLE
t
WLWH
t
AVLL
t
LLAX
t
LLWL
t
AVWL
t
QVWX
t
QVWH
t
WHQX
t
WHLH
WR Pulsewidth3776t
Address Valid after ALE Low39t
Address Hold after ALE Low44t
ALE Low to WR Low1882883t
Address Valid to WR Low1884t
Data Valid to WR Transition29t
Data Setup before WR4067t
Data and Address Hold after WR29t
WR High to ALE High39119t
CORE_CLK
– 100ns5
CORE
– 40ns5
CORE
– 35ns5
CORE
– 503t
CORE
– 130ns5
CORE
– 50ns5
CORE
– 150ns5
CORE
– 50ns5
CORE
– 40t
CORE
+ 50ns5
CORE
+ 40ns5
CORE
ALE (O)
PSEN
(O)
WR
(O)
PORT 0 (O)
PORT 2 (O)
t
QVWX
t
QVWH
DATA
t
WLWH
t
LLWL
t
AVWL
t
t
AVLL
LLAX
A0 › A7
A16 › A23A8 › A15
Figure 5. External Data Memory Write Cycle
t
WHLH
t
WHQX
REV. PrC (12 March 2002)
–11–
Page 12
PRELIMINAR Y TECHNICAL D A T A
ADuC834
12.58 MHz Core_ClkVariable Core_Clk
ParameterMinTypMaxMinTypMaxUnitFigure
UART TIMING (Shift Register Mode)
t
XLXL
t
QVXH
t
DVXH
t
XHDX
t
XHQX
Serial Port Clock Cycle Time0.9512t
Output Data Setup to Clock66210t
Input Data Setup to Clock2922t
– 133ns6
CORE
+ 133ns6
CORE
CORE
µs6
Input Data Hold after Clock00ns6
Output Data Hold after Clock422t
ALE (O)
– 117ns6
CORE
t
XLXL
(OUTPUT CLOCK)
(OUTP U T D A TA )
TXD
RXD
RXD
(INPUT DATA)
01
MSB
67
t
QVXH
BIT 6MSB
t
DVXH
BIT 6BIT 1LSB
t
XHQX
t
XHDX
BIT 1
Figure 6. UART Timing in Shift Register Mode
SET RI
OR
SET TI
–12–
(12 March 2002) REV. PrC
Page 13
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ParameterMinTypMaxUnitFigure
SPI MASTER MODE TIMING (CPHA = 1)
t
SL
t
SH
t
DAV
t
DSU
t
DHD
t
DF
t
DR
t
SR
t
SF
NOTE
*Characterized under the following conditions:
a. Core clock divider bits CD2, CD1, and CD0 bits in PLLCON SFR set to 0, 1, and 1 respectively, i.e., core clock frequency = 1.57 MHz and
b. SPI bit-rate selection bits SPR1 and SPR0 bits in SPICON SFR set to 0 and 0 respectively.
SCLOCK Low Pulsewidth*630ns7
SCLOCK High Pulsewidth*630ns7
Data Output Valid after SCLOCK Edge50ns7
Data Input Setup Time before SCLOCK Edge100n s7
Data Input Hold Time after SCLOCK Edge100ns7
Data Output Fall Time1025ns7
Data Output Rise Time1025ns7
SCLOCK Rise Time1025ns7
SCLOCK Fall Time1025ns7
SCLOCK
(CPOL = 0)
SCLOCK
(CPOL = 1)
t
SH
t
SL
t
SR
t
SF
MOSI
MISO
t
DAV
t
DSU
MSB IN
t
DHD
t
DF
t
DR
BITS 6 › 1
BITS 6 › 1
Figure 7. SPI Master Mode Timing (CPHA = 1)
LSBMSB
LSB IN
REV. PrC (12 March 2002)
–13–
Page 14
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ParameterMinTypMaxUnitFigure
SPI MASTER MODE TIMING (CPHA = 0)
t
SL
t
SH
t
DAV
t
DOSU
t
DSU
t
DHD
t
DF
t
DR
t
SR
t
SF
NOTE
*Characterized under the following conditions:
a. Core clock divider bits CD2, CD1 and CD0 bits in PLLCON SFR set to 0, 1, and 1 respectively, i.e., core clock frequency = 1.57 MHz and
b. SPI bit-rate selection bits SPR1 and SPR0 bits in SPICON SFR set to 0 and 0 respectively.
SCLOCK Low Pulsewidth*630ns8
SCLOCK High Pulsewidth*630ns8
Data Output Valid after SCLOCK Edge50ns8
Data Output Setup before SCLOCK Edge150ns8
Data Input Setup Time before SCLOCK Edge100n s8
Data Input Hold Time after SCLOCK Edge100ns8
Data Output Fall Time1025ns8
Data Output Rise Time1025ns8
SCLOCK Rise Time1025ns8
SCLOCK Fall Time1025ns8
SCLOCK
(CPOL = 0)
SCLOCK
(CPOL = 1)
t
SH
t
SL
t
SR
t
SF
MOSI
MISO
t
DAV
t
DOSU
t
DSU
MSB IN
t
DF
MSBLSB
t
DHD
t
DR
BITS 6 › 1
Figure 8. SPI Master Mode Timing (CPHA = 0)
LSB INBITS 6 › 1
–14–
(12 March 2002) REV. PrC
Page 15
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ParameterMinTypMaxUnitFigure
SPI SLAVE MODE TIMING (CPHA = 1)
t
SS
t
SL
t
SH
t
DAV
t
DSU
t
DHD
t
DF
t
DR
t
SR
t
SF
t
SFS
SS to SCLOCK Edge0ns9
SCLOCK Low Pulsewidth330ns9
SCLOCK High Pulsewidth330ns9
Data Output Valid after SCLOCK Edge50ns9
Data Input Setup Time before SCLOCK Edge100n s9
Data Input Hold Time after SCLOCK Edge100ns9
Data Output Fall Time1025ns9
Data Output Rise Time1025ns9
SCLOCK Rise Time1025ns9
SCLOCK Fall Time1025ns9
SS High after SCLOCK Edge0ns9
SS
SCLOCK
(CPOL = 0)
SCLOCK
(CPOL = 1)
MISO
MOSI
t
SS
t
DF
MSB IN
MSB
t
DHD
t
SL
t
DF
t
DR
BITS 6
t
SH
t
DAV
t
DSU
Figure 9. SPI Slave Mode Timing (CPHA = 1)
t
SFS
t
SR
›
1
BITS 6
›
1LSB IN
LSB
t
SF
REV. PrC (12 March 2002)
–15–
Page 16
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ParameterMinTypMaxUnitFigure
SPI SLAVE MODE TIMING (CPHA = 0)
t
SS
t
SL
t
SH
t
DAV
t
DSU
t
DHD
t
DF
t
DR
t
SR
t
SF
t
SSR
t
DOSS
t
SFS
SS to SCLOCK Edge0ns10
SCLOCK Low Pulsewidth330ns10
SCLOCK High Pulsewidth330ns10
Data Output Valid after SCLOCK Edge50ns10
Data Input Setup Time before SCLOCK Edge100n s10
Data Input Hold Time after SCLOCK Edge100ns10
Data Output Fall Time1025ns10
Data Output Rise Time1025ns10
SCLOCK Rise Time1025ns10
SCLOCK Fall Time1025ns10
SS to SCLOCK Edge50ns10
Data Output Valid after SS Edge20ns10
SS High after SCLOCK Edge0ns10
SS
SCLOCK
(CPOL = 0)
SCLOCK
(CPOL = 1)
MISO
MOSI
t
DOSS
t
SS
t
DSU
MSB IN
MSB
t
DHD
t
SH
t
t
SL
t
DAV
DF
t
DR
BITS 6 › 1
BITS 6 › 1
Figure 10. SPI Slave Mode Timing (CPHA = 0)
t
SR
LSB IN
LSB
t
SFS
t
SF
–16–
(12 March 2002) REV. PrC
Page 17
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ABSOLUTE MAXIMUM RATINGS
(TA = 25°C unless otherwise noted)
1
AVDD to AGND . . . . . . . . . . . . . . . . . . . . . . –0.3 V to +7 V
AV
to DGND . . . . . . . . . . . . . . . . . . . . . . –0.3 V to +7 V
DD
to AGND . . . . . . . . . . . . . . . . . . . . . . –0.3 V to +7 V
DV
DD
to DGND . . . . . . . . . . . . . . . . . . . . . . –0.3 V to +7 V
DV
DD
AGND to DGND
AV
to DVDD . . . . . . . . . . . . . . . . . . . . . . . . . –2 V to +5 V
DD
Analog Input Voltage to AGND
Reference Input Voltage to AGND . . –0.3 V to AV
2
. . . . . . . . . . . . . . . . . . . –0.3 V to +0.3 V
Stresses above those listed under Absolute Maximum Ratings may cause perma-
nent damage to the device. This is a stress rating only; functional operation of the
device at these or any other conditions above those listed in the operational
sections of this specification is not implied. Exposure to absolute maximum rating
conditions for extended periods may affect device reliability.
2
AGND and DGND are shorted internally on the ADuC834.
3
Applies to P1.2 to P1.7 pins operating in analog or digital input modes.
PIN CONFIGURATION
52-Lead MQFP
ORDERING GUIDE
ModelTemperaturePackagePackage
RangeDescriptionOption
ADuC834BS–40°C to +85°C52-Lead Plastic Quad FlatpackS-52
QuickStart Development SystemDescription
Model
EVAL-ADUC834QSDevelopment System for the ADuC834 MicroConverter, Containing:
Evaluation Board
Serial Port Cable
Windows
®
Serial Downloader (WSD)
Windows Debugger/Emulator (with C source DeBug)
Windows ADuC834 Simulator (ADSIM)
Windows ADC Analysis Software Program (WASP)
8051 Assembler (Metalink)
Example Code
Documentation
CAUTION
ESD (electrostatic discharge) sensitive device. Electrostatic charges as high as 4000 V readily
accumulate on the human body and test equipment and can discharge without detection. Although
34
the ADuC8
features proprietary ESD protection circuitry, permanent damage may occur on
devices subjected to high-energy electrostatic discharges. Therefore, proper ESD precautions are
recommended to avoid performance degradation or loss of functionality.
Windows is a registered trademark of Microsoft Corporation.
* SHADED AREAS REPRESENT THE NEW FEATURES OF THE ADUC834 OVER THE ADUC824
Figure 11. ADuC834 Detailed Block Diagram
ADuC834 PIN BY PIN FUNCTION DESCRIPTION
Pin No.MnemonicType*Description
1, 2P1.0/P1.1I/OP1.0 and P1.1 can function as a digital inputs or digital outputs and have a
pull-up configuration as described below for Port 3. P1.0 and P1.1 have an
increased current drive sink capability of 10 mA.
P1.0/T2/PWM0I/OP1.0 and P1.1 also have various secondary functions as described below.
P1.0 can also be used to provide a clock input to Timer 2. When Enabled, counter
2 is incremented in response to a negative transition on the T2 input pin.
If the PWM is enabled then the PWM0 output will appear at this pin.
P1.1/T2EX/PWM1I/OP1.1 can also be used to provide a control input to Timer 2. When Enabled, a
negative transition on the T2EX input pin will cause a Timer 2 capture or reload
event.
If the PWM is enabled then the PWM1 output will appear at this pin.
–18–
(12 March 2002) REV. PrC
Page 19
PRELIMINAR Y TECHNICAL D A T A
ADuC834
Pin No.MnemonicType*Description
3-4, 9-12P1.2-P1.7IPort 1.2 to Port 1.7 have no digital output driver; they can function as a digital
input for which ‘0’ must be written to the port bit. As a digital input, these pins
must be driven high or low externally.
These pins also have the following analog functionality:
P1.2/DAC/IEXC1I/OThe voltage output from the DAC or one or both current sources (20 0 µ A o r 2 x
200 µA ) can be configured to appear at this pin.
P1.3/AIN5/IEXC2I/OAuxiliary ADC Input or one or both current sources can be configured at this pin.
P1.4/AIN1IPrimary ADC, Positive Analog Input
P1.5/AIN2IPrimary ADC, Negative Analog Input
P1.6/AIN3IAuxiliary ADC Input or muxed Primary ADC, Positive Analog Input
P1.7/AIN4/DACI/OAuxiliary ADC Input or muxed Primary ADC, Negative Analog Input. The voltage
output from the DAC can also be configured to appear at this pin.
5AV
6AGNDSAnalog Ground. Ground reference pin for the analog circuitry.
13SSISlave Select Input for the SPI Interface. A weak pull-up is present on this pin.
14MISOI/OMaster Input/Slave Output for the SPI Interface. There is a weak pull-up on this
15RESETIReset Input. A high level on this pin for 16 core clock cycles while the oscillator is
16–19,P3.0–P3.7I/OP3.0–P3.7 are bidirectional port pins with internal pull-up resistors. Port 3 pins
22-25that have 1s written to them are pulled high by the internal pull-up resistors, and
DD
P3.0/RXDI/OReceiver Data for UART serial Port
P3.1/TXDI/OTransmitter Data for UART serial Port
P3.2/INT0I/OExternal Interrupt 0. This pin can also be used as a gate control input to Timer0.
P3.3/INT1I/OExternal Interrupt 1. This pin can also be used as a gate control input to Timer1.
P3.4/T0I/OTimer/Counter 0 External Input
P3.5/T1I/OTimer/Counter 1 External Input
P3.6/WRI/OExternal Data Memory Write Strobe. Latches the data byte from Port 0 into an
P3.7/RDI/OExternal Data Memory Read Strobe. Enables the data from an external data
SAnalog Supply Voltage, 3 V or 5 V
input pin.
running resets the device. There is an internal weak pull-down and a Schmitt
trigger input stage on this pin.
in that state can be used as inputs. As inputs, Port 3 pins being pulled externally
low will source current because of the internal pull-up resistors. When driving a
0-to-1 output transition, a strong pull-up is active for two core clock periods of
the instruction cycle.
Port 3 pins also have various secondary functions described below.
external data memory.
memory to Port 0.
20, 34, 48DV
21, 35, 47DGNDSDigital ground, ground reference point for the digital circuitry.
26SCLOCK/D0I/OSerial interface clock for the SPI interface. As an input this pin i s a Schmitt
27MOSI/D1I/OSerial master output/slave input data for the SPI interface. A weak internal
REV. PrC (12 March 2002)
DD
SDigital supply, 3 V or 5 V.
triggered input and a weak internal pull-up is present on this pin unless it is
outputting logic low.
This pin can also be controlled directly in software as a digital output pin.
pull-up is present on this pin unless it is outputting logic low.
This pin can also be controlled directly in software as a digital output pin.
–19–
Page 20
PRELIMINAR Y TECHNICAL D A T A
ADuC834
Pin No.MnemonicType*Description
28–31P2.0–P2.7I/OPort 2 is a bidirectional port with internal pull-up resistors. Port 2 pins that have 1s
36-39(A8–A15)written to them are pulled high by the internal pull-up resistors, and in that state can
(A16–A23)be used as inputs. As inputs, Port 2 pins being pulled externally low will source current
because of the internal pull-up resistors.
Port 2 emits the high order address bytes during fetches from external program
memory and middle and high order address bytes during accesses to the 24-bit
external data memory space.
32XTAL1IInput to the crystal oscillator inverter.
33XTAL2OOutput from the crystal oscillator inverter. (see page 68 for description)
40EAI/OExternal Access Enable, Logic Input. When held high, this input enables the device
to fetch code from internal program memory locations 0000h to F800h. When held
low this input enables the device to fetch all instructions from external program
memory. To determine the mode of code execution, i.e., internal or external, the
EA pin is sampled at the end of an external RESET assertion or as part of a device
power cycle.
EA may also be used as an external emulation I/O pin and therefore the voltage
level at this pin must not be changed during normal mode operation as it may
cause an emulation interrupt that will halt code execution.
41PSENOProgram Store Enable, Logic Output. This output is a control signal that enables
the external program memory to the bus during external fetch operations. It is
active every six oscillator periods except during external data memory accesses.
This pin remains high during internal program execution.
PSEN can also be used to enable serial download mode when pulled low through a
resistor at the end of an external RESET assertion or as part of a device power cycle.
42ALEOAddress Latch Enable, Logic Output. This output is used to latch the low byte (and
page byte for 24-bit data address space accesses) of the address to external memory
during external code or data memory access cycles. It is activated every six oscillator
periods except during an external data memory access. It can be disabled by setting
the PCON.4 bit in the PCON SFR.
43–46P0.0–P0.7I/OP0.0–P0.7, these pins are part of Port0 which is an 8-bit open-drain bidirectional
49–52(AD0–AD3)I/O port. Port 0 pins that have 1s written to them float and in that state can be used
(AD4–AD7)as high impedance inputs. An external pull-up resistor will be required on P0
outputs to force a valid logic high level externally. Port 0 is also the multiplexed
low-order address and data bus during accesses to external program or data memory.
In this application it uses strong internal pull-ups when emitting 1s.
*I = Input, O = Output, S = Supply.
NOTES
1. In the following descriptions, SET implies a Logic 1 state and CLEARED implies a Logic 0 state unless otherwise stated.
2. In the following descriptions, SET and CLEARED also imply that the bit is set or automatically cleared by the ADuC834 hardware unless otherwise stated.
3. User software should not write 1s to reserved or unimplemented bits as they may be used in future products.
–20–
(12 March 2002) REV. PrC
Page 21
PRELIMINAR Y TECHNICAL D A T A
ADuC834
MEMORY ORGANIZATION
The ADuC834 contains 4 different memory blocks namely:
- 62kBytes of On-Chip Flash/EE Program Memory
- 4kBytes of On-Chip Flash/EE Data Memory
- 256 Bytes of General Purpose RAM
- 2kBytes of Internal XRAM
(1) Flash/EE Program Memory
The ADuC834 provides 62kBytes of Flash/EE program
memory to run user code. The user can choose to run code
from this internal memory or run code from an external program memory.
If the user applies power or resets the device while the EA pin
is pulled low, the part will execute code from the external program space, otherwise the part defaults to code execution
from i ts internal 62kBytes of Flash/EE program memory. Unlike the ADuC824, where code execution can overflow from the
internal code space to external code space once the PC becomes greater than 1FFFh, the ADuC834 does not support the
rollover from F7FFh in internal code space to F800h in external code space. Instead the 2048 bytes between F800h and
FFFFh will appear as NOP instructions to user code.
This internal code space can be downloaded via the UART
serial port while the device is in-circuit.
56kBytes of the program memory can be repogrammed during
runtime hence the code space can be upgraded in the field
using a user defined protocol or it can be used as a data
memory. This will be discussed in more detail in the Flash/EE
Memory section of the datasheet.
(2) Flash/EE Data Memory
4kBytes of Flash/EE Data Memory are available to the user
an d c a n b e accessed indirectly via a group of control registers
mapped into the Special Function Register (SFR) area. Access
to the Flash/EE Data memory is discussed in detail later as part
of the Flash/EE memory section in this data sheet.
if one is going to use more than one register bank, the stack
pointer should be initialized to an area of RAM not used for data
storage.
7FH
GENERAL-PURPOSE
AREA
30H
BANKS
SELECTED
VIA
BITS IN PSW
20H
11
18H
10
10H
01
08H
00
00H
2FH
BIT-ADDRESSABLE
(BIT ADDRESSES)
1FH
17H
FOUR BANKS OF EIGHT
REGISTERS
0FH
R0 R7
07H
RESET VALUE OF
STACK POINTER
Figure 12. Lower 128 Bytes of Internal Data Memory
The ADuC834 contains 2048 bytes of internal XRAM, 1792
bytes of which can be configured to be used as an extended 11bit stack pointer.
By default the stack will operate exactly like an 8052 in that it
will rollover from FFh to 00h in the general purpose RAM. On
the ADuC834 however it is possible (by setting CFG834.7) to
enable the 11-bit extended stack pointer. In this case the stack
will rollover from FFh in RAM to 0100h in XRAM.
The 11-bit stack pointer is visable in the SP and SPH SFRs.
The SP SFR is located at 81h as with a standard 8052. The
SPH SFR is located at B7h. The 3 LSBs of this SFR contain
the 3 extra bits necessary to extend the 8-bit stack pointer into
an 11-bit stack pointer.
(3) General Purpose RAM
The general purpose RAM is divided into two seperate memories, namely the upper and the lower 128 bytes of RAM. The
lower 128 bytes of RAM can be accessed through direct or
indirect addressing while the upper 128 bytes of RAM can
only be accessed through indirect addressing as it shares the
same address space as the SFR space which can only be accessed through direct addressing.
The lower 128 bytes of internal data memory are mapped as
shown in Figure 12. The lowest 32 bytes are grouped into
four banks of eight registers addressed as R0 through R7. The
next 16 bytes (128 bits), locations 20Hex through 2FHex
above the register banks, form a block of directly addressable
bit locations at bit addresses 00H through 7FH. The stack can
be located anywhere in the internal memory address space, and
the stack depth can be expanded up to 2048 bytes.
Reset initializes the stack pointer to location 07 hex and increments it once before loading the stack to start from locations 08
hex which is also the first register (R0) of register bank 1. Thus,
REV. PrC (12 March 2002)
–21–
07FFH
UPPER 1792
BYTES OF
ON-CHIP XRAM
(DATA +STACK
FOR EXSP=1,
DATA ONLY
100H
00H
FOR EXSP=0)
LOWER 256
BYTES OF
ON-CHIP XRAM
(DATA ONLY)
CFG834.7 = 0
FFH
256 BYTES OF
ON-CHIP DATA
(DATA + STACK)
00H
CFG834.7 = 1
RAM
Figure 13. Extended Stack Pointer Operation
Page 22
ADuC834
PRELIMINAR Y TECHNICAL D A T A
External Data Memory (External XRAM)
Just like a standard 8051 compatible core the ADuC834 can
access external data memory using a MOVX instruction. The
MOVX instruction automatically outputs the various control
strobes required to access the data memory.
The ADuC834 however, can access up to 16MBytes of extrenal
data memory. This is an enhancement of the 64kBytes external
data memory space available on a standard 8051 compatible
core.
The external data memory is discussed in more detail in the
ADuC834 Hardware Design Considerations section.
Internal XRAM
2kBytes of on-chip data memory exist on the ADuC834. This
memory although on-chip is also accessed via the MOVX instruction. The 2kBytes of internal XRAM are mapped into the
bottom 2kBytes of the external address space if the CFG834.0
bit is set, otherwise access to the external data memory will
occur just like a standard 8051.
Even with the CFG834.0 bit set access to the external XRAM
will occur once the 24 bit DPTR is greater than 0007FFH.
When accessing the internal XRAM the P0, P2 port pins as well
as the RD and WR strobes will not be output as per a standard
8051 MOVX instruction. This allows the user to use these port
pins as standard I/O.
FFFFFFH
FFFFFFH
SPECIAL FUNCTION REGISTERS (SFRs)
The SFR space is mapped into the upper 128 bytes of internal
data memory space and accessed by direct addressing only. It
provides an interface between the CPU and all on chip peripherals. A block diagram showing the programming model of the
ADuC834 via the SFR area is shown in Figure 15.
All registers except the Program Counter (PC) and the four
general-purpose register banks, reside in the SFR area. The
SFR registers include control, configuration, and data registers that provide an interface between the CPU and all on-chip
peripherals.
62 KBYTE ELECTRICALLY
REPROGRAMMABLE
NONVOLATILE FLASH/EE
PROGRAM MEMORY
8051-
COMPAT IBLE
CORE
256 BYTES RAM
2K XRAM
128-BYTE
SPECIAL
FUNCTION
REGISTER
AREA
4 KBYTE
ELECTRICALLY
REPROGRAMMABLE
NONVOLAT ILE
FLASH/EE DATA
MEMORY
DUAL
SIGMA-DELTA
ADCs
OTHER ON-CHIP
PERIPHERALS
TEMP SENSOR
CURRENT SOU RCES
12-BIT D A C
SERIAL I/O
WDT, PSM
TIC, PLL
EXTERNAL
MEMORY
ADDRESS
2 KBYTES
ON-CHIP
CFG834.0=1
000000H
EXTERNAL
DATA
MEMORY
SPACE
(24-BIT
ADDRESS
SPACE)
CFG834.0=0
000800H
0007FFH
000000H
Figure 14. Internal and External XRAM
DATA
SPACE
(24-BIT
SPACE)
XRAM
Figure 15. Programming Model
Accumulator SFR (ACC)
ACC is the Accumulator register and is used for math operations including addition, subtraction, integer multiplication and
division, and Boolean bit manipulations. The mnemonics for
accumulator-specific instructions refer to the Accumulator as
A.
B SFR (B)
The B register is used with the ACC for multiplication and
division operations. For other instructions it can be treated
as a general-purpose scratchpad register.
Stack Pointer (SP and SPH)
The SP SFR is the stack pointer and is used to hold an internal
RAM address that is called the ‘top of the stack.’ The SP register
is incremented before data is stored during PUSH and CALL
executions. While the Stack may reside anywhere in on-chip
RAM, the SP register is initialized to 07H after a reset. This
causes the stack to begin at location 08H.
As mentioned earlier the ADuC834 offers an extended 11-bit
stack pointer. The 3 extra bits to make up the 11-bit stack
pointer are the 3 LSBs of the SPH byte located at B7h.
–22–
(12 March 2002) REV. PrC
Page 23
PRELIMINAR Y TECHNICAL D A T A
ADuC834
Data Pointer (DPTR)
The Data Pointer is made up of three 8-bit registers, named
DPP (page byte), DPH (high byte) and DPL (low byte).
These are used to provide memory addresses for internal and
external code access and external data access. It may be manipulated as a 16-bit register (DPTR = DPH, DPL), although
INC DPTR instructions will automatically carry over to DPP,
or as three independent 8-bit registers (DPP, DPH, DPL).
The ADuC834 supports dual data pointers. Refer to the Dual
Data Pointer section later in this datasheet.
Program Status Word (PSW)
The PSW SFR contains several bits reflecting the current status
of the CPU as detailed in Table I.
SFR AddressD0H
Power ON Default Value00H
Bit AddressableYes
Table I. PSW SFR Bit Designations
BitNameDescription
7CYCarry Flag
6ACAuxiliary Carry Flag
5F0General-Purpose Flag
4RS1Register Bank Select Bits
3RS0RS1RS0Selected Bank
000
011
102
113
2OVOverflow Flag
1F1General-Purpose Flag
0PParity Bit
ADuC834 Configuration SFR (CFG834)
The CFG834 SFR contains the necessary bits to configure the
internal XRAM and the extended SP. By default it configures
the user into 8051 mode. i.e. extended SP is disabled, internal
XRAM is disabled.
SFR AddressAFhH
Power ON Default Value00H
Bit AddressableNo
Table III. CFG834 SFR Bit Designations
BitNameDescription
7EXSPExtended SP Enable
If this bit is set then the stack will
rollover from SPH/SP = 00FFh to
0100h.
If this bit is clear then the SPH SFR
will be disabled and the stack will
rollover from SP=FFh to SP =00h
6 ---- ---5 ---- ---4 ---- ---3 ---- ---2 ---- ---1 ---- ---0XRAMENXRAM Enable Bit
If this bit is set then the internal
XRAM will be mapped into the lower
2kBytes of the external address space.
If this bit is clear then the internal
XRAM will not be accessible and the
external data memory will be mapped
into the lower 2kBytes of external data
memory. (see fig 14)
Power Control SFR (PCON)
The PCON SFR contains bits for power-saving options and
general-purpose status flags as shown in Table II.
SFR Address87H
Power ON Default Value00H
Bit AddressableNo
Enable
4ALEOFFDisable ALE Output
3GF1General-Purpose Flag Bit
2GF0General-Purpose Flag Bit
1PDPower-Down Mode Enable
0IDLIdle Mode Enable
.
REV. PrC (12 March 2002)
–23–
Page 24
ADuC834
COMPLETE SFR MAP
PRELIMINAR Y TECHNICAL D A T A
Figure 16 below shows a full SFR memory map and the SFR
contents after RESET. NOT USED indicates unoccupied SFR
locations. Unoccupied locations in the SFR address space are
not implemented; i.e., no register exists at this location. If an
unoccupied location is read, an unspecified value is returned.
SFR locations that are reserved for future use are shaded
(RESERVED) and should not be accessed by user software.
*
CALIBRATION COEFFICIENTS ARE PRECONFIGURED AT POWER-UP TO FACTORY CALIBRATED VALUES.
SFR MAP KEY:
BIT MNEMONIC
BIT BIT ADDRESS
DEFAULT BIT VALUE
SFR NOTE:
SFRs WHOSE ADDRESSES END IN 0H OR 8H ARE BIT-ADDRESSABLE.
THESE BITS ARE CONTAINED IN THIS BYTE.
IE0
89H 0
IT0
88H 0
TCON
88H 00H
MNEMONIC
DEFAULT VALUE
SFR ADDRESS
Figure 16. Special Function Register Locations and Reset Values
–24–
(12 March 2002) REV. prC
Page 25
PRELIMINAR Y TECHNICAL D A T A
USER INTERFACE TO THE PRIMARY AND
AUXILIARY ADCS
Both ADCs are controlled and configured via a number of
SFRs that are mentioned here and described in more detail
in t he following pages.
ADCSTAT:ADC Status Register. Holds general status of
the Primary and Auxiliary ADCs.
ADCMODE:ADC Mode Register. Controls general modes
of operation for Primary and Auxiliary ADCs.
ADC0CON:Primary ADC Control Register. Controls
specific configuration of Primary ADC.
ADC1CON:Auxiliary ADC Control Register. Controls
specific configuration of Auxiliary ADC.
SF :Sinc Filter Register. Configures the decimati on
factor for the Sinc
and Auxiliary ADC update rates.
ICON:Current Source Control Register. Allows
user control of the various on-chip current
source options.
3
filter and thus the Primary
ADuC834
ADC0L/M/H:Primary ADC 24-bit conversion result held
in these three 8-bit registers.
ADC1L/H:Auxiliary ADC 16-bit conversion result held
GN1L/H:Auxiliary ADC 16-bit Gain Calibration Coeff i -
cient held in these two 8-bit registers.
ADCSTAT—(ADC Status Register)
This SFR reflects the status of both ADCs including data ready, calibration and various (ADC-related) error and warning conditions including reference detect and conversion overflow/underflow flags.
SFR AddressD8H
Power-On Default Value00H
Bit AddressableYes
Table IV. ADCSTAT SFR Bit Designations
BitNameDescription
7RDY0Ready Bit for Primary ADC.
Set by hardware on completion of ADC conversion or calibration cycle.
Cleared directly by the user or indirectly by write to the mode bits to start another Primary
ADC conversion or calibration. The Primary ADC is inhibited from writing further results to its
data or calibration registers until the RDY0 bit is cleared.
6RDY1Ready Bit for Auxiliary ADC.
Same definition as RDY0 referred to the Auxiliary ADC.
5CALCalibration Status Bit.
Set by hardware on completion of calibration.
Cleared indirectly by a write to the mode bits to start another ADC conversion or calibration.
4NOXREFNo External Reference Bit (only active if Primary or Auxiliary ADC is active).
Set to indicate that one or both of the REFIN pins is floating or the applied voltage is below
a specified threshold. When Set conversion results are clamped to all ones, if using ext.
reference.
Cleared to indicate valid V
3ERR0Primary ADC Error Bit.
Set by hardware to indicate that the result written to the Primary ADC data registers has
been clamped to all zeros or all ones. After a calibration this bit also flags error conditions that
caused the calibration registers not to be written.
Cleared by a write to the mode bits to initiate a conversion or calibration.
2ERR1Auxiliary ADC Error Bit.
Same definition as ERR0 referred to the Auxiliary ADC.
1---Reserved for Future use.
0---Reserved for Future use.
REF
.
REV. PrC (12 March 2002)
–25–
Page 26
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ADCMODE (ADC Mode Register)
Used to control the operational mode of both ADCs.
SFR AddressD1H
Power-On Default Value00H
Bit AddressableNo
Table V. ADCMODE SFR Bit Designations
BitNameDescription
7---Reserved for Future Use.
6---Reserved for Future Use.
5ADC0ENPrimary ADC Enable.
Set by the user to enable the Primary ADC and place it in the mode selected in MD2-MD0 below
Cleared by the user to place the Primary ADC in power-down mode.
4ADC1ENAuxiliary ADC Enable.
Set by the user to enable the Auxiliary ADC and place it in the mode selected in MD2-MD0 below
Cleared by the user to place the Auxiliary ADC in power-down mode.
3---Reserved for Future Use.
2MD2Primary and Auxiliary ADC Mode bits.
1MD1These bits select the operational mode of the enabled ADC as follows:
0MD0MD2MD1MD0
In Idle Mode the ADC filter and modulator are held in a reset state
although the modulator clocks are still provided.
010Single Conversion Mode
In Single Conversion Mode, a single conversion is performed on the
enabled ADC. On completion of the conversion, the ADC data registers (ADC0H/M/L and/or ADC1H/L) are updated, the relevant flags
in the ADCSTAT SFR are written, and power-down is re-entered with
the MD2–MD0 accordingly being written to 000.
011Continuous Conversion
In continuous conversion mode the ADC data registers are regularly
updated at the selected update rate (see SF register)
100Internal Zero-Scale Calibration
Internal short automatically connected to the enabled ADC(s)
101Internal Full-Scale Calibration
Internal or External V
in ADC0/1CON) is automatically connected to the ADC input for
this calibration.
110System Zero-Scale Calibration
User should connect system zero-scale input to the ADC input pins
as selected by CH1/CH0 and ACH1/ACH0 bits in the ADC0/1CON
register.
111System Full-Scale Calibration
User should connect system full-scale input to the ADC input pins as
selected by CH1/CH0 and ACH1/ACH0 bits in the ADC0/1CON
register.
NOTES
1. Any change to the MD bits will immediately reset both ADCs. A write to the MD2–0 bits with no change is also treated as a reset. (See exception to this in Note 3
below.)
2. If ADC0CON is written when ADC0EN = 1, or if ADC0EN is changed from 0 to 1, then both ADCs are also immediately reset. In other words, the Primary
ADC is given priority over the Auxiliary ADC and any change requested on the primary ADC is immediately responded to.
3. On the other hand, if ADC1CON is written or if ADC1EN is changed from 0 to 1, only the Auxiliary ADC is reset. For example, if the Primary ADC is continuously converting when the Auxiliary ADC change or enable occurs, the primary ADC continues undisturbed. Rather than allow the Auxiliary ADC to operate with a
phase difference from the primary ADC, the Auxiliary ADC will fall into step with the outputs of the primary ADC. The result is that the first conversion time
for the Auxiliary ADC will be delayed up to three outputs while the Auxiliary ADC update rate is synchronized to the Primary ADC.
4. Once ADCMODE has been written with a calibration mode, the RDY0/1 bits (ADCSTAT) are immediately reset and the calibration commences. On completion, the appropriate calibration registers are written, the relevant bits in ADCSTAT are written, and the MD2–0 bits are reset to 000 to indicate the ADC is
back in power-down mode.
5. Any calibration request of the Auxiliary ADC while the temperature sensor is selected will fail to complete. Although the RDY1 bit will be set at the end of
the calibration cycle, no update of the calibration SFRs will take place and the ERR1 bit will be set.
6. Calibrations are performed at maximum SF (see SF SFR) value guaranteeing optimum calibration operation.
(as determined by XREF0 and XREF1 bits
REF
–26–
(12 March 2002) REV. PrC
Page 27
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ADC0CON (Primary ADC Control Register) and ADC1CON (Auxiliary ADC Control Register)
The ADC0CON and ADC1CON SFRs are used to configure the Primary and auxiliary ADC for reference and channel selection,
unipolar or bipolar coding and in the case of the primary ADC for range (the aux ADC operates on a fixed input range of ±V
ADC0CONPrimary ADC Control SFR
SFR AddressD2H
Power-On Default Value 07H
Bit AddressableNo
Table VI. ADC0CON SFR Bit Designations
ADC1CONAuxiliary ADC Control SFR
SFR AddressD3H
Power-On Default Value 00H
Bit AddressableNo
BitNameDescription
7---Reserved for Future Use.
6XREF0Primary ADC External Reference Select Bit.
Set by user to enable the Primary ADC to use the external reference via REFIN(+)/REFIN(–).
Cleared by user to enable the Primary ADC to use the internal bandgap reference (V
= 1.25 V).
REF
5CH1Primary ADC Channel Selection Bits.
4CH0Written by the user to select the differential input pairs used by the Primary ADC as follows:
Set by user to enable unipolar coding, i.e., zero differential input will result in 000000 hex output.
Cleared by user to enable bipolar coding, zero differential input will result in 800000 hex output.
2RN2Primary ADC Range Bits.
1RN1Written by the user to select the Primary ADC input range as follows:
0RN0RN2RN1RN0Selected Primary ADC Input Range (V
= 2.5 V)
REF
000±20 mV(0-20mV in unipolar mode)
001±40 mV(0-40mV in unipolar mode)
010±80 mV(0-80mV in unipolar mode)
011±160 mV(0-160mV in unipolar mode)
100±320 mV(0-320mV in unipolar mode)
101±640 mV(0-640mV in unipolar mode)
110±1.2 8 V(0-1.28V in unipolar mode)
111±2.5 6 V(0-2.56V in unipolar mode)
REF
.),
Table VII. ADC1CON SFR Bit Designations
BitNameDescription
7---Reserved for Future Use.
6XREF1Auxiliary ADC External Reference Bit.
Set by user to enable the Auxiliary ADC to use the external reference via REFIN(+)/REFIN(–).
Cleared by user to enable the Auxiliary ADC to use the internal bandgap reference.
5ACH1Auxiliary ADC Channel Selection Bits.
4ACH0Written by the user to select the single-ended input pins used to drive the Auxiliary ADC as fo llows:
ACH1ACH0Positive InputNegative Input
00AIN3AGND
01AIN4AGND
10Temp Sensor*AGND (Temp. Sensor routed to the ADC input)
11AIN5AGND
3UNI1Auxiliary ADC Unipolar Bit.
Set by user to enable unipolar coding, i.e., zero input will result in 0000 hex output.
Cleared by user to enable bipolar coding, zero input will result in 8000 hex output.
2---Reserved for Future Use.
1---Reserved for Future Use.
0---Reserved for Future Use.
*NOTES
1. When the temperature sensor is selected, user code must select internal reference via XREF1 bit above and clear the UNI1 bit (ADC1CON.3) to select bipolar coding.
2. The temperature sensor is factory calibrated to yield conversion results 8000H at 0°C.
3. A +1°C change in temperature will result in a +1 LSB change in the ADC1H register ADC conversion result.
REV. PrC (12 March 2002)
–27–
Page 28
PRELIMINAR Y TECHNICAL D A T A
ADuC834
ADC0H/ADC0M/ADC0L (Primary ADC Conversion Result Registers)
These three 8-bit registers hold the 24-bit conversion result from the Primary ADC.
SFR AddressADC0HHigh Data ByteDBH
ADC0MMiddle Data ByteDAH
ADC0LLow Data ByteD9H
Power-On Default Value00HBoth registers
Bit AddressableNoBoth registers
ADC1H/ADC1L (Auxiliary ADC Conversion Result Registers)
These two 8-bit registers hold the 16-bit conversion result from the Auxiliary ADC.
SFR AddressADC1HHigh Data ByteDD H
ADC1LLow Data ByteDCH
Power-On Default Value00HBoth Registers
Bit AddressableNoBoth Registers
These three 8-bit registers hold the 24-bit offset calibration coefficient for the Primary ADC. These registers are configured at
power-on with a factory default value of 800000Hex. However, these bytes will be automatically overwritten if an internal or system
zero-scale calibration is initiated by the user via MD2–0 bits in the ADCMODE register.
SFR AddressOF0HPrimary ADC Offset Coefficient High ByteE3H
OF0MPrimary ADC Offset Coefficient Middle ByteE2H
OF0LPrimary ADC Offset Coefficient Low ByteE1H
Power-On Default Value800000HOF0H and OF0M Respectively
Bit AddressableNoBoth Registers
These two 8-bit registers hold the 16-bit offset calibration coefficient for the Auxiliary ADC. These registers are configured at poweron with a factory default value of 8000Hex. However, these bytes will be automatically overwritten if an internal or system zero-scale
calibration is initiated by the user via the MD2–0 bits in the ADCMODE register.
SFR AddressOF1HAuxiliary ADC Offset Coefficient High ByteE5H
OF1LAuxiliary ADC Offset Coefficient Low ByteE4H
Power-On Default Value8000HOF1H and OF1L Respectively
Bit AddressableNoBoth Registers
GN0H/GN0M/GN0L (Primary ADC Gain Calibration Registers1)
These three 8-bit registers hold the 24-bit gain calibration coefficient for the Primary ADC. These registers are configured at
power-on with a factory-calculated internal full-scale calibration coefficient. Every device will have an individual coefficient. However, these bytes will be automatically overwritten if an internal or system full-scale calibration is initiated by the user via MD2–0
bits in the ADCMODE register.
SFR AddressGN0HPrimary ADC Gain Coefficient High ByteEBH
GN0MPrimary ADC Gain Coefficient Middle ByteEAH
GN0LPrimary ADC Gain Coefficient Low ByteE9H
Power-On Default ValueConfigured at factory final test, see notes above.
Bit AddressableNoBoth Registers
GN1H/GN1L (Auxiliary ADC Gain Calibration Registers1)
These two 8-bit registers hold the 16-bit gain calibration coefficient for the Auxiliary ADC. These registers are configured at poweron with a factory calculated internal full-scale calibration coefficient. Every device will have an individual coefficient. However,
these bytes will be automatically overwritten if an internal or system full-scale calibration is initiated by the user via MD2–0 bits in
the ADCMODE register.
SFR AddressGN1HAuxiliary ADC Gain Coefficient High ByteEDH
GN1LAuxiliary ADC Gain Coefficient Low ByteECH
Power-On Default ValueConfigured at factory final test, see notes above.
Bit AddressableNoBoth Registers
NOTE
1
These registers can be overwritten by user software only if Mode bits MD0–2 (ADCMODE SFR) are zero.
–28–
(12 March 2002) REV. PrC
Page 29
PRELIMINAR Y TECHNICAL D A T A
ADuC834
SF (Sinc Filter Register)
The number in this register sets the decimation factor and
thus the output update rate for the Primary and Auxiliary
ADCs. This SFR cannot be written by user software while either
ADC is active. The update rate applies to both Primary and
Auxiliary ADCs and is calculated as follows:
fault ADC update rate of just under 20 Hz. Both ADC inputs
are chopped to minimize offset errors, which means that the
settling time for a single conversion or the time to a first conversion result in continuous conversion mode is 2 × t
mentioned earlier, all calibration cycles will be carried out
automatically with a maximum, i.e., FFhex, SF value to
1
Where:f
=
f
ADC
=ADC Output Update Rate
ADC
f
= Modulator Clock Frequency = 32.768 kHz
MOD
1
×
3
8.SF
×
f
MOD
ensure optimum calibration performance. Once a calibration
cycle has completed, the value in the SF register will be that
programmed by user software.
Table VIII. SF SFR Bit Designations
SF =Decimal Value of SF Register
The allowable range for SF is 0Dhex to FFhex. Examples of SF
values and corresponding conversion update rate (f
conversion time (t
) are shown in Table VIII, the power-on
ADC
ADC
) and
default value for the SF register is 45 hex, resulting in a de-
SF(dec)SF(hex)f
130D105.39.52
694519.7950.34
255FF5.35186.77
(Hz)t
ADC
ICON (Current Sources Control Register)
Used to control and configure the various excitation and burnout current source options available on-chip.
SFR AddressD5H
Power-On Default Value00H
Bit AddressableNo
ADC
ADC
. As
(ms)
Table IX. ICON SFR Bit Designations
BitNameDescription
7---Reserved for Future Use.
6BOBurnout Current Enable Bit.
Set by user to enable both transducer burnout current sources in the primary ADC signal paths.
Cleared by user to disable both transducer burnout current sources.
5ADC1ICAuxiliary ADC Current Correction Bit.
Set by user to allow scaling of the Auxiliary ADC by an internal current source calibration word.
4ADC0ICPrimary ADC Current Correction Bit.
Set by user to allow scaling of the Primary ADC by an internal current source calibration word.
Current Source-2 Pin Select Bit.
3I2PIN
1
Set by user to enable current source-2 (200 µA) to external pin 3 (P1.2/DAC/IEXC1).
Cleared by user to enable current source-2 (200 µA) to external pin 4 (P1.3/AIN5/IEXC2).
Current Source-1 Pin Select Bit.
2I1PIN
1
Set by user to enable current source-1 (200 µA) to external pin 4 (P1.3/AIN5/IEXC2).
Cleared by user to enable current source-1 (200 µA) to external pin 3 (P1.2/DAC/IEXC1).
1I2ENCurrent Source-2 Enable Bit.
Set by user to turn on excitation current source-2 (200 µA).
Cleared by user to turn off excitation current source-2 (200 µA).
0I1ENCurrent Source-1 Enable Bit.
Set by user to turn on excitation current source-1 (200 µA).
Cleared by user to turn off excitation current source-1 (200 µA).
NOTE
1
Both current sources can be enabled to the same external pin, yielding a 400 µA current source.
REV. PrC (12 March 2002)
–29–
Page 30
ADuC834
PRELIMINAR Y TECHNICAL D A T A
PRIMARY AND AUXILIARY ADC NOISE
PERFORMANCE
update rate is selected via the Sinc Filter (SF) SFR. It is important to note that the peak-to-peak resolution figures represent
the resolution for which there will be no code flicker within a
Tables X, XI and XII below show the output rms noise in µV
and output peak-to-peak resolution in bits (rounded to the
nearest 0.5 LSB) for some typical output update rates on both
the Primary and Auxiliary ADCs. The numbers are typical and
are generated at a differential input voltage of 0V. The output
Table X. Primary ADC, Typical Output RMS Noise (
Typical Output RMS Noise vs. Input Range and Update Rate; Output RMS Noise in
six-sigma limit.
The QuickStart Development system PC software comes com-
plete with an ADC noise evaluation tool. This tool can be
easily used with the evalustion board to see these figures from
In unipolar mode peak-to-peak resolution at 105 Hz is 15 bits.
1
2
–30–
(12 March 2002) REV. PrC
Page 31
PRELIMINAR Y TECHNICAL D A T A
ADuC834
PRIMARY AND AUXILIARY ADC CIRCUIT DESCRIPTION
Overview
The ADuC834 incorporates two independent sigma-delta ADCs
(Primary and Auxiliary) with on-chip digital filtering intended
for the measurement of wide dynamic range, low frequency
signals such as those in weigh-scale, strain-gauge, pressure transducer or temperature measurement applications.
Primary ADC
This ADC is intended to convert the primary sensor input. The
input is buffered and can be programmed for one of 8 input
ranges from ±20 mV to ±2.56 V being driven from one of three
differential input channel options AIN1/2, AIN3/4, or AIN3/2.
The input channel is internally buffered allowing the part to
handle significant source impedances on the analog input,
BURNOUT CURRENTS
TWO 100nA BURNOUT
CURRENT S AL LO W THE
USER TO E ASILY DETECT
IF A TRANSDUCER HAS
BURNED OUT OR GONE
OP E N-CIRCUIT
SEE PAGE 29 AND 34
ANALOG INPUT CHO PPING
THE INPUTS ARE
ALTERNATE LY REVERS E D
THROUG H THE
CONVERSION CYCLE.
CHOPP ING Y IELDS
EXCELLEN T ADC OF FSE T
AND OFFS ET DR IFT
PERFORMANCE
SEE PAGE 36
PROGRAMMABLE GAIN
AMPLIFIER
THE PROGRAMMABLE
GA IN A M P L IFIE R A LL O W S
EIGHT UNIPOLAR AND
EIGHT BIPOLAR INPUT
RANGES FROM 20mV TO
2.56V (EXT VREF = +2.5V)
SEE PAGE 33
REFIN(-)
THE EXTE RNAL RE FE RENC E
INPUT T O TH E A D uC 8 34 IS
FACI LITA TES R A TI O M E TR IC
OPERATION. THE EXTERNAL
REFERENCE VOLTAGE IS SELECT-
ED VIA THE XREF0 BIT
CIRCUITRY TESTS FOR OPEN OR
SHORTED REFERENCES INPUTS
REFIN(+)
allowing R/C filtering (for noise rejection or RFI reduction) to
be placed on the an alog inputs if required. On-chip burnout
currents can also be turned on. These currents can be used to
check that a transducer on the selected channel is still operational
before attempting to take measurements.
The ADC employs a sigma-delta conversion technique to realize up to 24 bits of no missing codes performance. The
sigma-delta modulator converts the sampled input signal into a
digital pulse train whose duty cycle contains the digital information. A Sinc
3
programmable low-pass filter is then employed
to decimate the modulator output data stream to give a valid
data conversion result at programmable output rates from
5.35 Hz (186.77 ms) to 105.03 Hz (9.52 ms). A Chopping
scheme is also employed to minimize ADC offset errors. A
block diagram of the Primary ADC is shown in Figure 17.
DIFFERENTIAL
REFERE N CE
DIFFERENTIAL AND
IN ADC0CON.
REFERE NC E DETECT
SEE PAGE 34
SIGMA -DEL TA AD C
THE SIGMA-DELTA
ARCHITECTURE ENSURES
24 BITS NO M ISS ING
CODES. THE ENTIRE SIGMA-
DELTA ADC IS
CHOPPE D TO REM OV E
DRIFT ERRO R
SEE PAGE 35
OUTPUT AVERAGE
AS PART O F THE CH OPPING
IMPLEMENTATION, EACH
DATA WO R D OU TPUT
FROM TH E FILT ER IS
SUMMED AND AVERAGE D W ITH
ITS PREDECESSOR
TO NUL L A DC CH ANNEL
OFFSET ERRO RS
SEE PAGE 35
AV
AIN1
AIN2
AIN3
AIN4
ANALO G MUL TIPLE XE R
A DIFF E R EN TI AL MULT IP LE XER
ALLOWS SELECTION OF THREE
FULLY DIFFERENTIAL PAIR OPTIONS AND
ADDITIONAL INTERN AL SHO RT OPTION
(AIN2 ›AIN2).THE MULTIPLEXER IS
CONTRO LL ED V IA T HE CHANNEL
SELECTION B ITS IN AD C0CON
SEE PAGES 27 AND 33
MUX
AGND
TO ADC0H/M/L SFRs
SEE PAGE 36
DIGTAL O UT PU T
RES U LT WR ITTEN
DD
BUFFER
PGA
CHOP
BU F F E R A MP L IFIE R
THE BUFFER AMPLIFIER
PRESENTS A HIGH
IMPEDANCE INPUT STAGE
FOR THE ANALOG INPUTS,
ALLOWING SIGNIFICANT
EXTERN AL S OU RCE
IMPEDANC ES
SEE PAGE 33
SIGMA -DELTA A /D CO NV ERTER
SIGMA-
DELTA
MODULATOR
THE MODULATOR PROVIDES
A HIGH-FREQU ENC Y 1-BIT
DATA STR E AM (THE O UTPUT OF
WH I C H IS A LSO C HO P PE D ) TO
THE DIGITAL FILTER,
THE DUTY CY CLE OF W HICH
REPRESENTS THE SAMPLED
ANALOG INPUT VOLTAGE
SIGMA-DELTA
MODULATOR
SEE PAGE 34
PROGRA MMABLE
DIGITAL
FILTER
OUTPUT
AVERA G E
CHOP
PROGRAMMABLE
DIGITAL FILTER
THE S INC3 FILTER REMOVES
QUANTIZATION NOISE INTRODUCED
BY THE M ODULATOR . THE UPDATE
RATE AND BANDWIDTH OF THIS
FILTER ARE PROGRAMMABLE
VIA THE SF SFR
SEE PAGE 35
OUTPUT
SCALING
OUTPUT SCALING
THE OUPUT WORD FROM THE
DIGITAL FILTER IS SCALED BY
THE C A LI B RA TION
COEFFICIENTS BE FO RE
BEING PR OV IDED AS
THE CONVERSION RESULT
Figure 17. Primary ADC Block Diagram
REV. PrC (12 March 2002)
–31–
Page 32
PRELIMINAR Y TECHNICAL D A T A
ADuC834
Auxiliary ADC
The Auxiliary ADC is intended to convert supplementary inputs
such as those from a cold junction diode or thermistor. This ADC is
not buffered and has a fixed input range of 0 V to 2.5 V (assuming an external 2.5 V reference). The single-ended inputs can be
DIFFERENTI AL R EF EREN C E
THE EXTERNAL REFERENCE INPUT
TO THE ADu C8 3 4 I S DI FF ER ENTIAL AND
FACILITA TES R ATI OMET RIC
OPERATION. THE EXTERNAL
ANALOG INPUT CHO PPI N G
THE INPU TS ARE ALT ERN ATELY
REVERSED THROUGH THE
CONVERSION CYCLE. CHOPPING
YIELDS EXCELLENT AD C
OFFSET AND OFFSE T DRIFT
PERFORMANCE
SEE PAGE 36
REFERENCE VOLTAGE IS SELECTED
VIA THE XREF1 BIT IN ADC1CON.
REFERENCE DETECT
CIRCUITRY TESTS FOR OPEN OR
SHORTED RE FERENCES INP UTS
SEE PAGE 35
REFIN(›)
REFIN(+)
driven from AIN3, AIN4 or AIN5 pins or directly from the on-chip
temperature sensor voltage. A block diagram of the Auxiliary ADC
is shown in Figure 18.
SIGMA-DELTA ADC
THE SIGMA-DELTA
ARCHITECTURE ENSURE S
16 BITS NO MIS S ING
CODES. THE ENTIRE
SIGMA-DELTA ADC IS
CHOPPED TO REMOVE DRIFT
ERRORS
SEE PAGE 35
OUTPUT AVERAGE
AS PART OF THE CHOPPING
IMPLEMENTATION EACH
DATA WORD OUTPUT
FROM THE FILTER IS
SUMMED AND AVERAGED
WITH ITS PREDECESSOR
TO NULL ADC CHANNEL
OFFSET ERRORS
SEE PAGE 35
AIN3
AIN4
AIN5
ON-CHIP
TEM P ERA T U R E
SENSOR
MUX
ANALOG MULTIPL EX ER
A DIFFERENTIAL MULT IPLEXER
ALLOWS SE L ECTI O N O F THR EE
EXTERNAL SINGLE ENDED I NP UTS O R
THE ON-CHIP TEMP. SENSOR.
THE MULTI PLE X E R I S CONTROLLED
VIA THE CHANNEL SEL ECTI O N
BITS IN ADC1CON
SEE PAGE 28 AND 33
MUX
CHO
P
SIGMA-DE LTA A/D CO NV ERT ER
SIGMADELTA
MODULATOR
SIGMA DELTA
MODULATOR
THE MODULATOR PROVIDES A
HIGH FREQUENCY 1-BIT DATA
STREAM (THE OUTPUT OF WHICH
IS ALSO CHOPPED) TO THE
DIGITAL FILTER,
THE DUTY CYCLE OF WHICH
REPRESENTS THE SAMPLED
ANALOG INPUT VOLTAGE
SEE PAGE 34
PROGRAMM ABLE
DIGITAL
FILTER
CHOP
PROGRAMM ABLE DIGITAL
FILTER
THE SINC3 FILTER RE MOV E S
QUANTI ZATI ON NO IS E IN TRO DU CED
BY THE MODULATOR. THE UPDA TE R ATE
AND BANDWIDTH OF THIS
FILTER ARE PROGRAMMABLE
VIA THE SF SFR
SEE PAGE 35
Figure 18. Auxiliary ADC Block Diagram
OUTPUT
AVERA GE
DIGTAL OUTPUT
RESULT WRITTEN
OUTPUT
SCALING
TO A DC1 H /L S FRs
OUTPUT SCALIN G
THE OUPU T WORD FROM TH E
DIGITAL FILTER IS SCALED BY
THE CALIBRATION
COEFFICIENTS BEFORE
BEING PROV ID ED AS
THE CONVERSION RESULT
SEE PAGE 36
–32–
(12 March 2002) REV. PrC
Page 33
PRELIMINAR Y TECHNICAL D A T A
ADuC834
Analog Input Channels
The primary ADC has four associated analog input pins (labelled AIN1 to AIN4) which can be configured as two fully
differential input channels. Channel selection bits in the
ADC0CON SFR detailed in Table VI allow three combinations of differential pair selection as well as an additional shorted
input option (AIN2–AIN2).
The auxiliary ADC has three external input pins (labelled
AIN3 to AIN5) as well as an internal connection to the internal
on-chip temperature sensor. All inputs to the auxiliary ADC
are single-ended inputs referenced to the AGND on the part.
Channel selection bits in the ADC1CON SFR detailed previously in Table VII allow selection of one of four inputs.
Two input multiplexers switch the selected input channel to
the on-chip buffer amplifier in the case of the primary ADC
and directly to the sigma-delta modulator input in the case
of t he auxiliary ADC. When the analog input channel is
switched, the settling time of the part must elapse before a new
valid word is available from the ADC.
Primary and Auxiliary ADC Inputs
The output of the primary ADC multiplexer feeds into a
high impedance input stage of the buffer amplifier. As a
result, the primary ADC inputs can handle significant source
impedances and are tailored for direct connection to external
resistive-type sensors like strain gauges or Resistance Temperature Detectors (RTDs).
The auxiliary ADC, however, is unbuffered resulting in higher
analog input current on the auxiliary ADC. It should be noted
that this unbuffered input path provides a dynamic load to the
driving source. Therefore, resistor/capacitor combinations on
the input pins can cause dc gain errors depending on the output
impedance of the source that is driving the ADC inputs.
Analog Input Ranges
The absolute input voltage range on the primary ADC is restricted to between AGND + 100 mV to AVDD –100 mV. Care
must be taken in setting up the common-mode voltage and
input voltage range so that these limits are not exceeded, otherwise there will be a degradation in linearity performance.
The absolute input voltage range on the auxiliary ADC is restricted to be t we en AGND – 30 mV to AVDD + 30 mV. The
slightly negative absolute input voltage limit does allow the
possibility of mon itoring small signal bipolar signals using the
single-ended auxiliary ADC front end.
Programmable Gain Amplifier
The output from the buffer on the primary ADC is applied to
the input of the on-chip programmable gain amplifier (PGA).
The PGA can be programmed through eight different unipolar
input ranges and bipolar ranges. The PGA gain range is programmed via the range bits in the ADC0CON SFR. With the
external reference select bit set in the ADC0CON SFR and an
external 2.5V reference, the unipolar ranges are 0 mV to
+20 mV, 0 mV to 40 mV, 0 mV to 80 mV, 0 mV to 160 mV,
0 mV to 320 mV , 0 mV to 640 mV and 0 V to 1.28 V and 0
to 2.56 V while the bipolar ranges are ±20 mV, ±40 mV,
±80 mV, ±160 mV, ±320 mV, ±640 mV, ±1.28 V and
±2.56 V. These are the nominal ranges that should appear at the
input to the on-chip PGA. An ADC range matching specification of 0.5 LSB (typ) across all ranges means that calibration
need only be carried out at a single gain range and does not
have to be repeated when the PGA gain range is changed.
Typical matching across ranges is shown in Figure 19 below.
Here, the primary ADC is configured in bipolar mode with an
external 2.5 V reference, while just greater than 19 mV is
forced on its inputs. The ADC continuously converts the DC
input voltage at an update rate of 5.35 Hz, i.e., SF = FFhex. In
total, 800 conversion results are gathered. The first 100 results are gathered with the primary ADC operating in the
±20 mV range. The ADC range is then switched to ±40 mV and
100 more conversion results are gathered, and so on until the
last group of 100 samples are gathered with the ADC configured
in the ±2.56 V range. From Figure 19, The variation in the
sample mean through each range, i.e., the range matching, is
seen to be of the order of 2 µV.
The auxiliary ADC does not incorporate a PGA and is configured for a fixed single input range of 0 to V
19.372
19.371
19.370
› mV
19.369
19.368
19.367
ADC INPUT VOLTAGE
19.366
19.365
19.364
SAMPLE COUNT
ADC RANGE
0100200300400500600700800
20mVⴞ40mVⴞ80mV
ⴞ
160mVⴞ320mV
ⴞ
REF
.
640V
ⴞ
2.56V
1.28V
ⴞ
ⴞ
Figure 19. Primary ADC Range Matching
Bipolar/Unipolar Inputs
The analog inputs on the ADuC834 can accept either unipolar or bipolar input voltage ranges. Bipolar input ranges
do not imply that the part can handle negative voltages with
respect to system AGND.
Unipolar and bipolar signals on the AIN(+) input on the primary ADC are referenced to the voltage on the respective AIN(–)
input. For example, if AIN(–) is 2.5 V and the primary ADC is
configured for an analog input range of 0 mV to +20 mV,
the input voltage range on the AIN(+) input is 2.5 V to
2.52 V. If AIN(–) is 2.5 V and the ADuC834 is configured for an
analog input range of 1.28 V, the analog input range on the
AIN(+) input is 1.22 V to 3.78 V (i.e., 2.5 V ± 1.28 V).
As mentioned earlier, the auxiliary ADC input is a singleended input with respect to the system AGND. In this context a
bipolar signal on the auxiliary ADC can only span 30 mV
negative with respect to AGND before violating the voltage
input limits for this ADC.
Bipolar or unipolar options are chosen by programming the
Primary and Auxiliary Unipolar enable bits in the ADC0CON
and ADC1CON SFRs respectively. This programs the relevant
ADC for either unipolar or bipolar operation. Programming for
either unipolar or bipolar operation does not change any of the
REV. PrC (12 March 2002)
–33–
Page 34
ADuC834
PRELIMINAR Y TECHNICAL D A T A
input signal conditioning; it simply changes the data output coding and the points on the transfer function where calibrations
occur. When an ADC is configured for unipolar operation,
the output coding is natural (straight) binary with a zero
differential input voltage resulting in a code of 000 . . . 000, a
midscale voltage resulting in a code of 100 . . . 000, and a fullscale input voltage resulting in a code of 111 . . . 111. When an
ADC is configured for bipolar operation, the coding is offset
binary with a negative full-scale voltage resulting in a code of
000 . . . 000, a z ero differential voltage resulting in a code of
100 . . . 000, and a positive full-scale voltage resulting in a code
of 11 1 . . . 111.
Reference Input
The ADuC834’s reference inputs, REFIN(+) and REFIN(–),
provide a differential reference input capability. The common - mode range for these differential inputs is from AGND to
AVDD. The nominal reference voltage, VREF (REFIN(+) –
REFIN(–)), for specified operation is 2.5 V with the primary and auxiliary reference enable bits set in the
respective ADC0CON and/or ADC1CON SFRs.
The part is also functional (although not specified for performance) when the XREF0 or XREF1 bits are ‘0,’ which
enables the on-chip internal bandgap reference. In this mode,
the ADCs will see the internal reference of 1.25 V, therefore
halving all input ranges. As a result of using the internal
reference voltage, a noticeable degradation in peak-to-peak
resolution will result. Therefore, for best performance, operation with an external reference is strongly recommended.
In applications where the excitation (voltage or current) for the
transducer on the analog input also drives the reference voltage
for the part, the effect of the low-frequency noise in the excitation source will be removed as the application is ratiometric. If
the ADuC834 is not used in a ratiometric application, a low
noise reference should be used. Recommended reference voltage
sources for the ADuC83 4 include the AD780, REF43, and
REF192.
It should also be noted that the reference inputs provide a
high impedance, dynamic load. Because the input impedance
of each reference input is dynamic, resistor/capacitor combinations on these inputs can cause dc gain errors depending
on the output impedance of the source that is driving the
reference inputs. Reference voltage sources, like those recommended above (e.g., AD780) will typically have low output
impedances and therefore decoupling capacitors on the
REFIN(+) input would be recommended. Deriving the reference input voltage across an external resistor, as shown in
Figure 60, will mean that the reference input sees a significant external source impedance. External decoupling on the
REFIN(+) and REFIN(-) pins would not be recommended
in this type of circuit configuration.
Burnout Currents
The primary ADC on the ADuC834 contains two 100 nA
constant current generators, one sourcing current from
AVDD to AIN(+), and one sinking from AIN(–) to AGND.
The currents are switched to the selected analog input pair. Both
currents are either on or off, depending on the Burnout Current Enable (BO) bit in the ICON SFR (see Table IX). These
currents can be used to verify that an external transducer is still
operational before attempting to take measurements on that
channel. Once the burnout currents are turned on, they will
–34–
flow in the external transducer circuit, and a measurement of
the input voltage on the analog input channel can be taken. If
the resultant voltage measured is full-scale, this indicates that
the transducer has gone open-circuit. If the voltage measured is
0 V, it indicates that the transducer has short circuited. For
normal operation, these burnout currents are turned off by
writing a 0 to the BO bit in the ICON SFR. The current
sources work over the normal absolute input voltage range specifications.
Excitation Currents
The ADuC834 also contains two identical, 200 µA constant
current sources. Both source current from AVDD to Pin
#3 (IEXC1) or Pin #4 (IEXC2) These current sources are
controlled via bits in the ICON SFR shown in Table IX. They
can be configured to source 200 µA individually to both pins
or a combination of both currents, i.e., 400 µA to either of
the selected pins. These current sources can be used to excite
external resistive bridge or RTD sensors.
Reference Detect
The ADuC834 includes on-chip circuitry to detect if the part h a s
a valid reference for conversions or calibrations. If the
vo l t a g e between the external REFIN(+) and REFIN(–) pins
goes below 0.3 V or either the REFIN(+) or REFIN(–) inputs is
open circuit, the ADuC834 detects that it no longer has a
valid reference. In this case, the NOXREF bit of the
ADCSTAT SFR is set to a 1. I f the ADuC83 4 is performing
normal conversions and the NOXREF bit becomes active, the
conversion results revert to all 1s. Therefore, it i s not necessary
to continuously monitor the status of the NOXREF bit when
performing conversions. It is only necessary to verify its status if
the conversion result read from the ADC Data Register is all 1s.
If the ADuC834 is performing either an offset or gain calibration and the NOXREF bit becomes active, the updating of the
respective calibration registers is inhibited to avoid loading
incorrect coefficients to these registers, and the appropriate
ERR0 or ERR1 bits i n the ADCSTAT SFR are set. If the
user is concerned about verifying that a valid reference is in
place every time a calibration is performed, the status of the
ERR0 or ERR1 bit should be checked at the end of the calibration cycle.
Sigma-Delta Modulator
A sigma-delta ADC generally consists of two main blocks,
an analog modulator and a digital filter. In the case of the
ADuC834 ADCs, the analog modulators consist of a difference amplifier, an integrator block, a comparator, and a
feedback DAC as illustrated in Figure 20.
In operation, the analog signal sample is fed to the difference amplifier along with the output of the feedback DAC. The
difference between these two signals is integrated and fed
to t he comparator. The output of the comparator provides the
input to the feedback DAC so the system functions as a negative
feedback loop that tries to minimize the difference signal. The
(12 March 2002) REV. PrC
Page 35
PRELIMINAR Y TECHNICAL D A T A
ADuC834
digital data that represents the analog input voltage is contained in the duty cycle of the pulse train appearing at the
output of the comparator. This duty cycle data can be recovered as a data word using a subsequent digital filter stage.
The sampling frequency of the modulator loop is many
times higher than the bandwidth of the input signal. The
integrator in the modulator shapes the quantization noise
(which results from the analog-to-digital conversion) so that
the noise is pushed toward one-half of the modulator frequency.
Digital Filter
The output of the sigma-delta modulator feeds directly into the
digital filter. The digital filter then band-limits the response to
a frequency significantly lower than one-half of the modulator frequency. In this manner, the 1-bit output of the
comparator is translated into a band-limited, low noise
output from the ADuC834 ADCs.
The ADuC834 filter is a low-pass, Sinc
3
or (sinx/x)3 filter
whose primary function is to remove the quantization noise
introduced at the modulator. The cutoff frequency and decimated output data rate of the filter are programmable via the
SF (Sinc Filter) SFR as described in Table VIII.
Figure 21 shows the frequency response of the ADC
channel at the default SF word of 69 dec or 45 hex, yielding
an overall output update rate of just under 20 Hz.
It should be noted that this frequency response allows frequency components higher than the ADC Nyquist frequency
to pass through the ADC, in some cases without significant
attenuation. These components may, therefore, be aliased and
appear in-band after the sampling process.
It should also be noted that rejection of mains-related frequency components, i.e., 50 Hz and 60 Hz, is seen to be at
level of >65 dB at 50 Hz and >100 dB at 60 Hz. This confirms the data sheet specifications for 50 Hz/60 Hz Normal
Mode Rejection (NMR) at a 20 Hz update rate.
0
›10
›20
›30
›40
›50
›60
GAIN › dB
›70
›80
›90
›100
›110
›120
0203050708090100110
104060
FREQUENCY › Hz
Figure 21. Filter Response, SF = 69 dec
The response of the filter, however, will change with SF word
as can be seen in Figure 22, which shows >90 dB NMR at
50 Hz and >70 dB NMR at 60 Hz when SF = 255 dec.
0
›10
›20
›30
›40
›50
›60
GAIN › dB
›70
›80
›90
›100
›110
›120
0 203050708090110
104060
FREQUENC Y › Hz
Figure 22. Filter Response, SF = 255 dec
Figures 23 and 24 show the NMR for 50 Hz and 60 Hz across
the full range of SF word, i.e., SF = 13 dec to SF = 255 dec.
0
›10
›20
›30
›40
›50
›60
GAIN › dB
›70
›80
›90
›100
›110
›120
1050 70110150 170 190 210
3090130
SF › Decimal
230 250
Figure 23. 50 Hz Normal Mode Rejection vs. SF
0
›10
›20
›30
›40
›50
›60
GAIN › dB
›70
›80
›90
›100
›110
›120
3090130
1050 70110150 170 190 210
SF › Decimal
230 250
Figure 24. 60 Hz Normal Mode Rejection vs. SF
REV. PrC (12 March 2002)
–35–
Page 36
ADuC834
PRELIMINAR Y TECHNICAL D A T A
ADC Chopping
Both ADCs on the ADuC834 implement a chopping scheme
whereby the ADC repeatability reverses its inputs. The decimated digital output words from the Sinc
positive offset and negative offset term included.
As a result, a final summing stage is included in each ADC so that
each output word from the filter is summed and averaged with the
previous filter output to produce a new valid output result to
be written to the ADC data SFRs. In this way, while the
ADC throughput or update rate is as discussed earlier and
illustrated in Table VIII, the full settling time through the ADC
(or the time t o a first conversion result), will actually be given
by 2 × t
The chopping scheme incorporated in the ADuC834 ADC re sults in excellent dc offset and offset drift specifications and
is e xtremely beneficial in applications where drift, noise rejection, and optimum EMI rejection are important factors.
Calibration
The ADuC834 provides four calibration modes that can be
programmed via the mode bits in the ADCMODE SFR detailed in Table V. In fact, every ADuC834 has already been
factory calibrated. The resultant Offset and Gain calibration
coefficients for both the primary and auxiliary ADCs are
stored on-chip in manufacturing-specific Flash/EE memory
locations. At power-on, these factory calibration coefficients
are automatically downloaded to the calibration registers in
the ADuC834 SFR space. Each ADC (primary and auxiliary)
has dedicated calibr a tion SFRs, these have been described earlier
as part of the general ADC SFR description. However, the
factory calibration values in the ADC calibration SFRs will be
overwritten if any one of the four calibration options are initiated
and that ADC is enabled via the ADC enable bits in
ADCMODE.
Even though an internal offset calibration mode is described
below, it should be recognized that both ADCs are chopped. This
chopping scheme inherently minimizes offset and means that
an internal offset calibration should never be required. Also, because factory 5 V/25°C gain calibration coefficients are
automatically present at power-on, an internal full-scale cali-
ADC
.
3
filters therefore have a
bration will only be required if the part is being operated at 3V or
at temperatures significantly different from 25°C.
The ADuC834 offers “internal” or “system” calibration facilities. For full calibration to occur on the selected ADC, the
calibration logic must record the modulator output for two
different input conditions. These are “zero-scale” and “fullscale” points. These points are derived by performing a
conversion on the different input voltages provided to the
input of the modulator during calibration. The result of the
“zero-scale” calibration conversion is stored in the Offset
Calibration Registers for the appropriate ADC. The result of
the “full-scale” calibration conversion is stored in the Gain
Calibration Registers for the appropriate ADC. With these
readings, the calibration logic can calculate the offset and the
gain slope for the input-to-output transfer function of the
converter.
During an “internal” zero-scale or full-scale calibration, the respective “zero” input and “full-scale” input are automatically
connected to the ADC input pins internally to the device. A
“system” calibration, however, expects the system zero-scale and
system full-scale voltages to be applied to the external ADC
pins before the calibration mode is initiated. In this way external
ADC errors are taken into account and minimized as a result of
system calibration. It should also be noted that to optimize
calibration accuracy, all ADuC834 ADC calibrations are carried out automatically at the slowest update rate.
Internally in the ADuC834 , the coefficients are normalized before
being used to scale the words coming out of the digital filter. The
offset calibration coefficient is subtracted from the result prior to
the multiplication by the gain coefficient. All ADuC834 ADC
specifications will only apply after a zero-scale and full-scale
calibration at the operating point (supply voltage/temperature)
of interest.
From an operational point of view, a calibration should be treated
like another ADC conversion. A zero-scale calibration (if required) should always be carried out before a full-scale calibration.
System software should monitor the relevant ADC RDY0/1
bit in the ADCSTAT SFR to determine end of calibration
via a polling sequence or interrupt driven routine.
The ADuC834 incorporates Flash/EE memory technology onchip to provide the user with nonvolatile, in-circuit
reprogrammable, code and data memory space.
Flash/EE memory is a relatively recent type of nonvolatile
memory technology and is based on a single transistor cell
architecture.
This technology is basically an outgrowth of EPROM technology
and was developed through the late 1980s. Flash/EE memory
takes the flexible in-circuit reprogrammable features of
EEPROM and combines them with the space efficient/density
features of EPROM (see Figure 25).
Because Flash/EE technology is based on a single transistor cell
architecture, a Flash memory array, like EPROM, can be
implemented to achieve the space efficiencies or memory
densities required by a given design.
Like EEPROM, Flash memory can be programmed in-system
at a byte level, although it must first be erased; the erase being
performed in page blocks. Thus, Flash memory is often and
more correctly referred to as Flash/EE memory.
EPROM
TECHNOLO GY
SPACE EFFICIENT/
DENSITY
FLASH/EE MEMORY
TECHNOLO GY
EEPROM
TECHNOLO GY
IN-CIRC U I T
REPROG RAM MABL E
Figure 25. Flash/EE Memory Development
Overall, Flash/EE memory represents a step closer to the ideal
memory device that includes nonvolatility, in-circuit programmability, high density and low cost. Incorporated in the
ADuC834, Flash/EE memory technology allows the user to
update program code space in-circuit, without the need to
replace one-time programmable (OTP) devices at remote
operating nodes.
Flash/EE Memory and the ADuC834
The ADuC834 provides two arrays of Flash/EE memory for user
applications. 62kBytes of F lash/ EE Pro gram s pace are provided on-chip to facilitate code execution without any external
discrete ROM device requirements. The program memory can
be programmed in-circuit, using the serial download mode
provided, using conventional third party memory programmers
or via a user defined protocol who can configure it as data if
required.
A 4kByte Flash/EE Data Memory space is also provided on-chip.
This may be used as a general-purpose nonvolatile scratchpad
area. User access to this area is via a group of six SFRs. This space
can be programmed at a byte level, although it must first be
erased in 4-byte pages.
Endurance quantifies the ability of the Flash/EE memory to
be cycled through many Program, Read, and Erase cycles. In
real terms, a single endurance cycle is composed of four independent, sequential events. These events are defined as:
a. initial page erase sequence
b. read/verify sequenceA single Flash/EE
c. byte program sequenceM emory
d. second read/verify sequenceEndurance Cycle
In reliability qualification, every byte in both the program
and data Flash/EE memory is cycled from 00 hex to FFhex
until a first fail is recorded signifying the endurance limit of the
on-chip Flash/EE memory.
As indicated in the specification pages of this data sheet,
the ADuC834 Flash/EE Memory Endurance qualification has
been carried out in accordance with JEDEC Specification
A117 over the industrial temperature range of –40°C, +25°C,
and +85°C. The results allow the specification of a minimum
endurance figure over supply and temperature of 100,000 cycles,
with an endurance figure of 700,000 cycles being typical of
operation at 25°C.
Retention quantifies the ability of the Flash/EE memory to
retain its programmed data over time. Again, the ADuC834
has been qualified in accordance with the formal JEDEC Retention Lifetime Specification (A117) at a specific junction
temperature (T
= 55°C). As part of this qualification proce-
J
dure, the Flash/EE memory is cycled to its specified endurance
limit described above, before data retention is characterized.
This means that the Flash/EE memory is guaranteed to retain
its data for its full specified retention lifetime every time the
Flash/EE memory is reprogrammed. It should also be noted
that retention lifetime, based on an activation energy of
0.6 eV, will derate with T
300
250
200
150
T
EN
T
100
RE
50
0
40607090
5080110
as shown in Figure 26.
J
ADI S PEC IFICATIO N
100 YEAR S M IN.
AT T
= 55ⴗC
J
JUNCTION TEM PERA TURE › ⴗC
T
J
100
Figure 26. Flash/EE Memory Data Retention
ADuC834 Flash/EE Memory Reliability
The Flash/EE Program and Data Memory arrays on the
ADuC834 are fully qualified for two key Flash/EE memory
characteristics, namely Flash/EE Memory CyclingEndurance and Flash/EE Memory Data Retention.
REV. PrC (12 March 2002)
–37–
Page 38
ADuC834
PRELIMINAR Y TECHNICAL D A T A
USING THE FLASH/EE PROGRAM MEMORY
The 62kByte Flash/EE Program Memory array is mapped
into the lower 62kBytes of the 64 Kbytes program space
addressable by the ADuC834, and is used to hold user code
in typical applications.
The program memory Flash/EE memory arrays can be programmed in three ways, namely:
(1) Serial Downloading (In-Circuit Programming)
The ADuC834 facilitates code download via the standard
UART serial port. The ADuC834 will enter serial download
mode after a reset or power cycle if the PSEN pin is pulled low
through an external 1kΩ resistor. Once in serial download
mode, the user can download code to the full 62kBytes of flash/
EE program memory while the device is in circuit in its target
application hardware.
A PC serial download executable is provided as part of the
ADuC834 QuickStart development system. The Serial Download protocol is detailed in a MicroConverter Applications
Note uC004.
(2) Parallel Programming
The parallel programming mode is fully compatible with conventional third party Flash or EEPROM device programmers. A
block diagram of the external pin configuration required to sup port parallel programming is shown in Figure 27. In this mode,
Ports 0, 1, and 2 operate as the external data and address bus
interface, ALE operates as the Write Enable strobe, and Port 3 is
used as a general configuration port that configures the device for
various program and erase operations during parallel programming.
Table XIII. Flash/EE Memory Parallel Programming Modes
Port 3 PinsProgramming
0.7 0.6 0.5 0.4 0.3 0.2 0.1 Mode
XXXX0 00Erase Flash/EE Program,
Data, and Security Modes
XXXX0 01Read Device Signature/ID
XXX1010Program Code Byte
XXX0010Program Data Byte
XXX1011Read Code Byte
XXX0011Read Data Byte
XXXX1 00Program Security Modes
XXXX1 01Read/Verify Security Modes
All other codesRedundant
5V
PROGRAM
DATA
(D0›D7)
PROGRAM
ADDRESS
(A0›A13)
(P2.0 = A0)
(P1.7 = A13)
WRITE ENABLE
STROBE
PROGRAM MODE
(SEE TA B LE X III)
ENTRY
SEQUENCE
COMMA ND
ENABLE
NEGATIVE
EDGE
GND
V
V
DD
GND
ADuC83 4
P3
P3.0
P3.6
PSEN
DD
RESET
P0
P1
P2
ALE
Figure 27. Flash/EE Memory Parallel Programming
(3) User Download Mode (ULOAD)
As shown in figure 28 the 62kBytes of user program memory
is split into two seperate blocks. The upper 6kBytes of the
program memory (E000h to F7FFh) is only programmable
via serial download or parallel programming. The lower
56kBytes (0000h to DFFFh) is also programmable by a
third method, user download (ULOAD) mode.
Programming the flash/EE program memory via is described in more detail in the description of ECON and
also in technote uC0XX.
KERNEL PROGRAM
THE KERNEL PROGRAM CAN DOWN-
LOAD CODE TO THE FULL 62 KBYTES OF
FLASH/EE PROGRAM MEMORY.
USER BOOTLOADER SPACE.
THE USER BOOTLOADER CAN BE PROGRAMME D VIA THE KERNEL PROGRAM
OR PARALLEL PROGRAMMING BUT IS
READONLY TO USER CODE
USER DOWNLOAD SPACE
EITHER THE KERNEL PROGRAM OR
USER CODE (IN ULOAD MODE) CAN
WRITE TO THIS SPACE.
Figure 28. Flash/EE Program Memory Map
FFFFH
2 KBYTE
F800 H
F7FFH
6 KBYTE
E000H
DFFFH
56 KBYTE
0000H
62 KBYTES
OF USER
CODE
Flash/EE Program Memory Security
The ADuC834 facilitates three modes of Flash/EE program
memory security. These modes can be independently activated,
restricting access to the internal code space. These security
modes can be enabled as part of serial download protocol as
described in technote uC004 or via parallel programming. The
security modes available on the ADuC834 are described as
follows:
Lock Mode
This mode locks the code memory, disabling parallel programming of the program memory. However, reading the memory in
parallel mode and reading the memory via a MOVC command
from extrenal memory is still allowed.
This mode is deactivated by initiating a ‘code-erase’ command
in serial download or parallel programming modes.
Secure Mode
This mode locks the code memory, disabling parallel programming
of the program memory. Reading/Verifying the memory in
parallel mode and reading the internal memory via a MOVC
command from external memory is also disabled.
This mode is deactivated by initiating a “code-erase” command
in serial download or parallel programming modes.
Serial Safe Mode
This mode disables serial download capability on the device. If
Serial Safe mode is activated and an attempt is made to reset the
part into serial download mode, i.e., RESET asserted and
de -asserted with PSEN low, the part will interpret the serial download reset as a normal reset only. It will therefore not enter serial
download mode but only execute a normal reset sequence.
Serial Safe mode can only be disabled by initiating a codeerase command in parallel programming mode.
–38–
(12 March 2002) REV. PrC
Page 39
PRELIMINAR Y TECHNICAL D A T A
ADuC834
USING THE FLASH/EE DATA MEMORY
The 4kBytes of Flash/EE data memory is configured as 1024
pages, each of 4 bytes. As with the other ADuC834 peripherals,
the interface to this memory space is via a group of registers
mapped in the SFR space. A group of four data registers
(EDATA1–4) are used to hold the 4 bytes of data at each
page. The page is addressed via the two registers EADRH and
EADRL. Finally, ECON is an 8-bit control register that may be
written with one of nine Flash/EE memory access commands to
trigger various read, write, erase, and verify functions.
S
S
E
R
D
D
A
E
G
A
P
3FFh
3FEh
/
H
R
D
A
E
03h
(
02h
01h
00h
Byte 1
Byte 1Byte 2
Byte 1
Byte 1
Byte 1
Byte 1
Byte 2
Byte 2
Byte 2
Byte 2
Byte 2
Byte 3
Byte 3
Byte 3
Byte 3
Byte 3
Byte 3
A block diagram of the SFR interface to the flash/EE data
memory array is shown in figure 29.
ECON—Flash/EE Memory Control SFR
Programming of either the flash/EE data memory or the flash/
Figure 29. Flash/EE Data Memory Control and Configuration
EE program memory is done through the flash/EE memory
control SFR (ECON). This SFR allows the user to read, write,
erase or verify the 4 KBytes of flash/EE data memory or the 54
KBytes of flash/EE program memory
Table XIV. Flash/EE Memory Parallel Programming Modes
ECON VALUECOMMAND DESCRIPTIONCOMMAND DESCRIPTION
(NORMAL MODE) (power on default)(ULOAD MODE)
Byte 4
Byte 4
Byte 4
Byte 4
Byte 4
Byte 4
01HResults in 4 bytes in the flash/EE data memory,Not Implemented. Use the MOVC instruction
READaddressed by the page address EADRH/L, being read
into EDATA 1 to 4.
02HResults in 4 bytes in EDATA1-4 being written to theResults in bytes 0-255 of internal XRAM being written
WRITEflash/EE data memory, at the page address EADRH/Lto the 256 bytes of flash/EE program memory at the
(0≤EADRH/L<0400h)page address EADRH. (0≤EADRH<E0H)
Note: The 4 bytes in the page being addressed mustNote: The 256 bytes in the page being addressed must
be pre-erased.be pre-erased.
03HReserved CommandReserved Command
04HVerifies if the data in EDATA1-4 is contained in theNot Implemented. Use the MOVC and MOVX
VERIFYpage address given by EADRH/L. A subsequent readInstructions to verify the WRITE in software
of the ECON SFR will result in a 0 being read if the
verification is valid, or a nonzero value being read to
indicate an invalid verification.
05HResults in the Erase of the 4 byte page of flash/EE data Results in the 64 Byte page of flash/EE program
ERASE PAGE memory addressed by the page address EADRH/Lmemory, addressed by the byte address EADRH/L
being erased. EADRL can equal any of 64 locations
within the page. A new page starts whenever EADRL is
equal to 00h, 40h, 80h or C0h
06HResults in the erase of entire 4kBytes of flash/EEResults in the Erase of the entire 56kBytesof ULOAD
ERASE ALLdata memory.flash/EE program memory.
81HResults in the byte in the flash/EE data memory,Results in the byte in the flash/EE program memory,
READBYTEaddressed by the byte address EADRH/L, being readaddressed by the byte address EADRH/L, being read
into EDATA1. (0≤EADRH/L≤0FFFh.)into EDATA1. (0≤EADRH/L≤F7FFh.)
81HResults in the byte in EDATA1 being written intoResults in the byte in EDATA1 being written into
WRITEBYTEflash/EE data memory, at the byte address EADRH/L.flash/EE prog memory, at the byte address EADRH/L.
0FHLeaves the ECON instructions operate on theEnters NORMAL mode allowing subsequent ECON
EXULOADflash/EE data memory.instructions operate on the flash/EE program memory.
F0HEnters ULOAD mode allowing subsequent ECONLeaves the ECON instructions operate on the flash/EE
ULOADinstructions operate on the flash/EE data memory.program memory.
REV. PrC (12 March 2002)
–39–
Page 40
ADuC834
PRELIMINAR Y TECHNICAL D A T A
Example: Programming the flash/EE data memory
A user wishes to write F3H into the second byte on Page 03H of
the Flash/EE Data Memory space while preserving the other three
bytes already in this page.
A typical access to the Flash/EE Data array will involve setting
up the page address of the page to be accessed in the EADRH/
L SFRs, configuring the EDATA1–4 SFRs with data to be programmed to the array (the EDATA SFRs will not be written for
read accesses) and finally, writing the ECON command word
which initiates one of the nine modes shown in Table XIV.
Step 1: Set up the page address:
The two address registers EADRH and EADRL hold the high
byte address and the low byte address of the page to be addressed.
To set the address up in assembly language would appear as
follows.
MOV EADRH,#0; Set Page Address Pointer
MOV EADRL,#03H
Step 2: Set up the EDATA registers:
We must now write the 4 values to be written into the page
into the 4 SFRs EDATA1-4. Unfortunately we do not know 3
of them. Hence we must read the current page and overwrite
the second byte.
A byte in the Flash/EE array can only be programmed if it has
previously been erased. To be more specific, a byte can only be
programmed if it already holds the value FFH. Because of the
Flash/EE architecture, this erasure must happen at a page level;
therefore, a minimum of four bytes (1 page) will be erased
when an erase command is initiated. Once the page is erased
we can program the 4 bytes in page and then perform a verification of the data.
It should be noted that a given mode of operation is initiated as
soon as the command word is written to the ECON SFR. The
core microcontroller operation on the ADuC834 is idled until
the requested Program/Read or Erase mode is completed.
In practice, this means that even though the Flash/EE
memory mode of operation is typically initiated with a twomachine cycle MOV instruction (to write to the ECON SFR),
the next instruction will not be executed until the Flash/EE
operation is complete. This means that the core will not respond
to Interrupt requests until the Flash/EE operation is complete, although the core peripheral functions like Counter/
Timers will continue to count and time as configured throughout this period.
Note:
As with all Flash/EE memory architectures, the array can be
programmed in-system at a byte level, although it must be
erased first; the erasure being performed in page blocks (4byte pages in this case).
Although the 4kBytes of Flash/EE data memory is shipped
from the factory pre-erased, i.e., Byte locations set to FFH, it is
nonetheless good programming practice to include an erase-all
routine as part of any configuration/setup code running on the
ADuC834. An “ERASE-ALL” command consists of writing
“06H” to the ECON SFR, which initiates an erase of the
4kByte Flash/EE array. This command coded in 8051 assembly
would appear as:
MOV ECON,#06H; Erase all Command
; 2 ms Duration
–40–
(12 March 2002) REV. PrC
Page 41
PRELIMINAR Y TECHNICAL D A T A
DAC
The ADuC834 incorporates a 12-bit, voltage output DAC onchip. It has a rail-to-rail voltage output buffer capable of driving
. It can
DD
REF
(the
10 kΩ/100 pF. It has two selectable ranges, 0 V to V
internal bandgap 2.5 V reference) and 0 V to AV
operate in 12-bit or 8-bit mode. The DAC has a control register, DACCON, and two data registers, DACH/L. The DAC
output can be programmed to appear at Pin 3 or Pin 12. It
Table XV. DACCON SFR Bit Designations
BitNameDescription
7---Reserved for Future Use.
6---Reserved for Future Use.
5---Reserved for Future Use.
4DACPINDAC Output Pin Select.
Set by the user to direct the DAC output to Pin 12 (P1.7/AIN4/DAC).
Cleared by user to direct the DAC output to Pin 3 (P1.2/DAC/IEXC1).
3DAC8DAC 8-bit Mode Bit.
Set by user to enable 8-bit DAC operation. In this mode the 8-bits in DACL SFR are routed to
the 8 MSBs of the DAC and the 4 LSBs of the DAC are set to zero.
Cleared by user to operate the DAC in its normal 12-bit mode of operation.
2DACRNDAC Output Range Bit.
Set by user to configure DAC range of 0 – AV
Cleared by user to configure DAC range of 0 – 2.5V (V
1DACCLRDAC Clear Bit.
Set to ‘1’ by user to enable normal DAC operation.
Cleared to ‘0’ by user to reset DAC data registers DACl/H to zero.
0DACENDAC Enable Bit.
Set to ‘1’ by user to enable normal DAC operation.
Cleared to ‘0’ by user to power-down the DAC.
ADuC834
should be noted that in 12-bit mode, the DAC voltage output
will be updated as soon as the DACL data SFR has been written; therefore, the DAC data registers should be updated as
DACH first followed by DACL.5The 12-bit DAC data should
be written into DACH/L right-justified such that DACL contains the lower eight bits, and the lower nibble of DACH
contains the upper four bits.
.
DD
REF
).
DACH/LDAC Data Registers
FunctionDAC Data Registers, written by user to update the DAC output.
SFR AddressDACL (DAC Data Low Byte)–>FBH
DACH (DAC Data High Byte) –>FCH
Power-On Default Value00H–>Both Registers
Bit AddressableN o–>Both Registers
Using the D/A Converter
The on-chip D/A converter architecture consists of a resistor
string DAC followed by an output buffer amplifier, the functional equivalent of which is illustrated in Figure 30.
Features of this architecture include inherent guaranteed monotonicity and excellent differential linearity. As illustrated in
Figure 30, the reference source for each DAC is user selectable
in software. It can be either AV
the DAC output transfer function spans from 0V to the volt-
AV
DD
V
REF
R
R
R
R
ADuC834
(FROM MCU)
OUTPUT
BUFFER
HIGH Z
DISABLE
20
DAC0
age at the AV
transfer function spans from 0V to the internal V
The DAC output buffer amplifier features a true rail-to-rail
output stage implementation. This means that, unloaded, each
output is capable of swinging to within less than 100mV of both
and ground. Moreover, the DAC’s linearity specification
AV
DD
(when driving a 10KΩ resistive load to ground) is guaranteed
through the full transfer function except codes 0 to 48, and, in 0to-AV
DD
Linearity degradation near ground and V
tion of the output amplifier, and a general representation of its
pin. In 0-to-V
DD
mode only, codes 3945 to 4095.
effects (neglecting offset & gain error) is illustrated in Figure
R
31. The dotted line in Figure 31 indicates the ideal transfer
function, and the solid line represents what the transfer function might look like with endpoint non-linearities due to
Note that Figure 31 represents a transfer function in 0-to-V
mode only. In 0-to-V
mode (with V
REF
< VDD) the lower
REF
DD
non-linearity would be similar, but the upper portion of the
transfer function would follow the “ideal” line right to the end,
showing no signs of endpoint linearity errors.
VDD
VDD - 50m V
VDD - 100mV
100mV
50mV
0V
000 Hex
FFF Hex
Figure 31. Endpoint Non-linearities due to Amplifier
Saturation.
The endpoint non-linearities conceptually illustrated in Figure
31 get worse as a function of output loading. Most of the
ADuC834’s da tasheet specifications assume a 10KΩ resistive
load to ground at the DA C output. As the output is forced to
source or sink more current, the nonlinear regions at the top
or bottom (respectively) of Figure 31 become larger. With
larger current demands, this can significantly limit output
voltage swing. Figure 32 & Figure 33 illustrate this behavior.
It should be noted that the upper trace in each of these figures
is only valid for an output range selection of 0-to-AVDD. In 0to-V
mode, DAC loading will not cause high-side voltage
REF
drops as long as the reference voltage remains below the upper
trace in the corresponding figure. For example, if AVDD=3V &
V
=2.5V, the high-side voltage will not be affected by loads
REF
less than 5mA. But somewhere around 7mA the upper curve
in Figure 33 drops below 2.5V (V
) indicating that at these
REF
higher currents the output will not be capable of reaching
V
.
REF
5
DAC load ed w ith 0FFF hex
4
]
3
2
output voltage [V
1
DAC loaded with 0000 hex
0
051015
source/sink current [mA]
Figure 32. Source and Sink Current Capability
= V
with V
REF
DD
= 5V
3
DAC loaded with 0FFF h ex
2
1
output voltage [V]
DAC loaded with 0000 hex
0
051015
source/sink current [mA]
Figure 33. Source & Sink Current Capability
= V
with V
REF
DD
= 3V
For larger loads the current drive capability may not be sufficient. In order to increase the Source & Sink current capability
of the DACs an external buffer should be added, as shown in
figure 34.
-
+
-
+
20
21
ADuC834
Figure 34. Buffering the DAC outputs
The DAC output buffer also features a high-impedance disable
function. In the chip’s default power-on state, both DACs are
disabled, and their outputs are in a high-impedance state (or
“tri-state”) where they remain inactive until enabled in software.
This means that if a zero output is desired during power-up or
power-down transient conditions, then a pull-down resistor
must be added to each DAC output. Assuming this resistor is
in place, the DAC outputs will remain at ground potential
whenever the DAC is disabled.
–42–
(12 March 2002) REV. PrC
Page 43
PRELIMINAR Y TECHNICAL D A T A
PULSE WIDTH MODULATOR BLOCK (PWM)
ADuC834
The PWM is one of the new features of the ADuC834 over the
ADuC824. The PWM can be configured as a Σ∆ DAC with up
to 16-bits of resolution or as a PWM with variable resolution.
The PWM is widely programmable in terms input clock, clock
dividers and PWM mode to produce a highly flexible PWM. A
block diagram of the PWM is shown in figure X, with each of
the modes explained overleaf.
The PWM uses 5 extra SFRs; the control SFR, PWMCON,
and 4 data SFRs PWM0H, PWM0L, PWM1H and PWM1L.
PWMCON (as described below) controls the different modes
as well as the clock frequency.
PWM0H/L and PWM1H/L are the data regaisters that determine the outputs at P1.0 and P1.1.
PWMCONPWM Control SFR
SFR AddressAEh
Power-On Default Value00h
Bit AddressableNo
Table XVI. PWMCON SFR Bit Designations
12.583MHz
32.768kHz
32.768kHz/15
CLKSEL0
CLKSEL1
T0
MD2
MD1
MD0
CLOCK
SELECT
CLKDIV0
CLKDIV1
PROG
DIVIDER
16 BIT PWM COUNTER
COMPARE
MODE
PWM0H/L
PWM1H/L
Figure 35. PWM Block Diagram
P1.0
P1.1
BitNameDescription
7-Reserved for future use
6MD2PWM Mode Bits
5MD1The MD2/1/0 bits choose the PWM mode as follows
4MD0MD2MD1MD0Mode
1CSEL1PWM Clock Divider
0CSEL0Select the clock source for the PWM as shown below.
CSEL1 CSEL0 Description
00PWM Clock = f
01PWM Clock = f
XTAL
XTAL
/15
10PWM Clock = External Interrupt on P3.4/T0
11PWM Clock = f
(12.58MHz)
VCO
REV. PrC (12 March 2002)
–43–
Page 44
PRELIMINAR Y TECHNICAL D A T A
ADuC834
PWM MODES OF OPERATION
MODE 0: PWM disblabled
The PWM is disabled allowing P1.0 and P1.1 be used as normal.
MODE 1: Single Variable resolution PWM
In this mode both the pulse length and the cycle time (period) are programmable in user code allowing the resolution
of the PWM to be variable.
PWM1H/L sets the period of the output waveform. Setting
PWM1H/L to 65536 gives a 16-bit PWM with a maximum
output rate of 192Hz (12.583MHz/65536). Setting
PWM1H/L to 4096 gives a 12-bit PWM with a maximum
output rate of 3072Hz (12.583MHz/4096).Reducing
PWM1H/L reduces the resolution but increases the maximum output rate of the PWM.
PWM1L
PWM CO UN TER
PWM0H
PWM0L
PWM1H
0
P1.0
P1.1
Figure 37. PWM Mode 2
MODE 3: Twin 16-bit PWM
In this mode the pulse is programmable but the cycle time
(period) is fixed. The PWM counter is fixed to count from 0
to 65536 giving a fixed 16-bit resolution. This means that
the maximum output of the PWM is 192Hz.
PWM0H/L sets the width of the output waveform as shown
in the diagram below.
PWM1H/L
PWM CO UN TER
PWM0H/L
0
P1.0
Figure 36. ADuC834 PWM in Mode 1
MODE 2: Twin 8-bit PWM
In this mode both the pulse and cycle time (period) are programmable however the maximum resolution of the PWM
output is 8-bits.
PWM1L sets the period for both PWM outputs. Typically this
will be set to 255 (FFh) to give an 8-bit PWM although it is
possible to reduce this as necessary. A value of 100 is loaded
here to give a percentage PWM (i.e. the PWM is accurate to
1%).
The ouputs of the PWM at P1.0 and P1.1 are shown in the
diagram below. As can be seen the output of PWM0 (P1.0)
goes low when the PWM counter equals PWM0L. The output
of PWM1 (P1.1) goes high when the PWM counter equals
PWM1H and goes low again when the PWM counter equals
PWM0H. Often PWM1H will be set to 0 so that both outputs
start simultaneously.
As shown below while the PWM counter is less than
PWM0H/L then the output of PWM0 (P1.0) is high. Once
the PWM counter equals PWM0H/L then PWM0 (P1.0)
goes low and remains low until the PWM counter is rolls
over.
Similarly while the PWM counter is less than PWM1H/L
then the output of PWM1 (P1.1) is high. Once the PWM
counter equals PWM1H/L then PWM1 (P1.1) goes low and
remains low until the PWM counter is rolls over.
In this mode PWMs must be synchronised. i.e. Both PWM0
(P1.0) and PWM1 (P1.1) go high at the same time.
65536
PWM COUNTER
PWM1H/L
PWM0H/L
0
P1.0
P1.1
Figure 38. PWM Mode 3
–44–
(12 March 2002) REV. PrC
Page 45
PRELIMINAR Y TECHNICAL D A T A
ADuC834
MODE 4: Dual NRZ 16-bit
Σ∆Σ∆
Σ∆ DAC
Σ∆Σ∆
Mode 4 provides a high speed PWM output similar to that of a
Σ∆ DAC. Typically this mode will be used with the 12.58MHz
clock.
In this mode P1.0 and P1.1 are updated every PWM clock
(80ns in the case of 12.58MHz). Over any 65536 cycles (16 bit
PWM) PWM0 (P1.0) is high for PWM0H/L cycles and low for
65536 - PWM0H/L. Similarly PWM1 (P1.1) is high for
PWM1H/L cycles during this same time.
For lower resolution, higher speed DAC outputs write 0’s to
the LSBs that are not required. If for example only 12 bit performance is required then write 0’s to the 4LSBs. This means
that 12 bit accuracy in the PWM output can occur at 3kHz.
Similary writing 0’s to the 8LSBs gives 8 bit accuracy at 49kHz.
e.g. if PWM0H was set to 4010H (slightly above one quater of
FS) then typically P1.0 will be low for three clocks and high for
one clock (each clock is 80ns appox). Over every 65536 clocks
the PWM will compromise for the fact that the output should
be slightly above one quater of fullscale by leaving the output
high for two clocks in four every so often.
PWM0H/L
16 BIT
16 BIT
12.583MHz
0, , ‰, …, 0
CARRY OUT A T P1.0
+
LATCH
0
80us
16 BIT
1
0111
1
PWM1L
PWM COUNTERS
PWM1H
PWM0L
PWM0H
0
P1.0
P1.1
Figure 40. PWM Mode 5
MODE 6: Dual RZ 16-bit
Σ∆Σ∆
Σ∆ DAC
Σ∆Σ∆
Mode 6 provides the exact same functionality as mode 4
except that in this mode the PWM output is ANDed with
the PWM clock. i.e. every output 1 is only high for half a
clock and low for the other half clock. This return to zero
(RZ) mode reduces any errors due to mismatch between rise
time and fall time of the PWM outputs and is recommended
over mode 4 for accurate PWM outputs.
The disadvantage of this mode is that the dynamic range of
the PWM output is halved from 0->DVDD to 0->DVDD/2.
e.g. if PWM0H was set to 4010H (slightly above one quater
of FS) then typically P1.0 will be low for three full clocks (3
x 80ns), high for half a clock (40ns) and then low again for
half a clock (40ns) before repeating itself. Over every 65536
clocks the PWM will compromise for the fact that the output should be slightly above one quater of fullscale by
leaving the output high for two half clocks in four every so
often.
16 BIT
CARRY OUT A T P1.1
0100
80us
0
00
16 BIT
PWM1H/L
16 BIT
0, , ‰, …, 0
…
Figure 39. PWM Mode 4
MODE 5: Dual 8-bit PWM
In this mode both the pulse and cycle time (period) are independently programmable by using the high and low bytes of the
PWM counters independently. The output resolution and
period are set by the PWM1L and PWM1H registers for the
P1.0 and P1.1 outputs respectively. PWM0L and PWM0H will
set the width of the high pulse for the P1.0 and P1.1 outputs
respectively. Both channels have same clock source and clock
divider.
REV. PrC (12 March 2002)
–45–
PWM0H/L
16 BIT
0, , ‰, …, 0
16 BIT
12.583MHz
16 BIT
0, , ‰, …, 0
16 BIT
PWM1H/L
CARRY OUT AT P 1.0
+
16 BIT
LATCH
16 BIT
…
CARRY OUT AT P 1.1
Figure 41. PWM Mode 6
0
80us
0100
80us
1
0111
1
000
Page 46
ADuC834
ON-CHIP PLL
PRELIMINAR Y TECHNICAL D A T A
The ADuC834 is intended for use with a 32.768 kHz watch
crystal. A PLL locks onto a multiple (384) of this to provide a
stable 12.582912 MHz clock for the system. The core can
operate at this fr equency or at binary submultiples of it to
allow power saving in cases where maximum core performance is not required. The default core clock is the PLL
PLLCONPLL Control Register
SFR AddressD7H
Power-On Default Value03H
Bit AddressableNo
Table XVII. PLLCON SFR Bit Designations
BitNameDescription
7OSC_PDOscillator Power-down Bit.
Set by user to halt the 32 kHz oscillator in power-down mode.
Cleared by user to enable the 32 kHz oscillator in power-down mode.
This feature allows the TIC to continue counting even in power-down mode.
6LOCKPLL Lock Bit.
This is a read only bit.
Set automatically at power-on to indicate the PLL loop is correctly tracking the crystal clock. If the
external crystal becomes subsequently disconnected the PLL will rail and the core will halt.
Cleared automatically at power-on to indicate the PLL is not correctly tracking the crystal clock.
This may be due to the absence of a crystal clock or an external crystal at power-on. In this mode,
the PLL output can be 12.58 MHz ± 20%.
5---Reserved for future use; should be written with ‘0.’
4LTEAReading this bit returns the state of the external EA pin latched at reset or power-on.
3FINTFast Interrupt Response Bit.
Set by user enabling the response to any interrupt to be executed at the fastest core clock frequency,
regardless of the configuration of the CD2–0 bits (see below). After user code has returned from an
interrupt, the core resumes code execution at the core clock selected by the CD2–0 bits.
Cleared by user to disable the fast interrupt response feature.
2CD2CPU (Core Clock) Divider Bits.
1CD1This number determines the frequency at which the microcontroller core will operate.
0CD0CD2CD1CD0Core Clock Frequency (MHz)
00012.582912
0016.291456
0103.145728
0111.572864 (Default Core Clock Frequency)
1000.786432
1010.393216
1100.196608
1110.098304
clock divided by 8 or 1.572864 MHz. The ADC clocks are also
derived from the PLL clock, with the modulator rate being the
same as the crystal oscillator frequency. The above choice of
frequencies ensures that the modulators and the core will be
synchronous, regardless of the cor e c loc k ra te . Th e PLL control register is PLLCON.
–46–
(12 March 2002) REV. PrC
Page 47
PRELIMINAR Y TECHNICAL D A T A
ADuC834
TIME INTERVAL COUNTER (TIC)
A time interval counter is provided on-chip for:
- counting longer intervals than the standard
8051-compatible timers are capable of
- periodically the part up from power down
- implementing a Real Time Clock
The TIC is capable of timeout intervals ranging from 1/128th
second to 255 hours. Furthermore, this counter is clocked by
the crystal oscillator rather than the PLL and thus has the
ability to remain active in power-down mode and time long
power-down intervals. This has obvious applications for remote
battery-powered sensors where regular widely spaced readings
are required.
If the TIC is being used as a real time clock (TCEN is set) then
the TCEN bit itself and the HTHSEC, SEC, MIN and HOUR
registers do not get reset after a hardware or watchdog timer
reset. This is to prevent the need to recalibrate the real time
clock after a reset. However, these registers will get reset to 00h
after a power cycle (independent of TCEN) or after any reset if
TCEN is clear.
Six SFRs are associated with the time interval counter, T IMECON
being its control register. Depending on the configuration of the
IT0 and IT1 bits in TIMECON, the selected time counter register
overflow will clock the interval counter. When this counter is
equal to the time interval value loaded in the INTVAL SFR,
the TII bit (TIMECON.2) is set and generates an interrupt if
enabled (See IEIP2 SFR description under Interrupt System
later in this data sheet.) If the ADuC834 is in power-down
mode, again with TIC interrupt enabled, the TII bit will wake
up the device and resume code execution by vectoring directly
to the TIC in ter ru pt ser vic e vector address at 0053 hex. The
TIC-related SFRs are described in Table XVIII. Note also that
the timebase SFRs can be written initially with the current
time, the TIC can then be controlled and accessed by user software. In effect, this facilitates the implementation of a real-time
cloc k. A bl oc k di ag ram of the TI C is shown in Figure 42.
TCEN 32.768kHz EXTERNAL CRYSTAL
ITS0, 1
8-BIT
PRESCALER
HUNDREDTH S COUNT ER
HTHSEC
SECOND COUNTER
SEC
MINUTE COUNTER
MIN
HOUR CO UNTER
HOUR
INTER V A L T IM E OUT
TIME INTERVAL COUNTER INTERRUPT
INTER V A L
TIMEBASE
SELECTION
MUX
8-BIT
INTERVAL CO UNTE R
EQUAL?
INTVAL SFR
TIEN
Figure 42. TIC, Simplified Block Diagram
Table XVIII. TIMECON SFR Bit Designations
BitNameDescription
7---Reserved for Future Use.
6---Reserved for Future Use. For future product code compatibility this bit should be written as a ‘1.’
5ITS1Interval Timebase Selection Bits.
4ITS0Written by user to determine the interval counter update rate.
ITS1ITS0Interval Timebase
001/128 Second
01Seconds
10Minutes
11Hours
3STISingle Time Interval Bit.
Set by user to generate a single interval timeout. If set, a timeout will clear the TIEN bit.
Cleared by user to allow the interval counter to be automatically reloaded and start counting again at
each interval timeout.
2TIITIC Interrupt Bit.
Set when the 8-bit Interval Counter matches the value in the INTVAL SFR.
Cleared by user software.
1TIENTime Interval Enable Bit.
Set by user to enable the 8-bit time interval counter.
Cleared by user to disable and clear the contents of the interval counter.
0TCENTime Clock Enable Bit.
Set by user to enable the time clock to the time interval counters.
Cleared by user to disable the clock to the time interval counters and clear the time interval SFRs.
The time registers (HTHSEC, SEC, MIN and HOUR) can be written while TCEN is low.
REV. PrC (12 March 2002)
–47–
Page 48
PRELIMINAR Y TECHNICAL D A T A
ADuC834
INTVALUser Time Interval Select Register
FunctionUser code writes the required time interval to this register. When the 8-bit interval counter is equal
to the time interval value loaded in the INTVAL SFR, the TII bit (TIMECON.2) bit is set and
generates an interrupt if enabled. (See IEIP2 SFR description under Interrupt System later in this
data sheet.)
SFR AddressA6 H
Power-On Default Value00H
Bit AddressableNo
Valid Value0 to 255 decimal
HTHSECHundredths Seconds Time Register
FunctionThis register is incremented in (1/128) second intervals once TCEN in TIMECON is active. The
HTHSEC SFR counts from 0 to 127 before rolling over to increment the SEC time register.
SFR AddressA2 H
Power-On Default Value00H
Bit AddressableNo
Valid Value0 to 127 decimal
SECSeconds Time Register
FunctionThis register is incremented in 1-second intervals once TCEN in TIMECON is active. The SEC
SFR counts from 0 to 59 before rolling over to increment the MIN time register.
SFR AddressA3 H
Power-On Default Value00H
Bit AddressableNo
Valid Value0 to 59 decimal
MINMinutes Time Register
FunctionThis register is incremented in 1-minute intervals once TCEN in TIMECON is active. The MIN
counts from 0 to 59 before rolling over to increment the HOUR time register.
SFR AddressA4 H
Power-On Default Value00H
Bit AddressableNo
Valid Value0 to 59 decimal
HOURHours Time Register
FunctionThis register is incremented in 1-hour intervals once TCEN in TIMECON is active. The HOUR
SFR counts from 0 to 23 before rolling over to 0.
SFR AddressA5 H
Power-On Default Value00H
Bit AddressableNo
Valid Value0 to 23 decimal
–48–
(12 March 2002) REV. PrC
Page 49
WATCHDOG TIMER
PRELIMINAR Y TECHNICAL D A T A
ADuC834
The purpose of the watchdog timer is to generate a device reset or
interrupt within a reasonable amount of time if the ADuC834
enters an erroneous state, possibly due to a programming
error, electrical noise, or RFI. The Watchdog function can be
disabled by clearing the WDE (Watchdog Enable) bit in the
Watchdog Control (WDCON) SFR. When enabled; the watchdog
circuit will generate a system reset or interrupt (WDS) if the user
program fails to set the watchdog (WDE) bit within a predeter-
WDCONWatchdog Timer Control Register
SFR AddressC0H
Power-On Default Value10H
Bit AddressableYes
Table XIX. WDCON SFR Bit Designations
BitNameDescription
7PRE3Watchdog Timer Prescale Bits.
6PRE2The Watchdog timeout period is given by the equation: tWD = (2
5PRE1(0 ≤ PRE ≤ 7; f
4PRE0PRE3PRE2PRE1PRE0Timout Period (ms)Action
000015.6Reset or Interrupt
000131.2Reset or Interrupt
001062.5Reset or Interrupt
0011125Reset or Interrupt
0100250Reset or Interrupt
0101500Reset or Interrupt
01101000Reset or Interrupt
01112000Reset or Interrupt
10000.0Immediate Reset
PRE3–0 > 1001Reserved
3WDIRWatchdog Interrupt Response Enable Bit.
If this bit is set by the user, the watchdog will generate an interrupt response instead of a
system reset when the watchdog timeout period has expired. This interrupt is not disabled by
the CLR EA instruction and it is also a fixed, high-priority interrupt. If the watchdog is not
being used to monitor the system, it can alternatively be used as a timer. The prescaler is used to
set the timeout period in which an interrupt will be generated. (See also Note 1, Table XXXIX
in the Interrupt System section.)
2WDSWatchdog Status Bit.
Set by the Watchdog Controller to indicate that a watchdog timeout has occurred.
Cleared by writing a ‘0’ or by an external hardware reset. It is not cleared by a watchdog reset.
1WDEWatchdog Enable Bit.
Set by user to enable the watchdog and clear its counters. If a ‘1’ is not written to this bit
within the watchdog timeout period, the watchdog will generate a reset or interrupt, depending on
WDIR. Cleared under the following conditions, User writes ‘0,’ Watchdog Reset (WDIR = ‘0’);
Hardware Reset; PSM Interrupt.
0WDWRWatchdog Write Enable Bit.
To write data into the WDCON SFR involves a double instruction sequence. The WDWR bit
must be set and the very next instruction must be a write instruction to the WDCON SFR.
e.g.,CLREA; disable interrupts while writing
SETBWDWR; allow write to WDCON
MOVWDCON, #72h; enable WDT for 2.0s timeout
SETBE A; enable interrupts again (if rqd)
= 32.768 kHz)
PLL
mined amount of time (see PRE3–0 bits in WDCON). The
watchdog timer itself is a 16-bit counter that is clocked at
32.768 kHz. The watchdog time-out interval can be adjusted
via the PRE3–0 bits in WDCON. Full Control and Status of
the watchdog timer function can be controlled via the watchdog timer control SFR (WDCON). The WDCON SFR can
only be written by user software if the double write sequence
described in WDWR below is initiated on every write access to
the WDCON SFR.
PRE
× (29/f
; to WDT
PLL
))
REV. PrC (12 March 2002)
–49–
Page 50
PRELIMINAR Y TECHNICAL D A T A
ADuC834
POWER SUPPLY MONITOR
As its name suggests, the Power Supply Monitor, once enabled, monitors both supplies (AVDD or DVDD) on the
ADuC834. It will indicate when any of the supply pins drop
below one of four user-selectable voltage trip points from
2.63 V to 4.63 V. For correct operation of the Power Supply
Monitor function, AV
2.7 V. Monitor function is controlled via the PSMCON SFR.
If enabled via the IEIP2 SFR, the monitor will interrupt the
PSMCONPower Supply Monitor Control Register
SFR AddressDFH
Power-On Default ValueDEH
Bit AddressableNo
BitNameDescription
7CMPDDVDD Comparator Bit
6CMPAAVDD Comparator Bit.
5PSMIPower Supply Monitor Interrupt Bit.
4TPD1DVDD Trip Point Selection Bits.
3TPD0These bits select the DVDD trip-point voltage as follows:
2TPA1AVDD Trip Point Selection Bits.
1TPA0These bits select the AVDD trip-point voltage as follows:
0PSMENPower Supply Monitor Enable Bit.
must be equal to or greater than
DD
Table XX. PSMCON SFR Bit Designations
This is a read-only bit and directly reflects the state of the DVDD comparator.
Read ‘1’ indicates the DVDD supply is above its selected trip point.
Read ‘0’ indicates the DVDD supply is below its selected trip point.
This is a read-only bit and directly reflects the state of the AVDD comparator.
Read ‘1’ indicates the AVDD supply is above its selected trip point.
Read ‘0’ indicates the AVDD supply is below its selected trip point.
This bit will be set high by the MicroConverter if either CMPA or CMPD are low, indicating
low analog or digital supply. The PSMI bit can be used to interrupt the processor. Once CMPD
and/or CMPA return (and remain) high, a 250 ms counter is started. When this counter times
out, the PSMI interrupt is cleared. PSMI can also be written by the user. However, if either comparator output is low, it is not possible for the user to clear PSMI.
TPD1TPD0Selected DVDD Trip Point (V)
004.63
013.08
102.93
112.63
TPA1TPA0Selected AVDD Trip Point (V)
004.63
013.08
102.93
112.63
Set to ‘1’ by the user to enable the Power Supply Monitor Circuit.
Cleared to ‘0’ by the user to disable the Power Supply Monitor Circuit.
core using the PSMI bit in the PSMCON SFR. This bit will
not be cleared until the failing power supply has returned
above the trip point for at least 250 ms. This monitor function
allows the user to save working registers to avoid possible d a t a
loss due to the low supply condition, and also ensures that
normal code execution will not resume until a safe supply
level has been well established. The supply monitor is also
protected against spurious glitches triggering the interrupt
circuit.
–50–
(12 March 2002) REV. PrC
Page 51
PRELIMINAR Y TECHNICAL D A T A
ADuC834
SERIAL PERIPHERAL INTERFACE
The ADuC834 integrates a complete hardware Serial Peripheral Interface (SPI) interface on-chip. SPI is an industry standard
synchronous serial interface that allows eight bits of data to
be synchronously transmitted and received simultaneously, i.e.,
full duplex. It should be noted that the SPI pins SCLOCK and
MOSI are multiplexed with the digital output pins D0 and D1.
This pins are controlled via the DCON SFR only if SPE is clear.
SPI can be configured for Master or Slave operation and typically
consists of four pins, namely:
SCLOCK (Serial Clock I/O Pin), Pin#26
The master clock (SCLOCK) is used to synchronize the
data being transmitted and received through the MOSI and
MISO data lines. A single data bit is transmitted and received in each SCLOCK period. Therefore, a byte is
transmitted/received after eight SCLOCK periods. The
SCLOCK pin is configured as an output in master mode and
as an input in slave mode. In master mode the bit-rate, polarity
and phase of the clock are controlled by the CPOL, CPHA,
SPR0 and SPR1 bits in the SPICON SFR (see Table XXI
below). In slave mode the SPICON register will have to be
configured with the phase and polarity (CPHA and CPOL)
as the master as for both master and slave mode the data is
transmitted on one edge of the SCLOCK signal and sampled
on the other.
MISO (Master In, Slave Out Data I/O Pin), Pin#14
The MISO (master in slave out) pin is configured as an input
line in master mode and an output line in slave mode. The
MISO line on the master (data in) should be connected to the
MISO line in the slave device (data out). The data is transferred as byte wide (8-bit) serial data, MSB first.
MOSI (Master Out, Slave In Pin), Pin#27
The MOSI (master out slave in) pin is configured as an output line
in master mode and an input line in slave mode. The MOSI
line on the master (data out) should be connected to the MOSI
line in the slave device (data in). The data is transferred as byte
wide (8-bit) serial data, MSB first.
SSSS
SS (Slave Select Input Pin), Pin#13
SSSS
The Slave Select (SS) input pin is only used when the
ADuC834 is configured in SPI slave mode. This line is active
low. Data is only received or transmitted in slave mode when
the SS pin is low, allowing the ADuC834 to be used in single
master, multislave SPI configurations. If CPHA = 1 then the SS
input may be permanently pulled low. With CPHA = 0 then
the SS input must be driven low before the first bit in a byte
wide transmission or reception and return high again after the
last bit in that byte wide transmission or reception. In SPI
Slave Mode, the logic level on the external SS pin (Pin# 13),
can be read via the SPR0 bit in the SPICON SFR.
The following SFR registers are used to control the SPI interface.
Table XXI. SPICON SFR Bit Designations
BitNameDescription
7ISPISPI Interrupt Bit.
Set by MicroConverter at the end of each SPI transfer.
Cleared directly by user code or indirectly by reading the SPIDAT SFR
6WCOLWrite Collision Error Bit.
Set by MicroConverter if SPIDAT is written to while an SPI transfer is in progress.
Cleared by user code.
5SPESPI Interface Enable Bit.
Set by user to enable the SPI interface.
Cleared by user to allow the DCON SFR control the digital output pins D0 and D1
4SPIMSPI Master/Slave Mode Select Bit.
Set by user to enable Master Mode operation (SCLOCK is an output).
Cleared by user to enable Slave Mode operation (SCLOCK is an input).
3CPOLClock Polarity Select Bit.
Set by user if SCLOCK idles high.
Cleared by user if SCLOCK idles low.
2CPHAClock Phase Select Bit.
Set by user if leading SCLOCK edge is to transmit data.
Cleared by user if trailing SCLOCK edge is to transmit data.
1SPR1SPI Bit-Rate Select Bits.
0SPR0These bits select the SCLOCK rate (bit-rate) in Master Mode as follows:
SPR1SPR0Selected Bit Rate
00f
01f
10f
11fcore/16
In SPI Slave Mode, i.e., SPIM = 0, the logic level on the external SS pin (Pin# 13), can be read
via the SPR0 bit.
NOTE
The CPOL and CPHA bits should both contain the same values for master and slave devices.
CORE
CORE
CORE
/2
/4
/8
REV. PrC (12 March 2002)
–51–
Page 52
PRELIMINAR Y TECHNICAL D A T A
ADuC834
SPIDATSPI Data Register
FunctionThe SPIDAT SFR is written by the user to transmit data over the SPI interface or read by user
code to read data just received by the SPI interface.
SFR AddressF7H
Power-On Default Value00H
Bit AddressableNo
Using the SPI Interface
Depending on the configuration of the bits in the SPICON
SFR shown in Table XXI, the ADuC834 SPI interface will
transmit or receive data in a number of possible modes. Figure
43 shows all possible ADuC834 SPI configurations and the t i m ing relationships and synchronization between the signals
involved. Also shown in this figure is the SPI interrupt bit
(ISPI) and how it is triggered at the end of each byte-wide communication.
SCLOCK
(CPOL = 1)
SCLOCK
(CPOL = 0)
SS
SAMPLE INPUT
?
(CPHA = 1)
(CPHA = 0)
DATA OUTP UT
ISPI FLAG
SAMPLE INPUT
DATA OUTP UT
ISPI FLAG
MS B BIT 6 BIT 5 B IT 4 BIT 3 B IT 2 B IT 1 LSB
MSB BIT 6 BIT 5?BIT 4 B IT 3 BIT 2 BIT 1 L S B
Figure 43. ADuC8 34 , SPI Timing, All Modes
SPI Interface—Master Mode
In master mode, the SCLOCK pin is always an output and generates a burst of eight clocks whenever user code writes to the
SPIDAT register. The SCLOCK bit rate is determined by
SPR0 and SPR1 in SPICON. It should also be noted that the
SS p in is not used in master mode. If the ADuC834 needs to
assert the SS pin on an external slave device, a Port digital output
pin should be used.
In master mode a byte transmission or reception is initiated
by a write to SPIDAT. Eight clock periods are generated via the
SCLOCK pin and the SPIDAT byte being transmitted via MOSI.
With each SCLOCK period a data bit is also sampled via MISO.
After eight clocks, the transmitted byte will have been completely
transmitted and the input byte will be waiting in the input shift
register. The ISPI flag will be set automatically and an interrupt
will occur if enabled. The value in the shift register will be
latched into SPIDAT.
SPI Interface—Slave Mode
In slave mode the SCLOCK is an input. The SS pin must
also be driven low externally during the byte communication.
Transmission is also initiated by a write to SPIDAT. In slave
mode, a data bit is transmitted via MISO and a data bit is received
via MOSI through each input SCLOCK period. After eight
clocks, the transmitted byte will have been completely transmitted
and the input byte will be waiting in the input shift register. The
ISPI flag will be set automatically and an interrupt will occur
if enabled. The value in the shift register will be latched into
SPIDAT only when the transmission/reception of a byte has
been completed. The end of transmission occurs after the
eighth clock has been received, if CPHA = 1 or when SS returns high if CPHA = 0.
–52–
(12 March 2002) REV. PrC
Page 53
DUAL DATA POINTER
PRELIMINAR Y TECHNICAL D A T A
ADuC834
The ADuC834 incorporates two data pointers. The second
data pointer is a shadow data pointer and is selected via the
data pointer control SFR (DPCON). DPCON also includes
some nice features such as automatic hardware post increment
and post decrement as well as automatic data pointer toggle.
DPCON is described below.
Table XXII. DPCON SFR Bit Designations
BitNameDescription
7-Reserved for future use
6DPTData Pointer automatic toggle enable
Cleared by user to disable auto swapping of the DPTR.
Set in user software to enable automatic toggling of the DPTR after each each MOVX or MOVC
instruction.
5DP1m1Shadow Data Pointer Mode
4DP1m0These two bits enable extra modes of the shadow data pointer operation allowing for more compact
and more efficient code size and execution.
m1m 0Behaviour of the Shadow Data Pointer
008052 Behaviour
01DPTR is post incremented after a MOVX or a MOVC instruction
10DPTR is post decremented after a MOVX or MOVC instruction
11DPTR LSB is toggled after a MOVX or MOVC instruction
(This instruction can be useful for moving 8 bit blocks to/from 16-bit devices)
3DP0m1Main Data Pointer Mode
2DP0m0These two bits enable extra modes of the main data pointer operation allowing for more compact and
more efficient code size and execution.
m1m 0Behaviour of the Main Data Pointer
008052 Behaviour
01DPTR is post incremented after a MOVX or a MOVC instruction
10DPTR is post decremented after a MOVX or MOVC instruction
11DPTR LSB is toggled after a MOVX or MOVC instruction
(This instruction can be useful for moving 8 bit blocks to/from 16-bit devices)
1-Not implemented to allow the INC DPCON instruction toggle the data pointer
0DPSELData Pointer select
Cleared by user to select the main data pointer. This means that the contents of this 24 bit register
is placed into the 3 SFRs DPL, DPH and DPP.
Set by the user to select the shadow data pointer. This means that the contents of a separate 24 bit
register appears in the 3 SFRs DPL, DPH and DPP.
DPCONData Pointer Control SFR
SFR AddressA7h
Power-On Default Value 00h
Bit AddressableNo
Note 1: This is the only place where the main and shadow data
pointers are distinguished. Everywhere else in this datasheet
wherever the DPTR is mentioned, operation on the active
DPTR is implied.
Note 2: Only MOVC/MOVX @DPTR instructions are relevant
above. MOVC/MOVX PC/@Ri instructions will not cause the
DPTR to automatically post increment/decrement etc.
To illustrate the operation of DPCON, the following code will
copy 256 bytes of code memory at address D000h into XRAM
starting from address 0000h.
The following piece of code uses 16 bytes and 2054 cycles. To
perform this on a standard 8051 requires approximately 33
bytes and 7172 cycles (depending on how its implemented).
; DPTR1 increment mode,
; DPTR0 increment mode
; DPTR auto toggling ON
MOV DPTR,#0D000h ; Shadow DPTR = D000h
MOVELOOP:
CLR A
MOVC A,@A+DPTR; Get data
; Post Inc DPTR
; Swap to Main DPTR (Data)
MOVX @DPTR,A; Put ACC in XRAM
; Increment main DPTR
; Swap Shadow DPTR (Code)
MOV A, DPL
JNZ MOVELOOP
Page 54
ADuC834
PRELIMINAR Y TECHNICAL D A T A
8051-COMPATIBLE ON-CHIP PERIPHERALS
This section gives a brief overview of the various secondary pe ripheral circuits are also available to the user on-chip. These
remaining functions are fully 8051-compatible and are controlled
via standard 8051 SFR bit definitions.
Parallel I/O Ports 0–3
The ADuC834 uses four input/output ports to exchange data
with external devices. In addition to performing general-purpose I/O, some ports are capable of external memory operations;
others are multiplexed with an alternate function for the peripheral features on the device. In general, when a peripheral is
enabled, that pin may not be used as a general purpose I/O pin.
Port 0 is an 8-bit open drain bidirectional I/O port that is directly controlled via the Port 0 SFR (SFR address = 80 hex).
Port 0 pins that have 1s written to them via the Port 0 SFR will
be configured as open drain and will therefore float. In that
state, Port 0 pins can be used as high impedance inputs. An
external pull-up resistor will be required on Port 0 outputs to
force a valid logic high level externally. Port 0 is also the multiplexed low-order address and data bus during accesses to external
program or data memory. In this application it uses strong internal
pull-ups when emitting 1s.
Port 1 is also an 8-bit port directly controlled via the P1 SFR
(SFR address = 90 hex). The Port 1 pins are divided into two
distinct pin groupings.
P1.0 and P1.1 pins on Port 1 are bidirectional digital I/O pins with
internal pull-ups. If P1.0 and P1.1 have 1s written to them via the
P1 SFR, these pins are pulled high by the internal pull-up resistors. In this state they can also be used as inputs; as input pins
being externally pulled low, they will source current because of
the internal pull-ups. With 0s written to them, both these pins
will drive a logic low output voltage (VOL) and will be capable of
sinking 10 mA compared to the standard 1.6 mA sink capability on the other port pins. These pins also have various
secondary functions described in Table XXIII.
high order address bytes during fetches from external program memory and middle and high order address bytes during
accesses to the 16-bit external data memory space.
Port 3 is a bidirectional port with internal pull-ups directly
controlled via the P2 SFR (SFR address = B0 hex). Port 3
pins that have 1s written to them are pulled high by the internal
pull-ups and in that state they can be used as inputs. As inputs,
Port 3 pins being pulled externally low will source current because
of the internal pull-ups. Port 3 pins also have various secondary
functions described in Table XXIV.
Table XXIV. Port 3, Alternate Pin Functions
PinAlternate Function
P3.0RXD (UART Input Pin)
(or Serial Data I/O in Mode 0)
P3.1TXD (UART Output Pin)
(or Serial Clock Output in Mode 0)
P3.2INT0 (External Interrupt 0)
P3.3INT1 (External Interrupt 1)
P3.4T0 (Timer/Counter 0 External Input)
P3.5T1 (Timer/Counter 1 External Input)
P3.6WR (External Data Memory Write Strobe)
P3.7RD (External Data Memory Read Strobe)
The alternate functions of P1.0, P1.1, and Port 3 pins can only be
activated if the corresponding bit latch in the P1 and P3 SFRs
contains a 1. Otherwise, the port pin is stuck at 0. In the case
of the PWM outputs at P1.0 and P1.1, the PWM outputs will
overwrite anything written to P1.0 or P1.1.
Additional Digital Ouput Pins
Pins P1.0 and P1.1 can be used to provide high current (10mA
sink) general purpose I/O. In addition to P1.0 and P1.1, two more
high current (8mA sink) outputs are provided at D0 and D1. If
the SPE bit (in SPICON) is clear, the two extra high current
digital ouputs, D0 and D1, are controlled via the DCON SFR as
follows:
Table XXIII. Port 1, Alternate Pin Functions
PinAlternate Function
P1.0T2 (Timer/Counter 2 External Input)
PWM0 (PWM0 output at this pin)
P1.1T2EX (Timer/Counter 2 Capture/Reload Trigger)
PWM1 (PWM1 output at this pin)
The remaining Port 1 pins (P1.2–P1.7) can only be configured
as Analog Input (ADC), Analog Output (DAC) or Digital Input
pins. By (power-on) default these pins are configured as Analog
Inputs, i.e., ‘1’ written in the corresponding Port 1 register bit.
To configure any of these pins as digital inputs, the user should
write a ‘0’ to these port bits to configure the corresponding pin
as a high impedance digital input.
Port 2 is a bidirectional port with internal pull-up resistors directly
controlled via the P2 SFR (SFR address = A0 hex). Port 2 pins
that have 1s written to them are pulled high by the internal pullup resistors and, in that state, they can be used as inputs. As
inputs, Port 2 pins being pulled externally low will source current
because of t he i nt ernal pull-up resistors. Port 2 emits the
–54–
Table XXV. DCON SFR description
BitNameDescription
7D1Data written to this bit will be
outputted on the D1 pin if
D1EN is set.
6D1ENSet to enable the D1 bit as
an ouput.
5D0Data written to this bit will be
outputted on the DC0 pin if
D0EN is set.
4 ---- ---3D0ENSet to enable the D0 bit as
an ouput.
2 ---- ---1 ---- ---0 ---- ----
(12 March 2002) REV. PrC
Page 55
PRELIMINAR Y TECHNICAL D A T A
ADuC834
TIMERS/COUNTERS
The ADuC834 has three 16-bit Timer/Counters: Timer 0,
Timer 1, and Timer 2. The Timer/Counter hardware has been
included on-chip to relieve the processor core of the overhead inherent in implementing timer/counter functionality
in software. Each Timer/Counter consists of two 8-bit registers
THx and TLx (x = 0, 1 and 2). All three can be configured to
operate either as timers or event counters.
In ‘Timer’ function, the TLx register is incremented every machine cycle. Thus one can think of it as counting machine cycles.
Since a machine cycle consists of 12 core clock periods, the
maximum count rate is 1/12 of the core clock frequency.
In ‘Counter’ function, the TLx register is incremented by a 1-to0 transition at its corresponding external input pin, T0, T1, or
T2. In this function, the external input is sampled during
TMODTimer/Counter 0 and 1 Mode Register
SFR Address89H
Power-On Default Value00H
Bit AddressableNo
Table XXVI. TMOD SFR Bit Designations
BitNameDescription
7GateTimer 1 Gating Control.
Set by software to enable timer/counter 1 only while INT1 pin is high and TR1 control bit is set.
Cleared by software to enable timer 1 whenever TR1 control bit is set.
6C/TTimer 1 Timer or Counter Select Bit.
Set by software to select counter operation (input from T1 pin).
Cleared by software to select timer operation (input from internal system clock).
5M1Timer 1 Mode Select Bit 1 (Used with M0 Bit).
4M0Timer 1 Mode Select Bit 0.
M1M0
00TH1 operates as an 8-bit timer/counter. TL1 serves as 5-bit prescaler.
0116-Bit Timer/Counter. TH1 and TL1 are cascaded; there is no prescaler.
108-Bit Auto-Reload Timer/Counter. TH1 holds a value which is to be
reloaded into TL1 each time it overflows.
11Timer/Counter 1 Stopped.
3GateTimer 0 Gating Control.
Set by software to enable timer/counter 0 only while INT0 pin is high and TR0 control bit is set.
Cleared by software to enable Timer 0 whenever TR0 control bit is set.
2C/TTimer 0 Timer or Counter Select Bit.
Set by software to select counter operation (input from T0 pin).
Cleared by software to select timer operation (input from internal system clock).
1M1Timer 0 Mode Select Bit 1.
0M0Timer 0 Mode Select Bit 0.
M1M0
00TH0 operates as an 8-bit timer/counter. TL0 serves as 5-bit prescaler.
0116-Bit Timer/Counter. TH0 and TL0 are cascaded; there is no prescaler
108-Bit Auto-Reload Timer/Counter. TH0 holds a value which is to be
reloaded into TL0 each time it overflows.
11TL0 is an 8-bit timer/counter controlled by the standard timer 0 control
bits. TH0 is an 8-bit timer only, controlled by Timer 1 control bits.
S5P2 of every machine cycle. When the samples show a high in
one cycle and a low in the next cycle, the count is
incremented. The new count value appears in the register during
S3P1 of the cycle following the one in which the transition was
detected. Since it takes two machine cycles (16 core clock periods)
to recognize a 1-to-0 transition, the maximum count rate is 1/16
of the core clock frequency. There are no restrictions on the
duty cycle of the external input signal, but to ensure that a
given level is sampled at least once before it changes, it must be
held for a minimum of one full machine cycle. Remember that
the core clock frequency is programmed via the CD0–2 selection bits in the PLLCON SFR.
User configuration and control of the timers is achieved via
three main SFRs. TMOD and TCON control the configuration of timers 0 and 1 while T2CON configures timer 2.
REV. PrC (12 March 2002)
–55–
Page 56
PRELIMINAR Y TECHNICAL D A T A
ADuC834
TCON:Timer/Counter 0 and 1 Control Register
SFR Address88H
Power-On Default Value00H
Bit AddressableYes
Table XXVII. TCON SFR Bit Designations
BitNameDescription
7TF1Timer 1 Overflow Flag.
Set by hardware on a timer/counter 1 overflow.
Cleared by hardware when the Program Counter (PC) vectors to the interrupt service routine.
6TR1Timer 1 Run Control Bit.
Set by user to turn on timer/counter 1.
Cleared by user to turn off timer/counter 1.
5TF0Timer 0 Overflow Flag.
Set by hardware on a timer/counter 0 overflow.
Cleared by hardware when the PC vectors to the interrupt service routine.
4TR0Timer 0 Run Control Bit.
Set by user to turn on timer/counter 0.
3IE1
2IT1
1IE0
0IT0
NOTE
1
These bits are not used in the control of timer/counter 0 and 1, but are used instead in the control and monitoring of the external INT0 and INT1 interrupt
pins.
1
1
1
1
Cleared by user to turn off timer/counter 0.
External Interrupt 1 (INT1) Flag.
Set by hardware by a falling edge or zero level being applied to external interrupt pin INT1, depending on bit IT1 state.
Cleared by hardware when the when the PC vectors to the interrupt service routine only if the interrupt was transition-activated. If level-activated, the external requesting source controls the
request flag, rather than the on-chip hardware.
External Interrupt 1 (IE1) Trigger Type.
Set by software to specify edge-sensitive detection (i.e., 1-to-0 transition).
Cleared by software to specify level-sensitive detection (i.e., zero level).
External Interrupt 0 (INT0) Flag.
Set by hardware by a falling edge or zero level being applied to external interrupt pin INT0, depending on bit IT0 state.
Cleared by hardware when the PC vectors to the interrupt service routine only if the interrupt was
transition-activated. If level-activated, the external requesting source controls the request flag,
rather than the on-chip hardware.
External Interrupt 0 (IE0) Trigger Type.
Set by software to specify edge-sensitive detection (i.e., 1-to-0 transition).
Cleared by software to specify level-sensitive detection (i.e., zero level).
Timer/Counter 0 and 1 Data Registers
Both timer 0 and timer 1 consists of two 8-bit registers. These can be used as independent registers or combined to be a single 16bit register depending on the timer mode configuration.
TH0 and TL0
Timer 0 high byte and low byte.
SFR Address = 8Chex, 8Ahex respectively.
TH1 and TL1
Timer 1 high byte and low byte.
SFR Address = 8Dhex, 8Bhex respectively.
–56–
(12 March 2002) REV. PrC
Page 57
PRELIMINAR Y TECHNICAL D A T A
ADuC834
TIMER/COUNTER 0 AND 1 OPERATING MODES
The following paragraphs describe the operating modes for
timer/counters 0 and 1. Unless otherwise noted, it should be
assumed that these modes of operation are the same for timer 0 as
for timer 1.
Mode 0 (13-Bit Timer/Counter)
Mode 0 configures an 8-bit timer/counter with a divide-by-32 prescaler. Figure 44 shows mode 0 operation.
CORE
CLK
P3.4/T0
GATE
INT0
P3.2/
*
THE CORE CLOCK IS TH E OUTPUT O F THE PLL AS DESCRIBED ON PAGE 46
12
ⴜ
*
TR0
C/T = 0
C/T = 1
(5 BITS)
CONTROL
TL0
TH0
(8 BITS)
TF0
INTERRUPT
Figure 44. Timer/Counter 0, Mode 0
In this mode, the timer register is configured as a 13-bit register. As the count rolls over from all 1s to all 0s, it sets the timer
overflow flag TF0. The overflow flag, TF0, can then be used to
request an interrupt. The counted input is enabled to the timer
when TR0 = 1 and either Gate = 0 or INT0 = 1. Setting Gate = 1
allows the timer to b e controlled by external input INT0, to
facilitate pulsewidth measurements. TR0 is a control bit in the
special function register TCON; Gate is in TMOD. The 13-bit
register consists of all eight bits of TH0 and the lower five bits of
TL0. The upper three bits of TL0 are indeterminate and should
be ignored. Setting the run flag (TR0) does not clear the registers.
Mode 2 (8-Bit Timer/Counter with Auto Reload)
Mode 2 configures the timer register as an 8-bit counter (TL0)
with automatic reload, as shown in Figure 46. Overflow from TL0
not only sets TF0, but also reloads TL0 with the contents of TH0,
which is preset by software. The reload leaves TH0 unchanged.
CORE
CLK
P3.4/T0
GATE
P3.2/
*
THE CORE CLOCK I S TH E OUTPUT OF TH E PLL A S DE SCRIB E D O N PAGE 4 6
*
INT0
ⴜ
12
TR0
C/T = 0
C/T = 1
CONTROL
TL0
(8 BITS)
RELOAD
TH0
(8 BITS)
TF0
INTERRUPT
Figure 46. Timer/Counter 0, Mode 2
Mode 3 (Two 8-Bit Timer/Counters)
Mode 3 has different effects on timer 0 and timer 1. Timer 1 in
Mode 3 simply holds its count. The effect is the same as setting
TR1 = 0. Timer 0 in Mode 3 establishes TL0 and TH0 as two
separate counters. This configuration is shown in Figure 47. T L 0
uses the timer 0 control bits: C/T, Gate, TR0, INT0, and TF0.
TH0 is locked into a timer function (counting machine cycles)
and takes over the use of TR1 and TF1 from timer 1. Thus, TH0
now controls the “timer 1” interrupt. Mode 3 is provided for
applications requiring an extra 8-bit timer or counter.
When timer 0 is in Mode 3, timer 1 can be turned on and off by
switching it out of, and into, its own Mode 3, or can still be used by
the serial interface as a Baud Rate Generator. In fact, it can be used,
in any application not requiring an interrupt from timer 1 itself.
Mode 1 (16-Bit Timer/Counter)
Mode 1 is the same as Mode 0, except that the timer register
is running with all 16 bits. Mode 1 is shown in Figure 45.
CORE
CLK
P3.4/T0
GATE
P3.2/
*
THE CORE CLOCK IS THE OUTPUT OF THE PLL AS DESCRIBED ON PAGE 46
*
INT0
ⴜ
12
TR0
C/T = 0
C/T = 1
(8 BITS)
CONTROL
TL0
TH0
(8 BITS)
TF0
INTERRUPT
Figure 45. Timer/Counter 0, Mode 1
REV. PrC (12 March 2002)
–57–
CORE
CLK
P3.4/T0
GATE
P3.2/
INT0
CORE
CLK/12
TR1
*
THE CORE CLOCK IS THE OUTPUT OF THE PLL AS DESCRIBED ON PAGE 46
ⴜ
12
*
TR0
C/T = 0
C/T = 1
CORE
CLK/12
CONTROL
CONTROL
TL0
(8 BITS)
TH0
(8 BITS)
Figure 47. Timer/Counter 0, Mode 3
TF0
TF1
INTERRUPT
INTERRUPT
Page 58
ADuC834
PRELIMINAR Y TECHNICAL D A T A
TIMER/COUNTER 2 OPERATING MODES
The following paragraphs describe the operating modes for
timer/counter 2. The operating modes are selected by bits in the
T2CON SFR as shown in Table XXIX.
Table XXVIII. Timer 2 Operating modes
RCLK (or) TCLKCAP2TR2MODE
00116-Bit Autoreload
01116-Bit Capture
1X1Baud Rate
XX0OFF
16-Bit Autoreload Mode
In ‘Autoreload’ mode, there are two options, which are selected
by bit EXEN2 in T2CON. If EXEN2 = 0, then when Timer 2
rolls over it not only sets TF2 but also causes the Timer 2 registers
to be reloaded with the 16-bit value in registers RCAP2L and
RCAP2H, which are preset by software. If EXEN2 = 1, then
Timer 2 still performs the above, but with the added feature that
a 1-to-0 transition at external input T2EX will also trigger the
16-bit reload and set EXF2. The autoreload mode is illustrated
in Figure 48 below.
CORE
PIN
T2EX
PIN
CLK
T2
*
TRANSITION
DETECTO R
12
C/
= 0
T2
= 1
C/
T2
CONTRO L
TR2
RELOAD
TL2
(8-BITS)
RCAP2LRCAP2H
16-Bit Capture Mode
In the ‘Capture’ mode, there are again two options, which are
selected by bit EXEN2 in T2CON. If EXEN2 = 0, then Timer 2
is a 16-bit timer or counter which, upon overflowing, sets bit TF2,
the Timer 2 overflow bit, which can be used to generate an interrupt. If EXEN2 = 1, then Timer 2 still performs the above, but
a l-to-0 transition on external input T2EX causes the current value
in the Timer 2 registers, TL2 and TH2, to be captured into registers RCAP2L and RCAP2H, respectively. In addition, the
transition at T2EX causes bit EXF2 in T2CON to be set, and
EXF2, like TF2, can generate an interrupt. The Capture Mode
is illustrated in Figure 49.
The baud rate generator mode is selected by RCLK = 1 and/or
TCLK = 1.
In either case if Timer 2 is being used to generate the baud rate,
the TF2 interrupt flag will not occur. Hence Timer 2 interrupts
will not occur so they do not have to be disabled. In this mode
the EXF2 flag, however, can still cause interrupts and this can
be used as a third external interrupt.
Baud rate generation will be described as part of the UART
serial port operation in the following pages.
TH2
(8-BITS)
TF2
EXF2
TIMER
INTER R UPT
CONTRO L
EXEN2
THE CORE CLOCK IS THE OUTPUT OF THE PLL AS DESCRIBED ON PAGE 46
THE CORE CLOCK IS THE OUTPUT OF THE PLL AS DESCRIBED ON PAGE 46
*
*
TRANSITION
DETECTO R
12
C/T2 = 0
C/
= 1
T2
CONTRO L
TR2
CAPTURE
CONTRO L
EXEN2
TL2
(8-BITS)
RCAP2LRCAP2H
Figure 49. Timer/Counter 2, 16-Bit Capture Mode
–58–
TH2
(8-BITS)
TF2
EXF2
TIMER
INTER R UPT
(12 March 2002) REV. PrC
Page 59
PRELIMINAR Y TECHNICAL D A T A
T2CONTimer/Counter 2 Control Register
SFR AddressC8H
Power-On Default Value00H
Bit AddressableYes
Table XXIX. T2CON SFR Bit Designations
BitNameDescription
7TF2Timer 2 Overflow Flag.
Set by hardware on a timer 2 overflow. TF2 will not be set when either RCLK or TCLK = 1.
Cleared by user software.
6EXF2Timer 2 External Flag.
Set by hardware when either a capture or reload is caused by a negative transition on T2EX and
EXEN2 = 1.
Cleared by user user software.
5RCLKReceive Clock Enable Bit.
Set by user to enable the serial port to use timer 2 overflow pulses for its receive clock in serial port
Modes 1 and 3.
Cleared by user to enable timer 1 overflow to be used for the receive clock.
4TCLKTransmit Clock Enable Bit.
Set by user to enable the serial port to use timer 2 overflow pulses for its transmit clock in serial
port Modes 1 and 3.
Cleared by user to enable timer 1 overflow to be used for the transmit clock.
3EXEN2Timer 2 External Enable Flag.
Set by user to enable a capture or reload to occur as a result of a negative transition on T2EX if
Timer 2 is not being used to clock the serial port.
Cleared by user for Timer 2 to ignore events at T2EX.
2TR2Timer 2 Start/Stop Control Bit.
Set by user to start timer 2.
Cleared by user to stop timer 2.
1CNT2Timer 2 timer or counter function select bit.
Set by user to select counter function (input from external T2 pin).
Cleared by user to select timer function (input from on-chip core clock).
0CAP2Timer 2 Capture/Reload Select Bit.
Set by user to enable captures on negative transitions at T2EX if EXEN2 = 1.
Cleared by user to enable auto-reloads with Timer 2 overflows or negative transitions at T2EX
when EXEN2 = 1. When either RCLK = 1 or TCLK = 1, this bit is ignored and the timer is
forced to autoreload on Timer 2 overflow.
ADuC834
Timer/Counter 2 Data Registers
Timer/Counter 2 also has two pairs of 8-bit data registers associated with it. These are used as both timer data registers and timer
capture/reload registers.
TH2 and TL2
Timer 2, data high byte and low byte.
SFR Address = CDhex, CChex respectively.
The serial port is full duplex, meaning it can transmit and receive simultaneously. It is also receive-buffered, meaning it can
commence reception of a second byte before a previously received byte has been read from the receive register. However, if
the first byte still has not been read by the time reception of the
second byte is complete, the first byte will be lost. The physical
SCONUART Serial Port Control Register
SFR Address98H
Power-On Default Value00H
Bit AddressableYes
Table XXX. SCON SFR Bit Designations
BitNameDescription
7SM0UART Serial Mode Select Bits.
6SM1These bits select the Serial Port operating mode as follows:
Enables multiprocessor communication in Modes 2 and 3. In Mode 0, SM2 should be cleared.
In Mode 1, if SM2 is set, RI will not be activated if a valid stop bit was not received. If SM2 is
cleared, RI will be set as soon as the byte of data has been received. In Modes 2 or 3, if SM2 is
set, RI will not be activated if the received ninth data bit in RB8 is 0. If SM2 is cleared, RI will
be set as soon as the byte of data has been received.
4RENSerial Port Receive Enable Bit.
Set by user software to enable serial port reception.
Cleared by user software to disable serial port reception.
3TB8Serial Port Transmit (Bit 9).
The data loaded into TB8 will be the ninth data bit that will be transmitted in Modes 2 and 3.
2RB8Serial port Receiver Bit 9.
The ninth data bit received in Modes 2 and 3 is latched into RB8. For Mode 1 the stop bit is
latched into RB8.
1TISerial Port Transmit Interrupt Flag.
Set by hardware at the end of the eighth bit in Mode 0, or at the beginning of the stop bit in
Modes 1, 2, and 3.
TI must be cleared by user software.
0RISerial Port Receive Interrupt Flag.
Set by hardware at the end of the eighth bit in mode 0, or halfway through the stop bit in
Modes 1, 2, and 3.
RI must be cleared by software.
interface to the serial data network is via Pins RXD(P3.0) and
TXD(P3.1) while the SFR interface to the UART is comprised of the following registers.
SBUF
The serial port receive and transmit registers are both accessed
through the SBUF SFR (SFR address = 99 hex). Writing to
SBUF loads the transmit register and reading SBUF accesses a
physically separate receive register.
Mode 0 is selected by clearing both the SM0 and SM1 bits in
the SFR SCON. Serial data enters and exits through RXD. TXD
outputs the shift clock. Eight data bits are transmitted or received. Transmission is initiated by any instruction that writes to
SBUF. The data is shifted out of the RXD line. The eight bits are
transmitted with the least-significant bit (LSB) first, as shown in
Figure 50.
MACHINE
CYCLE 8
S6S5S4S3S2S1S6S5S4S4S3S2S1S6S5S4S3S2S1
CORE
CLK
ALE
RXD
(DATA OUT)
TXD
(SHIF T CL O C K )
MACHINE
CYCLE 1
DATA BIT 0DATA BIT 1DATA BIT 6DATA BIT 7
MACHINE
CYCLE 2
MACHINE
CYCLE 7
Figure 50. UART Serial Port Transmission, Mode 0.
Reception is initiated when the receive enable bit (REN) is 1
and the receive interrupt bit (RI) is 0. When RI is cleared the
data is clocked into the RXD line and the clock pulses are
output from the TXD line.
Mode 1: 8-Bit UART, Variable Baud Rate
Mode 1 is selected by clearing SM0 and setting SM1. Each data
byte (LSB first) is preceded by a start bit(0) and followed by a stop
bit(1). Therefore 10 bits are transmitted on TXD or received on
RXD. The baud rate is set by the Timer 1 or Timer 2 overflow
rate, or a combination of the two (one for transmission and the
other for reception).
Transmission is initiated by writing to SBUF. The ‘write to
SBUF’ signal also loads a 1 (stop bit) into the ninth bit position
of the transmit shift register. The data is output bit by bit
until the stop bit appears on TXD and the transmit interrupt
flag (TI) is automatically set as shown in Figure 51.
STOP BIT
SET INTERRUPT
TXD
(SCON.1)
START
BIT
D0D1D2D3D4D5D6D7
TI
i.e. READY FOR MORE DATA
Figure 51. UART Serial Port Transmission, Mode 0.
Reception is initiated when a 1-to-0 transition is detected on
RXD. Assuming a valid start bit was detected, character reception
continues. The start bit is skipped and the eight data bits are
clocked into the serial port shift register. When all eight bits have
been clocked in, the following events occur:
- The eight bits in the receive shift register are latched into SBUF
- The ninth bit (Stop bit) is clocked into RB8 in SCON
- The Receiver interrupt flag (RI) is set
if, and only if, the following conditions are met at the time the
final shift pulse is generated:
- RI = 0, and
- Either SM2 = 0, or SM2 = 1 and the received stop bit = 1.
If either of these conditions is not met, the received frame is
irretrievably lost, and RI is not set.
REV. PrC (12 March 2002)
–61–
Mode 2: 9-Bit UART with Fixed Baud Rate
Mode 2 is selected by setting SM0 and clearing SM1. In this
mode the UART operates in 9-bit mode with a fixed baud rate.
The baud rate is fixed at Core_Clk/64 by default, although
by setting the SMOD bit in PCON, the frequency can be
doubled to Core_Clk/32. Eleven bits are transmitted or received, a
start bit(0), eight data bits, a programmable ninth bit and a stop
bit(1). The ninth bit is most often used as a parity bit, although it
can be used for anything, including a ninth data bit if required.
To transmit, the eight data bits must be written into SBUF.
The ninth bit must be written to TB8 in SCON. When transmission is initiated the eight data bits (from SBUF) are loaded
onto the transmit shift register (LSB first). The contents of TB8
are loaded into the ninth bit position of the transmit shift register.
The transmission will start at the next valid baud rate clock.
The TI flag is set as soon as the stop bit appears on TXD.
Reception for Mode 2 is similar to that of Mode 1. The eight
data bytes are input at RXD (LSB first) and loaded onto the
receive shift register. When all eight bits have been clocked in,
the following events occur:
- The eight bits in the receive shift register are latched into SBUF
- The ninth data bit is latched into RB8 in SCON
- The Receiver interrupt flag (RI) is set
if, and only if, the following conditions are met at the time the
final shift pulse is generated:
- RI = 0, and
- Either SM2 = 0, or SM2 = 1 and the received stop bit = 1.
If either of these conditions is not met, the received frame is
irretrievably lost, and RI is not set.
Mode 3: 9-Bit UART with Variable Baud Rate
Mode 3 is selected by setting both SM0 and SM1. In this mode
the 8051 UART serial port operates in 9-bit mode with a variable
baud rate determined by either Timer 1 or Timer 2. The operation of the 9-bit UART is the same as for Mode 2 but the baud
rate can be varied as for Mode 1.
In all four modes, transmission is initiated by any instruction that
uses SBUF as a destination register. Reception is initiated in Mode 0
by the condition RI = 0 and REN = 1. Reception is initiated in
the other modes by the incoming start bit if REN = 1.
UART Serial Port Baud Rate Generation
Mode 0 Baud Rate Generation
The baud rate in Mode 0 is fixed:
Mode 0 Baud Rate = (Core Clock Frequency
NOTE
1
In these descriptions Core Clock Frequency refers to the core clock frequency
selected via the CD0–2 bits in the PLLCON SFR.
1
/12)
Mode 2 Baud Rate Generation
The baud rate in Mode 2 depends on the value of the SMOD bit
in the PCON SFR. If SMOD = 0, the baud rate is 1/64 of the core
clock. If SMOD = 1, the baud rate is 1/32 of the core clock:
Mode 2 Baud Rate = (2
SMOD
/64) ∞ (Core Clock Frequency)
Mode 1 and 3 Baud Rate Generation
Traditionally the baud rates in Modes 1 and 3 are determined by
the overflow rate in Timer 1 or Timer 2, or both (one for
transmit and the other for receive).
On the ADuC834 however the baud rate can also be generated
via a seperate baud rate generator to achieve higher baud rates
and allow all three be used for other functions.
Page 62
ADuC834
PRELIMINAR Y TECHNICAL D A T A
BAUD RATE GENERATION USING TIMER 1 AND TIMER 2
Timer 1 Generated Baud Rates
When Timer 1 is used as the baud rate generator, the baud
rates in Modes 1 and 3 are determined by the Timer 1 overflow
rate and the value of SMOD as follows:
Modes 1 and 3 Baud Rate =
SMOD
(2
/32) × (Timer 1 Overflow Rate)
The Timer 1 interrupt should be disabled in this application.
The Timer itself can be configured for either timer or counter
operation, and in any of its three running modes. In the most
typi ca l application, it is configured for timer operation, in the
autoreload mode (high nibble of TMOD = 0100Binary). In that
case, the baud rate is given by the formula:
Modes 1 and 3 Baud Rate =
(2
SMOD
× ×
/32)
× (Core Clock/(12
× ×
× ×
× [256-TH1]))
× ×
A very low baud rate can also be achieved with Timer 1 by leaving
the Timer 1 interrupt enabled, and configuring the timer to run
as a 16-bit timer (high nibble of TMOD = 0100Binary), and
using the Timer 1 interrupt to do a 16-bit software reload. Table
XXXI below, shows some commonly-used baud rates and
how they might be calculated from a core clock frequency of
1.5728 MHz and 12.58 MHz using ti mer 1. Gen erally speaking, a 5% error is tolerable using asynchronous (start/stop)
communications.
Baud rates can also be generated using Timer 2. Using Timer 2
is similar to using Timer 1 in that the timer must overflow 16 times
before a bit is transmitted/received. Because Timer 2 has a 16-bit
autoreload mode a wider range of baud rates is possible using
Timer 2.
Modes 1 and 3 Baud Rate = (1/16) × (Timer 2 Overflow Rate)
Therefore, when Timer 2 is used to generate baud rates, the timer
increments every two clock cycles and not every core machine
cycle as before. Hence, it increments six times faster than Timer
1, and therefore baud rates six times faster are possible. Because
Timer 2 has 16-bit autoreload capability, very low baud rates
are still possible.
Timer 2 is selected as the baud rate generator by setting the TCLK
and/or RCLK in T2CON. The baud rates for transmit and receive
can be simultaneously different. Setting RCLK and/or TCLK puts
Timer 2 into its baud rate generator mode as shown in Figure 52.
In this case, the baud rate is given by the formula:
Modes 1 and 3 Baud Rate
= (Core Clk)/(32
× ×
× [65536 – (RCAP2H, RCAP2L)])
× ×
Table XXXII shows some commonly used baud rates and how they
might be calculated from a core clock frequency of 1.5728 MHz
and 12.5829 MHz using timer 2.
NOTE AVAILABILITY OF ADDITIONAL
EXTERNAL INTERRUPT
T2EX
PIN
TRANSITION
DETECTO R
THE CORE CLOCK IS THE OUTPUT OF THE PLL AS DESCRIBED ON PAGE 46
*
2
*
C/T2 = 0
C/
Figure 52. Timer 2, UART Baud Rates
–62–
TH2
(8-BITS)
TIMER 2
OVERFLOW
RELOAD
2
10
SMOD
0
1
1
RCLK
RX
16
0
TCLK
CLOCK
TX
16
CLOCK
(12 March 2002) REV. PrC
Page 63
PRELIMINAR Y TECHNICAL D A T A
ADuC834
BAUD RATE GENERATION USING TIMER 3
The ADuC824 and the ADuC816 can only achieve PC baud
rates up to 57,600baud. They cannot achieve a baud rate of
115,200. To address this problem the ADuC834 has added a
fourth timer specifically for generating high accuracy baudrates.
Timer 3 can be used instead of timer1 or timer2 for generating
the baudrate, allowing a much wider range of baud rates to be
accurately obtained. This also frees up the other three timers
allowing them to be used for different applications.
As shown in figure 53 timer 3 uses a programmable fractional
divider to divide the core clock down into a wide range of
clocks. These are then passed through a seven stage binary
divider. Two SFRs (T3CON and T3FD) are required to use
the Timer 3 baud rate generator.
T3CON is the baud rate control SFR, allowing timer 3 to be
used to set up the UART baud rate, and setting up the binary
divider (DIV). T3FD is the fractional divider ratio required to
achieve the required baudrate.
TIMER 1/TIMER 2
CORE
*
CLK
FRACTIONAL
DIVIDER
THE CORE CLOCK IS THE OUTPUT OF THE PLL AS DESCRIBED ON PAGE 46.
*
DIV
2
(1 + T3FD /64 )
32
RX CLO C K (F IG 52)
T3 RX /TX
CLOCK
TX CL OC K (F IG 52)
TIMER 1/TIMER 2
001
RX CLOCK
1
T3EN
TX CLOCK
Figure 53. Timer 3, UART Baud Rates
Table XXXIII. T3CON SFR Bit Designations
BitNameDescription
7T3ENSet to enable Timer 3 to generate
the baud rate. When set
PCON.7, T2CON.4 and
T2CON.5 are ignored.
Cleared to let the baud rate be
generated as per a standard
The ADuC834 provides a total of eleven interrupt sources with two priority levels. The control and configuration of the interrupt
system is carried out through three Interrupt-related SFRs. These are the IE (Interrupt Enable) register, the IP (Interrupt Priority
Register) and the IEIP2 (secondary interrupt enable/priority SFR) registers. There bit definifitions are given in the tables below.
IE:Interrupt Enable Register
SFR AddressA8H
Power-On Default Value00H
Bit AddressableYes
Table XXXV. IE SFR Bit Designations
BitNameDescription
7EAWritten by User to Enable ‘1’ or Disable ‘0’ All Interrupt Sources
6EADCWritten by User to Enable ‘1’ or Disable ‘0’ ADC Interrupt
5ET2Written by User to Enable ‘1’ or Disable ‘0’ Timer 2 Interrupt
4ESWritten by User to Enable ‘1’ or Disable ‘0’ UART Serial Port Interrupt
3ET1Written by User to Enable ‘1’ or Disable ‘0’ Timer 1 Interrupt
2EX1Written by User to Enable ‘1’ or Disable ‘0’ External Interrupt 1
1ET0Written by User to Enable ‘1’ or Disable ‘0’ Timer 0 Interrupt
0EX0Written by User to Enable ‘1’ or Disable ‘0’ External Interrupt 0
IP:Interrupt Priority Register
SFR AddressB8H
Power-On Default Value00H
Bit AddressableYes
Table XXXVI. IP SFR Bit Designations
BitNameDescription
7---Reserved for Future Use.
6PADCWritten by User to Select ADC Interrupt Priority (‘1’ = High; ‘0’ = Low)
5PT2Written by User to Select Timer 2 Interrupt Priority (‘1’ = High; ‘0’ = Low)
4PSWritten by User to Select UART Serial Port Interrupt Priority (‘1’ = High; ‘0’ = Low)
3PT1Written by User to Select Timer 1 Interrupt Priority (‘1’ = High; ‘0’ = Low)
2PX1Written by User to Select External Interrupt 1 Priority (‘1’ = High; ‘0’ = Low)
1PT0Written by User to Select Timer 0 Interrupt Priority (‘1’ = High; ‘0’ = Low)
0PX0Written by User to Select External Interrupt 0 Priority (‘1’ = High; ‘0’ = Low)
IEIP2:Secondary Interrupt Enable and Priority Register
SFR AddressA9H
Power-On Default ValueA0H
Bit AddressableNo
Table XXXVII. IEIP2 SFR Bit Designations
BitNameDescription
7---Reserved for Future Use.
6PTIWritten by User to Select TIC Interrupt Priority (‘1’ = High; ‘0’ = Low).
5PPSMWritten by User to Select Power Supply Monitor Interrupt Priority (‘1’ = High; ‘0’ = Low).
4PSIWritten by User to Select SPI Serial Port Interrupt Priority (‘1’ = High; ‘0’ = Low).
3---Reserved, This Bit Must Be ‘0.’
2ETIWritten by User to Enable ‘1’ or Disable ‘0’ TIC Interrupt.
1EPSMWritten by User to Enable ‘1’ or Disable ‘0’ Power Supply Monitor Interrupt.
0ESIWritten by User to Enable ‘1’ or Disable ‘0’ SPI Serial Port Interrupt.
–64–
(12 March 2002) REV. PrC
Page 65
PRELIMINAR Y TECHNICAL D A T A
ADuC834
Interrupt Priority
The Interrupt Enable registers are written by the user to enable
individual interrupt sources, while the Interrupt Priority registers
allow the user to select one of two priority levels for each interrupt. An interrupt of a high priority may interrupt the service
routine of a low priority interrupt, and if two interrupts of different priority occur at the same time, the higher level interrupt
will be serviced first. An interrupt cannot be interrupted by
another interrupt of the same priority level. If two interrupts of
the same priority level occur simultaneously, a polling sequence is used to determine which interrupt is serviced first.
The polling sequence is shown in Table XXXVIII.
When an interrupt occurs the program counter is pushed onto
the stack and the corresponding interrupt vector address is loaded
into the program counter. The interrupt vector addresses are
shown in Table XXXIX.
The watchdog can be configured to generate an interrupt instead of a reset
when it times out. This is used for logging errors or to examine the internal
status of the microcontroller core to understand, from a software debug
point of view, why a watchdog timeout occurred. The watchdog interrupt is
slightly different from the normal in terrupts in that its priority level is always
set to 1 and it is not possible to disable the interrupt via the global disable
bit (EA) in the IE SFR. This is done to ensure that the interrupt will always
be responded to if a watchdog timeout occurs. The watchdog will only
produce an interrupt if the watchdog timeout is greater than zero.
1
005B Hex
.
REV. PrC (12 March 2002)
–65–
Page 66
ADuC834
PRELIMINAR Y TECHNICAL D A T A
ADUC834 HARDWARE DESIGN CONSIDERATIONS
This section outlines some of the key hardware design considerations that must be addressed when integrating the
ADuC834 into any hardware system.
External Memory Interface
In addition to its internal program and data memories, the
ADuC834 can access up to 64 Kbytes of external program
memory (ROM/PROM/etc.) and up to 16 Mbytes of external
data memory (SRAM).
To select from which code space (internal or external program memory) to begin executing instructions, tie the EA
(external access) pin high or low, respectively. When EA is high
(pulled up to V
), user program execution will start at ad-
DD
dress 0 of the internal 62 Kbytes Flash/EE code space. When EA
is low (tied to ground) user program execution will start at address 0 of the external code space. When executing from internal
code space accesses to the program space above F7FF hex (62K)
will be read as NOP instructions.
Note that a second very important function of the EA pin is
described in the Single Pin Emulation Mode section of this
data sheet.
External program memory (if used) must be connected to
the ADuC834 as illustrated in Figure 54. Note that 16 I/O
lines (Ports 0 and 2) are dedicated to bus functions during
external program memory fetches. Port 0 (P0) serves as a
multiplexed address/data bus. It emits the low byte of the
program counter (PCL) as an address, and then goes into a
float state awaiting the arrival of the code byte from the program
memory. During the time that the low byte of the program
counter is valid on P0, the signal ALE (Address Latch Enable)
clocks this byte into an address latch. Meanwhile, Port 2 (P2)
emits the high byte of the program counter (PCH), then PSEN
strobes the EPROM and the code byte is read into the
ADuC834.
Though both external program memory and external data
memory are accessed by some of the same pins, the two are
completely independent of each other from a software point
of view. For example, the chip can read/write external data
memory while executing from external program memory.
Figure 55 shows a hardware configuration for accessing up
to 64 Kbytes of external RAM. This interface is standard to any
8051 compatible MCU.
D0›D7
(DAT A )
A0›A7
A8›A15
OE
WE
SRAM
ADuC83 4
P0
LATCH
ALE
P2
RD
WR
Figure 55. External Data Memory Interface (64 K Address
Space)
If access to more than 64 Kbytes of RAM is desired, a feature unique to the MicroConverter allows addressing up to
16 Mbytes of external RAM simply by adding an additional latch
as illustrated in Figure 56.
D0›D7
(DAT A )
A0›A7
A8›A15
A16›A23
SRAM
ADuC83 4
P0
LATCH
ALE
P2
LATCH
ADuC83 4
P0
LATCH
ALE
P2
PSEN
EPROM
D0›D7
(INSTRUCTION)
A0›A7
A8›A15
OE
Figure 54. External Program Memory Interface
Note that program memory addresses are always 16 bits wide,
even in cases where the actual amount of program memory used
is less than 64 Kbytes. External program execution sacrifices
two of the 8-bit ports (P0 and P2) to the function of addressing
the program memory. While executing from external program
memory, Ports 0 and 2 can be used simultaneously for read/
write access to external data memory, but not for general-purpose I/O.
–66–
RD
WR
OE
WE
Figure 56. External Data Memory Interface (16 M Bytes
Address Space)
In either implementation, Port 0 (P0) serves as a multiplexed address/data bus. It emits the low byte of the data pointer
(DPL) as an address, which is latched by a pulse of ALE prior to
data being placed on the bus by the ADuC834 (write operation) or the SRAM (read operation). Port 2 (P2) provides the
data pointer page byte (DPP) to be latched by ALE, followed by the data pointer high byte (DPH). If no latch is
connected to P2, DPP is ignored by the SRAM, and the 8051
standard of 64 Kbyte external data memory access is maintained.
Detailed timing diagrams of external program and data
memory read and write access can be found in the timing
specification sections of this data sheet.
(12 March 2002) REV. PrC
Page 67
PRELIMINAR Y TECHNICAL D A T A
ADuC834
Power Supplies
The ADuC834’s operational power supply voltage range is
2.7 V to 5.25 V. Although the guaranteed data sheet specifications are given only for power supplies within 2.7 V to 3.6 V or
+5% of the nominal 5 V level, the chip will function equally
well at any power supply level between 2.7 V and 5.25 V.
Separate analog and digital power supply pins (AV
respectively) allow AVDD to be kept relatively free of
DV
DD
DD
and
noisy digital signals often present on the system DVDD line. In
this mode the part can also operate with split supplies; that is,
using different voltage supply levels for each supply. For example, this means that the system can be designed to operate
with a DV
voltage level of 3 V while the AVDD level can be at
DD
5 V or vice-versa if required. A typical split supply configuration
is show in Figure 57.
DIGITAL SUPPLY
+
›
0.1F
10F
ADuC834
20
34
DV
DD
48
21
35
DGND
47
ANALOG SUPPLY
F
10
5
AV
DD
6
AGND
0.1F
+
›
Figure 57. External Dual Supply Connections
As an alternative to providing two separate power supplies,
AV
can be kept quiet by placing a small series resistor and/or
DD
ferrite bead between it and DV
, and then decoupling AV
DD
DD
separately to ground. An example of this configuration is shown
in Figure 58. With this configuration other analog circuitry
(such as op-amps, voltage reference, etc.) can be powered from
the AV
supply line as well.
DD
DIGITAL SUPPLY
+
›
0.1F
10F
1.6
⍀
AV
DD
AGND
5
6
10F
0.1F
BEAD
ADuC834
20
DV
34
DD
48
21
35
DGND
47
Figure 58. External Single Supply Connections
Notice that in both Figure 57 and Figure 58, a large value (10 µF)
reservoir capacitor sits on DV
sits on AV
. Also, local small-value (0.1 µF) capacitors are
DD
and a separate 10 µF capacitor
DD
located at each VDD pin of the chip. As per standard design practice, be sure to include all of these capacitors, and ensure
the smaller capacitors are closest to each AV
pin with trace
DD
lengths as short as possible. Connect the ground terminal of each
of these capacitors directly to the underlying ground plane.
Finally, it should also be noticed that, at all times, the analog
and digital ground pins on the ADuC834 should be referenced
to the same system ground reference point.
REV. PrC (12 March 2002)
–67–
Power-On Reset Operation
An internal POR (power-on reset) is implemented on the
ADuC834. For DV
ADuC834 in reset. As DV
below 2.63V the internal POR will hold the
DD
rises above 2.63V an internal timer
DD
will timeout for approx 128ms before the part is released from
reset. The user must ensure that the power supply must have
reached at least a 2.7 V level by this time.
Power Consumption
The “CORE” values given on the spec pages represent the current drawn by DV
pulled by the AV
, while the rest (“ADC”, and “DAC”) are
DD
pin and can be disabled in software when
DD
not in use. The other on-chip peripherals (watchdog timer,
powe r supply monitor, etc.) consume negligible current and are
therefore lumped in with the “CORE” operating current here.
Of course, the user must add any currents sourced by the parallel and serial I/O pins, and that sourced by the DAC, in order
to determine the total current needed at the ADuC834’s supply pins. Also, current draw from the DV
supply will increase
DD
by approximately 5 m A d uring Flash/EE erase and program
cycles
Power-Saving Modes
Setting the Idle and Power-Down Mode bits, PCON.0 and
PCON.1 respectively, in the PCON SFR described in Table II,
allows the chip to be switched from normal mode into idle mode,
and also into full power-down mode.
In idle mode, the oscillator continues to run, but the core clock
generated from the PLL is halted. The on-chip peripherals continue to receive the clock, and remain functional. The CPU st atus
is preserved with the stack pointer, program counter, and all other
internal registers maintain their data during idle mode. Port
pins and DAC output pins also retain their states, and ALE and
PSEN outputs go high in this mode. The chip will recover from
idle mode upon receiving any enabled interrupt, or on receiving
a hardware reset.
In power-down mode, both the PLL and the clock to the core
are stopped. The on-chip oscillator can be halted or can continue
to oscillate depending on the state of the oscillator power-down
bit (OSC_PD) in the PLLCON SFR. The TIC, being driven
directly from the oscillator, can also be enabled during powerdown. All other on-chip peripherals however, are shut down.
Port pins retain their logic levels in this mode, but the DAC output
goes to a high-impedance state (three-state) while ALE and
PSEN outputs are held low. During full power-down mode,
the ADuC834 typically consumes a total of 15 µA. There are
five ways of terminating power-down mode:
Asserting the RESET pin (#15)
Returns to normal mode all registers are set to their default state
and program execution starts at the reset vector once the Reset
pin is de-asserted.
Cycling Power
All registers are set to their default state and program execution
starts at the reset vector approximately 128ms later.
Time Interval Counter (TIC) Interrupt
Power-down mode is terminated and the CPU services the TIC
interrupt. The RETI at the end of the TIC ISR will return the
core to the instruction after that which enabled power down.
SPI Interrupt
Power-down mode is terminated and the CPU services the SPI
interrupt. The RETI at the end of the ISR will return the core
to the instruction after that which enabled power down. It
Page 68
ADuC834
PRELIMINAR Y TECHNICAL D A T A
should be noted that the SPI power down interrupt enable bit
(SERIPD) in the PCON SFR must first be set to allow this
mode of operation.
INT0INT0
Interrupt
INT0
INT0INT0
Power-down mode is terminated and the CPU services the
INT0 interrupt. The RETI at the end of the ISR will return the
core to the instruction after that which enabled power-down. It
should be noted that the INT0 power-down interrupt enable bit
(INT0PD) in the PCON SFR must first be set to allow this
mode of operation.
Grounding and Board Layout Recommendations
As with all high resolution data converters, special attention must
be paid to grounding and PC board layout of ADuC834-based
designs in order to achieve optimum performance from the ADCs
and DAC.
Although the ADuC834 has separate pins for analog and digital
ground (AGND and DGND), the user must not tie these to two
separate ground planes unless the two ground planes are connected together very close to the ADuC834, as illustrated in the
simplified example of Figure 59a. In systems where digital and
analog ground planes are connected together somewhere else
(at the system’s power supply for example), they cannot be connected again near the ADuC834 since a ground loop would result.
In these cases, tie the ADuC834’s AGND and DGND pins all
to the analog ground plane, as illustrated in Figure 59b. In systems
with only one ground plane, ensure that the digital and analog
components are physically separated onto separate halves of the
board such that digital return currents do not flow near analog
circuitry and vice versa. The ADuC834 can then be placed between
the digital and analog sections, as illustrated in Figure 59c.
back to ground. Make sure the return paths for all currents
are as close as possible to the paths the currents took to reach
their destinations. For example, do not power components
on the analog side of Figure 59b with DVDD since that
would force return currents from DV
to flow through
DD
AGND. Also, try to avoid digital currents flowing under analog
circuitry, which could happen if the user placed a noisy digital chip on the left half of the board in Figure 59c.
Whenever possible, avoid large discontinuities in the ground
plane(s) (such as are formed by a long trace on the same
layer), since they force return signals to travel a longer path.
And of course, make all connections to the ground plane directly, with little or no trace separating the pin from its via to
ground.
If the user plans to connect fast logic signals (rise/fall time <
5 ns) to any of the ADuC834’s digital inputs, add a series
resistor to each relevant line to keep rise and fall times longer
than 5 ns at the ADuC834 input pins. A value of 100Ω or 200Ω
is usually sufficient to prevent high-speed signals from coupling
capacitive ly into the ADuC83 4 and affecting the accuracy of
ADC conversions.
ADuC834 System Self-Identification
In some hardware designs it may be an advantage for the
soft ware running on the ADuC834 target to identify the host
MicroConverter. For example, code running on the ADuC834
may also be used with the ADuC824 or the ADuC816 but is
required to operate differently.
The CHIPID SFR is a read-only register located at SFR address C2 h ex. The upper nibble of this SFR is set to 2Xhex
to designate an ADuC834.
A
B
C
PLACE ANALOG COM-
PONENTS HERE
AGND
PLACE ANALOG
COMPONENTS
HERE
PLACE ANALOG
COMPO NE NTS HERE
GND
PLACE D IG ITA L
COMPO NENT S H ERE
DGND
PLACE D IG ITA L
COMPONENTS
HERE
DGNDAGND
PLACE DIGITAL COM-
PONENTS
HERE
Figure 59. System Grounding Schemes
In all of these scenarios, and in more complicated real-life applications, keep in mind the flow of current from the supplies and
Clock Oscillator
As described earlier, the core clock frequency for the
ADuC834 is generated from an on-chip PLL that locks onto
a multiple (384 times) of 32.768 kHz. The latter is generated
from an internal clock oscillator. To use the internal clock
oscillator, connect a 32.768 kHz parallel resonant crystal
between XTAL1 and XTAL2 pins (32 and 33) as shown in
Figure 60.
As shown in the typical external crystal connection diagram
in Figure 60, two internal 12 pF capacitors are provided on-chip.
These are connected internally, directly to the XTAL1 and
XTAL2 pins and the total input capacitances at both pins is
detailed in the specification section of this data sheet. The
value of the total load capacitance required for the external crystal
should be the value recommended by the crystal manufacturer
for use with that specific crystal. In many cases, because of the
on-chip capacitors, additional external load capacitors will not be
required.
To facilitate in-circuit programming, plus in-circuit debug
and emulation options, users will want to implement some
simple connection points in their hardware that will allow eas y
access to download, debug, and emulation modes.
In-Circuit Serial Download Access
Nearly all ADuC834 designs will want to take advantage of
the in-circuit reprogrammability of the chip. This is accomplished
by a connection to the ADuC834’s UART, which requires an
external RS-232 chip for level translation if downloading code
from a PC. Basic configuration of an RS-232 connection is
illustrated in Figure 61 with a simple ADM202-based circuit.
If users would rather not design an RS-232 chip onto a board,
refer to the application note “uC006–A 4-Wire UART-to-PC
Interface”
gaining in-circuit serial download access to the ADuC834.
Note
1
Application note uC006 is available at www.analog.com/microconverter
In addition to the basic UART connections, users will also
need a way to trigger the chip into download mode. This is
accomplished via a 1 kΩ pull-down resistor that can be
jumpered onto the PSEN pin, as shown in Figure 61. To get the
ADuC834 into download mode, simply connect this jumper
and power-cycle the device (or manually reset the device, if a
manual reset button is available) and it will be ready to receive
a new program serially. With the jumper removed, the device
will come up in normal mode (and run the program) whenever
power is cycled or RESET is toggled.
Note that PSEN is normally an output (as described in the
External Memory Interface section) and it is sampled as an
input only on the falling edge of RESET (i.e., at power-up or
upon an external manual reset). Note also that if any external circuitry unintentionally pulls PSEN low during power-up
or reset events, it could cause the chip to enter download mode
and therefore fail to begin user code execution as it should. To
prevent this, ensure that no external signals are capable of
pulling the PSEN pin low, except for the external PSEN
jumper itself.
Embedded Serial Port Debugger
From a hardware perspective, entry to serial port debug mode
is identical to the serial download entry sequence described
above. In fact, both serial download and serial port debug
modes can be thought of as essentially one mode of operation
used in two different ways.
Note that the serial port debugger is fully contained on the
ADuC834 device, (unlike "ROM monitor" type debuggers)
and therefore no external memory is needed to enable insystem debug sessions.
Single-Pin Emulation Mode
Also built into the ADuC834 is a dedicated controller for
single-pin in-circuit emulation (ICE) using standard production ADuC834 devices. In this mode, emulation access is
gained by connection to a single pin, the EA pin. Normally, this
pin is hard-wired either high or low to select execution from
internal or external program memory space, as described
earlier. To enable single-pin emulation mode, however, users
will need to pull the EA pin high through a 1 kΩ resistor as
shown in Figure 61. The emulator will then connect to the 2pin header also shown in Figure 61. To be compatible with
1
for a simple (and zero-cost-per-board) method of
the standard connector that comes with the single-pin emulator
available from Accutron Limited (www.accutron.com), use a 2pin 0.1-inch pitch "Friction Lock" header from Molex
(www.molex.com) such as their part number 22-27-2021. Be
sure to observe the polarity of this header. As
represented in Figure 61, when the Friction Lock tab is at
the right, the ground pin should be the lower of the two pins
(when viewed from the top).
Enhanced-Hooks Emulation Mode
ADuC834 also supports enhanced-hooks emulation mode. An
enhanced-hooks-based emulator is available from Metalink Corporation (www.metaice.com). No special hardware support for
these emulators needs to be designed onto the board since
these are "pod-style" emulators where users must replace the
chip on their board with a header device that the emulator pod
plugs into. The only hardware concern is then one of determining
if adequate space is available for the emulator pod to fit into the
system enclosure.
Typical System Configuration
A typical ADuC834 configuration is shown in Figure 61. It
summarizes some of the hardware considerations discussed
in t he previous paragraphs.
Figure 61 also includes connections for a typical analog measurement application of the ADuC834, namely an interface
to an RTD (Resistive Temperature Device). The arrangement
shown is commonly referred to as a 4-wire RTD configuration.
Here, the on-chip excitation current sources are enabled to
excite the sensor. An external differential reference voltage is
generated by the current sourced through resistor R1. This current also flow s directly through the RTD, which generates a
differential voltage directly proportional to temperature. This
differential voltage is routed directly to the positive and negative inputs of the primary ADC (AIN1, AIN2 respectively). A
second external resistor, R2, i s used to ensure that absolute
analog input voltage on the negative inp u t t o t he primary
ADC stays within that specified for the ADuC834, i.e.,
AGND + 100 mV.
It should also be noted that variations in the excitation current
do not affect the measurement system as the input voltage from
the RTD and reference voltage across R1 vary ratiometrically
with the ex c i ta t ion current. Resistor R1 must, however, have
a low temperature coefficient to avoid errors in the reference
voltage over temperature.
REV. PrC (12 March 2002)
–69–
Page 70
ADuC834
RTD
R
5.6k
PRELIMINAR Y TECHNICAL D A T A
DOWNLOAD/DEBUG
ENABLE JUMPER
(NORMALLY O PEN)
DV
DD
49 4845
51 50
DD
DV
P1.2/I
1/DAC
200A/400A
EXCITATION
CURRENT
A
A
REF
⍀
AV
DD
+
IN
›
V
IN
REF
+
EXC
P1.3/A IN5 /DAC
AV
DD
AGND
REFIN›
REFIN+
P1.4/A IN1
P1.5/A IN2
RXD
RESET
ADuC834
TXD
4644 43
D
DGN
D
DD
DGN
DV
1k
⍀
DV
DD
1k
⍀
4047
42 4152
N
EA
39
PSE
38
37
36
35
DGND
DV
34
DD
33
XTAL2
XTAL1
32
31
30
29
28
27
2-PIN HEADER FOR
EMULATION ACCESS
(NORMALLY O PEN)
DV
DD
32.766kHz
RS232 DONGLE
ADM202
C1+
V+
C1›
C2+
C2›
V›
T2OUT
R2IN
NOT CONNECTED IN THIS EXAMPLE
1
2
3
4
5
6
7
8
9
V
GND
T1OUT
R1IN
R1OUT
T1IN
T2IN
R2OUT
DV
DV
DD
CC
DD
9-PIN D-SUB
FEMALE
Figure 61. Typical System Configuration
–70–
(12 March 2002) REV. PrC
Page 71
PRELIMINAR Y TECHNICAL D A T A
ADuC834
QUICKSTART DEVELOPMENT SYSTEM
The QuickStart Development System is a full featured, low cost development tool suite supporting the ADuC834. The system
consists of the following PC-based (Windows-compatible) hardware and software development tools.
Hardware:ADuC834 Evaluation Board, and Serial Port Cable
Code Development:8051 Assembler
Code Functionality:ADSIM, Windows MicroConverter Code Simulator
In-Circuit Code Download:Serial Downloader
In-Circuit Debugger/Emulator:Serial Port/Single Pin Debugger/Emulator with Assembly and C Source debug
Misc. Other:CD-ROM Documentation and Two
Additional Prototype Devices
Figures 62 shows the typical components of a QuickStart Development System while Figure 63 shows a typical debug session. A
brief description of some of the software tools’ components in the QuickStart Development System is given below.
Figure 62. Components of the QuickStart Dev System Figure. 63. Typical Debug Session
Download- In Circuit Downloader
The Serial Downloader is a software program that allows the user to serially download an assembled program (Intel Hex format file)
to the on-chip program FLASH memory via the serial COM1 port on a standard PC. An Application Note (uC004) detailing
this serial download protocol is available from www.analog.com/microconverter.
DeBugger/Emulator — In-Circuit Debugger/Emulator
The Debugger/Emulator is a Windows application that allows the user to debug code execution on silicon using the MicroConverter
UART serial port or via a single pin to provide non-intrusive debug. The debugger provides access to all on-chip peripherals during a typical debug session, including single-step and multiple break-point code execution control. C source and Assembly level
debug are both possible with the emulator.
ADSIM—Windows Simulator
The Simulator is a Windows application that fully simulates the MicroConverter functionality including ADC and DAC peripherals. The simulator provides an easy-to-use, intuitive, interface to the MicroConverter functionality and integrates many
standard debug features; including multiple breakpoints, single stepping; and code execution trace capability. This tool can be
used both as a tutorial guide to the part as well as an efficient way to prove code functionality before moving to a hardware platform.
REV. PrC (12 March 2002)
–71–
Page 72
ADuC834
OUTLINE DIMENSIONS
Dimensions shown in inches and (mm).
52-Lead MQFP
(S-52)
0.037 (0.95)
0.026 (0.65)
SEATING
PLANE
0.012 (0.30)
0.006 (0.15)
0.008 (0.20)
0.006 (0.15)
0.094 (2.39)
0.084 (2.13)
0.082 (2.09)
0.078 (1.97)
52
1
13
14
0.557 (14.15)
0.537 (13.65)
0.398 (10.11)
0.390 (9.91)
PIN 1
TOP VIEW
(PINS DOWN)
0.0256
(0.65)
BSC
40
26
0.014 (0.35)
0.010 (0.25)
39
91)
0.11)
4.15)
3.65)
0.390 (9.
0.398 (1
0.557 (1
0.537 (1
27
–72–
(12 March 2002) REV. PrC
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.