Adc and Dac Lecture Notes
Adc and Dac Lecture Notes
#$
#$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
!"
FEATURES Peripheral Features
ANALOG FEATURES D 16 Digital I/O Pins
D MSC1200 and MSC1201: D Additional 32-Bit Accumulator
− 24 Bits No Missing Codes D Two 16-Bit Timer/Counters
− 22 Bits Effective Resolution At 10Hz D System Timers
− Low Noise: 75nV D Programmable Watchdog Timer
D MSC1202: D Full-Duplex USART
− 16 Bits No Missing Codes
D Basic SPI
− 16 Bits Effective Resolution At 200Hz
− Noise: 600nV D Basic I2C
D PGA From 1 to 128 D Power Management Control
D Precision On-Chip Voltage Reference D Internal Clock Divider
D 8 Diff/Single-Ended Channels (MSC1200) D Idle Mode Current < 200mA
D 6 Diff/Single-Ended Channels (MSC1201/02) D Stop Mode Current < 100nA
D On-Chip Offset/Gain Calibration D Digital Brownout Reset
D Offset Drift: 0.1ppm/°C D Analog Low-Voltage Detect
D Gain Drift: 0.5ppm/°C D 20 Interrupt Sources
D On-Chip Temperature Sensor
D Selectable Buffer Input GENERAL FEATURES
D Signal-Source Open-Circuit Detect D Each Device Has Unique Serial Number
D 8-Bit Current DAC D Packages:
− TQFP-48 (MSC1200)
DIGITAL FEATURES
− QFN-36 (MSC1201/02)
Microcontroller Core D Low Power: 3mW at 3.0V, 1MHz
D 8051-Compatible D Industrial Temperature Range:
D High-Speed Core: −40°C to +125°C
− 4 Clocks per Instruction Cycle D Power Supply: 2.7V to 5.25V
D DC to 33MHz
D On-Chip Oscillator
D PLL with 32kHz Capability APPLICATIONS
D Single Instruction 121ns D Industrial Process Control
D Dual Data Pointer D Instrumentation
Memory D Liquid/Gas Chromatography
D 4kB or 8kB of Flash Memory D Blood Analysis
D Flash Memory Partitioning D Smart Transmitters
D Endurance 1M Erase/Write Cycles, D Portable Instruments
100-Year Data Retention D Weigh Scales
D 256 Bytes Data SRAM D Pressure Transducers
D In-System Serially Programmable D Intelligent Sensors
D Flash Memory Security
D Portable Applications
D 1kB Boot ROM
D DAS Systems
Please be aware that an important notice concerning availability, standard warranty, and use in critical applications of Texas Instruments
semiconductor products and disclaimers thereto appears at the end of this data sheet.
All trademarks are the property of their respective owners.
%&'() ' *!
* +
, Copyright 2004−2006, Texas Instruments Incorporated
*! *
! * '-
(!
",
" *
!,
www.ti.com
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
PACKAGE/ORDERING INFORMATION(1)
FLASH MEMORY ADC RESOLUTION PACKAGE
PRODUCT (BYTES) (BITS) MARKING
MSC1200Y2 4k 24 MSC1200Y2
MSC1200Y3 8k 24 MSC1200Y3
MSC1201Y2 4k 24 MSC1201Y2
MSC1201Y3 8k 24 MSC1201Y3
MSC1202Y2 4k 16 MSC1202Y2
MSC1202Y3 8k 16 MSC1202Y3
(1) For the most current package and ordering information, see the Package Option Addendum located at the end of this datasheet, or refer to our
web site at www.ti.com.
MSC120x FAMILY FEATURES This integrated circuit can be damaged by ESD. Texas
Instruments recommends that all integrated circuits be
FEATURES(1) MSC120xY2(2) MSC120xY3(2) handled with appropriate precautions. Failure to observe
Flash Program Memory (Bytes) Up to 4k Up to 8k proper handling and installation procedures can cause damage.
Flash Data Memory (Bytes) Up to 2k Up to 4k ESD damage can range from subtle performance degradation to
Internal Scratchpad RAM (Bytes) 256 256 complete device failure. Precision integrated circuits may be more
susceptible to damage because very small parametric changes could
(1) All peripheral features are the same on all devices; the flash memory size
cause the device not to meet its published specifications.
is the only difference.
(2) The last digit of the part number (N) represents the onboard flash size =
(2N)kBytes.
2
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
(1) The input impedance for PGA = 128 is the same as that for PGA = 64 (that is, 7MΩ/64).
(2) Calibration can minimize these errors.
(3) The gain self-calibration cannot have a REF IN+ of more than AVDD −1.5V with Buffer ON. To calibrate gain, turn Buffer OFF.
(4) ∆VOUT is change in digital result.
3
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
(1) The input impedance for PGA = 128 is the same as that for PGA = 64 (that is, 7MΩ/64).
(2) Calibration can minimize these errors.
(3) The gain self-calibration cannot have a REF IN+ of more than AVDD −1.5V with Buffer ON. To calibrate gain, turn Buffer OFF.
(4) ∆VOUT is change in digital result.
4
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
(1) The input impedance for PGA = 128 is the same as that for PGA = 64 (that is, 7MΩ/64).
(2) Calibration can minimize these errors.
(3) The gain self-calibration cannot have a REF IN+ of more than AVDD −1.5V with Buffer ON. To calibrate gain, turn Buffer OFF.
(4) ∆VOUT is change in digital result.
5
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
(1) The input impedance for PGA = 128 is the same as that for PGA = 64 (that is, 7MΩ/64).
(2) Calibration can minimize these errors.
(3) The gain self-calibration cannot have a REF IN+ of more than AVDD −1.5V with Buffer ON. To calibrate gain, turn Buffer OFF.
(4) ∆VOUT is change in digital result.
6
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
MSC120x
7
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
tHIGH
tR tF
tOSC
t RW
RST
P1.0/PROG
8
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
PIN CONFIGURATIONS
P3.6/SCK/SCL/CLKS
Top View TQFP
P3.0/RxD0
P3.1/TxD0
P3.3/INT1
P3.2/INT0
P1.7/INT5
P3.5/T1
P3.4/T0
DGND
DVDD
NC(1)
P3.7
48 47 46 45 44 43 42 41 40 39 38 37
NC(1) 1 36 DVDD
XIN 2 35 DVDD
XOUT 3 34 DGND
DGND 4 33 DGND
RST 5 32 P1.6/INT4
NC(1) 6 31 P1.5/INT3
MSC1200
NC(1) 7 30 P1.4/INT2/SS
NC(1) 8 29 P1.3/DIN
AVDD 9 28 P1.2/DOUT
AGND 10 27 P1.1
AGND 11 26 P1.0/PROG
AINCOM 12 25 NC(1)
13 14 15 16 17 18 19 20 21 22 23 24
AIN7
AIN6
AIN5
AIN4
AIN3
AIN2
AIN1
AIN0
REFIN−
NC(1)
REFOUT/REFIN+
IDAC
P3.0/RxD0
P3.1/TxD0
P3.3/INT1
P3.2/INT0
P1.7/INT5
P3.5/T1
P3.4/T0
P3.7
36 35 34 33 32 31 30 29 28
XIN 1 27 DVDD
XOUT 2 26 DGND
DGND 3 25 P1.6/INT4
RST 4 24 P1.5/INT3
NC(1) 5
MSC1201 23 P1.4/INT2/SS
MSC1202
AVDD 6 22 P1.3/DIN
AGND 7 21 P1.2/DOUT
AGND 8 20 P1.1
AINCOM 9 19 P1.0/PROG
10 11 12 13 14 15 16 17 18
REFOUT/REFIN+
AIN5
AIN4
AIN3
AIN2
AIN1
AIN0
IDAC
REFIN−
9
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
PIN ASSIGNMENTS
MSC1200 MSC1201/1202
NAME DESCRIPTION
PIN # PIN #
NC 1, 6, 7, 8, 16, 5 No Connection. Leave unconnected.
25, 47
XIN 2 1 The crystal oscillator pin XIN supports parallel resonant AT-cut fundamental frequency crystals and
ceramic resonators. XIN can also be an input if there is an external clock source instead of a crystal.
XIN must not be left floating.
XOUT 3 2 The crystal oscillator pin XOUT supports parallel resonant AT-cut fundamental frequency crystals and
ceramic resonators. XOUT serves as the output of the crystal amplifier.
DGND 4, 33, 34, 48 3, 26 Digital Ground
RST 5 4 Holding the reset input high for two tOSC periods will reset the device.
AVDD 9 6 Analog Power Supply
AGND 10, 11 7, 8 Analog Ground
AINCOM 12 9 Analog Input (can be analog common for single-ended inputs or analog input for differential inputs)
IDAC 13 10 IDAC Output
REFOUT/REF IN+ 14 11 Internal Voltage Reference Output/Voltage Reference Positive Input (required CREF = 0.1µF)
REF IN− 15 12 Voltage Reference Negative Input (tie to AGND for internal voltage reference)
AIN7 17 — Analog Input Channel 7
AIN6 18 — Analog Input Channel 6
AIN5 19 13 Analog Input Channel 5
AIN4 20 14 Analog Input Channel 4
AIN3 21 15 Analog Input Channel 3
AIN2 22 16 Analog Input Channel 2
AIN1 23 17 Analog Input Channel 1
AIN0 24 18 Analog Input Channel 0
P1.0−P1.7 26−32, 37 19−25, 28 Port 1 is a bidirectional I/O port (refer to P1DDRL, SFR AEh, and P1DDRH, SFR AFh, for port pin
configuration control).
The alternate functions for Port 1 are listed below.
Port Alternate Name(s) Alternate Use
P1.0 PROG Serial programming mode (must be DGND on reset)
P1.1 N/A
P1.2 DOUT Serial data out
P1.3 DIN Serial data in
P1.4 INT2/SS External interrupt 2 / Slave Select
P1.5 INT3 External interrupt 3
P1.6 INT4 External interrupt 4
P1.7 INT5 External interrupt 5
DVDD 35, 36, 46 27 Digital Power Supply
P3.0−P3.7 38−45 29−36 Port 3 is a bidirectional I/O port (refer to P3DDRL, SFR B3h, and P3DDRH, SFR B4h, for port pin
configuration control).
The alternate functions for Port 3 are listed below.
Port Alternate Name(s) Alternate Use
P3.0 RxD0 Serial port 0 input
P3.1 TxD0 Serial port 0 output
P3.2 INT0 External interrupt 0
P3.3 INT1 External interrupt 1
P3.4 T0 Timer 0 external input
P3.5 T1 Timer 1 external input
P3.6 SCK/SCL/CLKS SCK / SCL / various clocks (refer to PASEL, SFR F2h)
P3.7 N/A
10
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
20 PGA32 20
PGA64
19 PGA128
19
ENOB (rms)
ENOB (rms)
18 18
PGA32
17 PGA16 PGA64 PGA128
17
16
15 16
14 15
13
14
12 Sinc3 Filter, Buffer OFF
Sinc3 Filter, Buffer OFF 13
11
10 12
1 10 100 1000 0 500 1000 1500 2000
Data Rate (SPS) fMOD
Decimation Ratio =
fDATA
18 18
17 17 PGA32
PGA32 PGA64 PGA128 PGA16 PGA64 PGA128
16 16
PGA16
15 15
14 14
Sinc3 Filter, Buffer ON AVDD = 3V, Sinc3 Filter,
13 13 VREF = 1.25V, Buffer OFF
12 12
0 500 1000 1500 2000 0 500 1000 1500 2000
f MOD f MOD
Decimation Ratio = Decimation Ratio =
fDATA fDATA
20 20
19 19
ENOB (rms)
ENOB (rms)
18 18
17 17
PGA32 PGA16 PGA64
PGA128
16 16
PGA32 PGA64 PGA128
PGA16
15 15
14 14
AVDD = 3V, Sinc3 Filter, Sinc2 Filter
13 13
VREF = 1.25V, Buffer ON
12 12
0 500 1000 1500 2000 0 500 1000 1500 2000
fMOD fMOD
Decimation Ratio = Decimation Ratio =
fDATA fDATA
11
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
ENOB (rms)
16 15
ENOB
15 fMOD = 31.25kHz
14 10
Gain 128
13
12 5
fMOD = 62.5kHz
11
10 0
0 500 1000 1500 2000 1 10 100 1k 10k 100k
Decimation Value Data Rate (SPS)
DEC = 50 3000
DEC = 255
ENOB (rms)
15
DEC = 20 2500
2000
10
1500
5 1000
DEC = 10
500
0 0
10 100 1k 10k 100k −2 − 1.5 −1 − 0.5 0 0.5 1 1.5 2
Data Rate (SPS) ppm of FS
0.6 21.0
Internal
ENOB (rms)
0.5 20.5
0.4 20.0
0.3 19.5
0.2 19.0
0.1 18.5
0 18.0
− 2.5 − 1.5 − 0.5 0.5 1.5 2.5 − 2.5 − 1.5 − 0.5 0.5 1.5 2.5
VIN (V) VIN (V)
12
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
ENOB (rms)
ENOB (rms)
16 16
PGA128
15 15
PGA1
14 14
13 13
12 12
PGA128 Sinc3 Filter, Buffer OFF
11 11
Sinc3 Filter, Buffer OFF
10 10
1 10 100 1000 0 500 1000 1500 2000
Data Rate (SPS) fMOD
Decimation Ratio =
fDATA
16 16
PGA128
15 15
14 14
PGA128
13 13
12 12
Sinc3 Filter, Buffer ON AVDD = 3V, Sinc3 Filter,
11 11 VREF = 1.25V, Buffer OFF
10 10
0 500 1000 1500 2000 0 500 1000 1500 2000
f MOD fMOD
Decimation Ratio = Decimation Ratio =
fDATA fDATA
16 16
PGA128 PGA128
15 15
14 14
13 13
12 12
AVDD = 3V, Sinc3 Filter, Sinc2 Filter
11 11
VREF = 1.25V, Buffer ON
10 10
0 500 1000 1500 2000 0 500 1000 1500 2000
fMOD fMOD
Decimation Ratio = Decimation Ratio =
fDATA fDATA
13
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
ENOB (rms)
16 fMOD = 31.25kHz
15 12
14
13
8
12
Fast Settling Filter
11 fMOD = 62.5kHz
10 4
0 500 1000 1500 2000 1 10 100 1k 10k 100k
fMOD Data Rate (SPS)
Decimation Ratio =
fDATA
20
DEC > 100
DEC = 50
ENOB (rms)
15
DEC = 20
10
5
DEC = 10
0
10 100 1k 10k 100k
Data Rate (SPS)
14
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
0 0
+85_ C
−5 −5
−10 −10
+85_C +125_C
−15 −15
−2.5 −2.0 −1.5 −1.0 −0.5 0 0.5 1.0 1.5 2.0 2.5 −2.5 −2.0 −1.5 −1.0 −0.5 0 0.5 1.0 1.5 2.0 2.5
ADC Input Voltage (V) ADC Input Voltage (V)
5 20
0 15
AVDD = 3V
−5 10
AVDD = 5V
−10 5
−15 0
0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VIN = −VREF 0 VIN = +VREF
VREF (V)
VIN (V)
35
ADC Offset (ppm)
INL (ppm of FS)
5
30
AVDD = 5V
25 0
20
−5
15
10
−10
5
0 −15
1 2 4 8 16 32 64 128 −60 −40 −20 0 20 40 60 80 100 120 140
PGA Setting Temperature (_C)
15
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
IADC (µA)
1.1 0.5
−40_C AVDD = 5V, Buffer = OFF
1.0 0.4
−55_C AVDD = 3V, Buffer = OFF
0.9 0.3
0.8 0.2
0.7 0.1
2.5 3.0 3.5 4.0 4.5 5.0 5.5 1 2 4 8 16 32 64 128
Analog Supply Voltage (V) PGA Setting
Normalized Gain
4
2 1.00002
0
−2
1
−4
0.99998
−6
−8 0.99996
− 10
− 12 0.99994
− 14
− 16 0.99992
− 60 − 40 − 20 0 +20 +40 +60 +80 +100 +120 +140 − 60 − 40 − 20 0 +20 +40 +60 +80 +100 +120 +140
Temperature (_C) Temperature (_C)
DVDD = 5V 2
DVDD = 3V
Digital Supply Current (mA)
Idle Mode
Normal Mode 4
10
10
8
16
32
1
1 1024
DVDD = 3V
Idle Mode
0.1
0.1
1 10 100
1 10 100
Clock Frequency (MHz)
Clock Frequency (MHz)
16
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
3 95
2.5 3.0 3.5 4.0 4.5 5.0 5.5 1 2 4 8 16 32 64 128
Digital Supply Voltage (V) PGA Setting
25
VREF = 2.5V 100.2
1.25V
20 fMOD = 15.6kHz 100.0
IO Frequency (MHz)
30
14.5
5.25V
14.0 29
4.75V
13.5
3.3V 28
13.0
2.7V 27
12.5
12.0 26
−60 −40 −20 0 20 40 60 80 100 120 140 −60 −40 −20 0 20 40 60 80 100 120 140
Temperature (_ C) Temperature (_C)
17
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
990
0.8
3.5 3V
IDAC INL (Bits)
20
40
60
80
100
120
140
160
180
200
220
240
260
0 10 20 30 40 50 60 70
IDAC Code Output Current (mA)
HISTOGRAM OF
TEMPERATURE SENSOR VALUES
22
20
18
16
Occurrences (%)
14
12
10
8
6
4
2
0
112.4
112.7
113.1
113.4
113.7
114.1
114.4
114.7
115.1
115.4
115.7
116.1
116.4
116.7
117.1
18
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
AVDD
Burnout
Detect Timers/
Temperature VREF ALVD
Counters
Sensor
DBOR
8−Bit WDT
AIN0 POR
Offset DAC
AIN1
Alternate
AIN2
Functions
AIN3 Digital
AIN4 MUX BUF PGA Modulator DIN
Filter DOUT
AIN5 PORT1 SS
AIN6(2) 4K or 8K EXT (4)
FLASH 32−Bit ACC PROG
AIN7(2)
AINCOM
256 Bytes USART0
8051 EXT (2)
SRAM
PORT3 T0
T1
Burnout 128 Bytes SFR SCK/SCL/CLKS
Detect System FLASH On−Chip RST
System Oscillator
Clock
AGND Divider
PLL
IDAC 8−Bit IDAC
XIN XOUT
NOTES: (1) REF IN− must be tied to AGND when using internal VREF.
(2) AIN6 and AIN7 available only on MSC1200.
19
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
MSC120x Timing
ALE
the timing is different. The MSC120x families use an Internal
efficient 8051 core that results in an improved instruction PSEN
execution speed of between 1.5 and 3 times faster than the Internal
AD0−AD7
original core for the same external clock speed (4 clock Internal
cycles per instruction versus 12 clock cycles per A8−A15
instruction, as shown in Figure 4). This efficiency 4 Cycles
translates into an effective throughput improvement of
more than 2.5 times, using the same code and same CLK
external clock speed. Therefore, a device frequency of 12 Cycles
33MHz for the MSC120x actually performs at an
fCLK
cpu_cycle C1 C2 C3 C4 C1 C2 C3 C4 C1
20
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
Furthermore, improvements were made to peripheral differently than the MSC1200 or MSC1201.) This gives the
features that off-load processing from the core, and the user the ability to add or subtract software functions and to
user, to further improve efficiency. These iprovements migrate between family members. Thus, the MSC120x
allow for 32-bit addition, subtraction and shifting to be can become a standard device used across several
accomplished in a few instruction cycles, compared to application platforms.
hundreds of instruction cycles executed through software
Family Development Tools
implementation. For instance, 32-bit accumulation can be
done through the summation register to significantly The MSC120x are fully compatible with the standard 8051
reduce the processing overhead for multiple-byte data instruction set. This compatibility means that users can
from the ADC or other sources. develop software for the MSC120x with their existing 8051
development tools. Additionally, a complete, integrated
Family Device Compatibility
development environment is provided with each demo
The hardware functionality and pin configuration across board, and third-party developers also provide support.
the MSC120x families are fully compatible. To the user, the
Power-Down Modes
only difference between family members is the memory
configuration. This design makes migration between The MSC120x can power several of the on-chip
family members simple. Code written for the MSC1200Y2, peripherals and put the CPU into Idle mode. This is
MSC1201Y2, or MSC1202Y2 can be executed directly on an accomplished by shutting off the clocks to those sections,
MSC1200Y3, MSC1201Y3, or MSC1202Y3, respectively. as shown in Figure 6.
(However, the ADC registers for the MSC1202 are mapped
fOSC fSYS
STOP SYSCLK
C7
fCLK
SPICON/ SCL/SCK
I2CCON 9A
PDCON.0
µs FTCON Flash Write
USEC (30µs to 40µs)
FB [3:0] EF Timing
milliseconds
interrupt
MSINT
FA
seconds
PDCON.1 SECINT interrupt
F9
21
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
OVERVIEW
The MSC120x ADC structure is shown in Figure 7. The figure lists the components that make up the ADC, along with the
corresponding special function register (SFR) associated with each component.
AIN0 AVDD
AIN1
Burnout
AIN2 REFIN+
Detect
AIN3
Input fSAMP
AIN4
Multiplexer
AIN5
MSC1200 AIN6
In+ Sample
Only AIN7
In−
Buffer
and Hold
PGA Σ
AINCOM
Temperature
Sensor
Burnout Offset
Detect
REFIN− DAC
D7h ADMUX DCh ADCON0 F6h ACLK E6h ODAC
AGND
FAST
VIN ∆Σ ADC SINC2 ADC
Modulator SINC3
Σ X Result Register
Summation
AUTO Block
Offset Gain
Calibration Calibration Σ
REFIN− Register Register
22
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
AINCOM
NOTE: (1) For MSC1201/MSC1202, AIN6 and AIN7 are tied to REFIN−.
23
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
When the buffer is not selected, the input impedance of the RMS
INPUT-REFERRED
analog input changes with ACLK clock frequency (ACLK, MSC1200 MSC1202
NOISE
SFR F6h) and gain (PGA). The relationship is: FULL- MSC1201 ENOB(1)
SCALE ENOB(1) UP TO MSC1200
1 PGA RANGE AT 10HZ 200HZ MSC1201 MSC1202
Impedance (W) + SETTING (BITS) (BITS) (nV) (mV)
f SAMP @ CS (V)
1 ±2.5 21.7 16 1468 76.3
Figure 9. Analog Input Structure (without Buffer) and Decimation Ratio is set in [ADCON3:ADCON2]
24
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
Gain (dB)
Calibration should be performed after power on. It should −60
also be done after a change in temperature, decimation
ratio, buffer, power supply, voltage reference, or PGA. The −80
offset DAC will affect offset calibration; therefore, the value
of the offset should be zero before performing a calibration. −100
with the quick response of the Fast Settling Time filter. The
−80
frequency response of each filter is shown in Figure 11.
−100
−120
Adjustable Digital Filter
0 1 2 3 4 5
fDATA
Sinc3
Figure 10. Filter Step Responses Figure 11. Filter Frequency Responses
25
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
0.1µF
10kΩ
The IDAC output voltage cannot exceed the compliance 4 RST
voltage of AVDD − 1.5V.
1MΩ
26
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
27
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
The MSC120x can operate in three separate clock modes: In IOM, the CPU executes either in LF mode (if HCR2,
Internal Oscillator mode (IOM), External Clock mode CLKSEL = 111) or high-frequency (HF) mode (if HCR2,
(ECM), and Phase Lock Loop (PLL) mode. A block CLKSEL = 110 and DVDD = 5.0V). In this mode, XIN must
diagram is shown in Figure 13. The clock mode for the be grounded or tied to supply.
MSC120x is selected via the CLKSEL bits in HCR2. IO External Clock
low-frequency (LF) mode is the default mode for the
device. In ECM (HCR2, CLKSEL = 011), the CPU can execute
from an external crystal, external ceramic resonator,
Serial Flash Programming mode (SFPM) uses IO LF mode external clock, or external oscillator. If an external clock is
(the HCR2 and CLKSEL bits have no effect). Table 2 detected at startup, then the CPU will begin execution in
shows the active clock mode for the various startup ECM after startup. If an external clock is not detected at
conditions during User Application mode. startup, then the device will revert to the mode shown in
Table 2.
tOSC
STOP
LF/HF Internal
PLL DAC
XOUT Mode Oscillator
PLLDIV
NOTE: (1) Disabled in PLL mode; therefore, an external resistor between XIN and XOUT is required.
(1) Clock detection is only done at startup; refer to Serial Flash Programming Timing parameter tRFD in Figure 2.
(2) XIN must not be left floating; it must be tied high or low or parasitic oscillation may occur.
(3) PLL operation requires that both AVDD and DVDD are within their specified ranges.
28
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
PLL
XIN
In PLL mode (HCR2, CLKSEL = 101 or HCR2, C1
CLKSEL = 100), the CPU can execute from an external
32.768kHz crystal. This mode enables the use of a PLL
XOUT
circuit that synthesizes the selected clock frequencies
C2
(PLL LF mode or PLL HF mode). If an external clock is
detected at startup, then the CPU begins execution in PLL
mode after startup. If an external clock is not detected at NOTE: Refer to the crystal manufacturer’s specification
for C1 and C2 values.
startup, then the device reverts to the mode shown in
Table 2. The status of the PLL can be determined by first
writing the PLLLOCK bit (enable) and then reading the Figure 14. External Crystal Connection
PLLLOCK status bit in the PLLH SFR.
The frequency of the PLL is preloaded with default
trimmed values. However, the PLL frequency can be
fine-tuned by writing to the PLLH and PLLL SFRs. The
equation for the PLL frequency is: External Clock XIN
29
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
DOUT
SPI /I 2C
Data Write P1.2
DOUT
TX_CLK
SPICON SS
I2CCON P1.4
CNT_CLK SS
CNT INT Counter Logic
SCK/SCL
Start/Stop Pad Control
I2C INT
Detect P3.6
SCK
I 2C
Stretch
Control
RX_CLK P1.3
DIN
SPI /I2C
Data Read DIN
30
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
SCK Cycle # 1 2 3 4 5 6 7 8
SCK (CPOL = 0)
SCK (CPOL = 1)
Sample Input
MSB 6 5 4 3 2 1 LSB
(CPHA = 0) Data Out
Sample Input
MSB 6 5 4 3 2 1 LSB
(CPHA = 1) Data Out
SS to Slave
The SS pin can be used to control the output of data on Application Flow
DOUT when the MSC120x is in slave mode. The SS
This section explains the typical application usage flow of
function is enabled or disabled by the ESS bit of the
SPI in master and slave modes.
SPICON SFR. When enabled, the SS input of a slave
device must be externally asserted before a master device Master Mode Application Flow
can exchange data with the slave device. SS must be low
1. Configure the port pins.
before data transactions and must stay low for the duration
of the transaction. When SS is high, data will not be shifted 2. Configure the SPI.
into the shift register, nor will the counter increment. When 3. Assert SS to enable slave communication (if
SPI is enabled, SS also controls the drive of the line DOUT applicable).
(P1.2). When SS is low in slave mode, the DOUT pin will
4. Write data to SPIDATA.
be driven and when SS is high, DOUT will be high
impedance. 5. Generate eight SCKs.
6. Read the received data from SPIDATA.
The SPI generates interrupt ECNT (AIE.2) to indicate that
the transfer/reception of the byte is complete. The interrupt Slave Mode Application Flow
goes high whenever the counter value is equal to 8
1. Configure the ports pins.
(indicating that eight SCKs have occurred). The interrupt
is cleared on reading or writing to the SPIDATA register. 2. Enable SS (if applicable).
During the data transfer, the actual counter value can be 3. Configure the SPI.
read from the SPICON SFR.
4. Write data to SPIDATA.
Power Down 5. Wait for the Count Interrupt (eight SCKs).
The SPI is powered down by the PDSPI bit in the power 6. Read the data from SPIDATA.
control register (PDCON). This bit needs to be cleared to
enable the SPI function. When the SPI is powered down,
CAUTION:
pins P1.2, P1.3, P1.4, and P3.6 revert to general-purpose
If SPIDATA is not read before the next SPI
I/O pins. transaction, the ECNT interrupt will be removed
and the previous data will be lost.
31
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
SDA
32
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
Receive The MSC120x allow the user to partition the Flash Memory
between Program Memory and Data Memory. For
Once address recognition, R/W determination, and instance, the MSC120xY3 contain 8kB of Flash Memory
ACK/NACK are complete, I2CDATA must be written with on-chip. Through the hardware configuration registers, the
0xFFh to enable data reception. Upon completion of the user can define the partition between Program Memory
data shift, the MSC120x generates the CNT interrupt and (PM) and Data Memory (DM), as shown in Table 3,
stretches SCL. Received data can then be read from Table 4, and Figure 20. The MSC120x families offer two
I2CDATA. After the serial data has been received, memory configurations.
ACK/NACK is generated by writing 0x7Fh (for ACK) or
0xFFh (for NACK) to I2CDATA. The write to I2CDATA
clears the CNT interrupt and clock stretch. Table 3. Flash Memory Partitioning
HCR0 MSC120xY2 MSC120xY3
MEMORY MAP DFSEL PM DM PM DM
The MSC120x contain on-chip SFR, Flash Memory, 00 2kB 2kB 4kB 4kB
Configuration Memory, Scratchpad SRAM Memory, and 01 2kB 2kB 6kB 2kB
Boot ROM. The SFR registers are primarily used for 10 3kB 1kB 7kB 1kB
control and status. The standard 8051 features and 11
additional peripheral features of the MSC120x are 4kB 0kB 8kB 0kB
(default)
controlled through the SFR. Reading from an undefined
SFR returns zero. Writing to undefined SFR registers is not
recommended and will have indeterminate effects. Table 4. Flash Memory Partitioning Addresses
Flash Memory is used for both Program Memory and Data HCR0 MSC120xY2 MSC120xY3
Memory; however, program execution can only occur from DFSEL PM DM PM DM
Program Memory. Program/Data Memory partition size is 00 0000−07FF 0400−0BFF 0000−0FFF 0400−13FF
selectable. The partition size is set through HCR0 (in the 01 0000−07FF 0400−0BFF 0000−17FF 0400−0BFF
Configuration Memory), which is programmed serially.
10 0000−0BFF 0400−07FF 0000−1BFF 0400−07FF
Both Program and Data Flash Memory are erasable and
writable (programmable) in UAM. Erase and write timing 11
0000−0FFF 0000 0000−1FFF 0000
(default)
of Flash Memory is controlled in the Flash Memory Timing
Control register (FTCON, SFR 0EFh). As an added
33
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
Program Data
Memory Memory
Serial Flash User
FFFFh FFFFh
Unused Programming Application
Configuration Mode Mode
FC00h
Select in
34
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
REGISTER MAP Program Status Word register (PSW; 0D0h) in the SFR
area described below. The 16 bytes immediately above
Figure 21 illustrates the Register Map. It is entirely
the R0−R7 registers are bit-addressable, so any of the 128
separate from the Program and Data Memory areas
bits in this area can be directly accessed using
discussed previously. A separate class of instructions is
bit-addressable instructions.
used to access the registers. There are 256 potential
register locations. In practice, the MSC120x have 256
bytes of Scratchpad RAM and up to 128 SFRs. This is
possible since the upper 128 Scratchpad RAM locations
can only be accessed indirectly. Thus, a direct reference 7Fh
to one of the upper 128 locations must be an SFR access. Direct
Direct RAM is reached at locations 0 to 7Fh (0 to 127). RAM
2Fh 7F 7E 7D 7C 7B 7A 79 78
2Eh 77 76 75 74 73 72 71 70
255 FFh 255 FFh
2Dh 6F 6E 6D 6C 6B 6A 69 68
Direct
Indirect Special Function 2Ch 67 66 65 64 63 62 61 60
RAM Registers
128 80h 128 2Bh 5F 5E 5D 5C 5B 5A 59 58
80h
127 7Fh SFR Registers
Direct 2Ah 57 56 55 54 53 52 51 50
RAM
29h 4F 4E 4D 4C 4B 4A 49 48
Bit-Addressable
0 00h
28h 47 46 45 44 43 42 41 40
Scratchpad
RAM 27h 3F 3E 3D 3C 3B 3A 39 38
26h 37 36 35 34 33 32 31 30
Figure 21. Register Map 25h 2F 2E 2D 2C 2B 2A 29 28
24h 27 26 25 24 23 22 21 20
SFRs are accessed directly between 80h and FFh (128 to
23h 1F 1E 1D 1C 1B 1A 19 18
255). The RAM locations between 128 and 255 can be
reached through an indirect reference to those locations. 22h 17 16 15 14 13 12 11 10
Scratchpad RAM is available for general-purpose data 21h 0F 0E 0D 0C 0B 0A 09 08
storage. Within the 128 bytes of RAM, there are several
20h 07 06 05 04 03 02 01 00
special-purpose areas.
1Fh
Bit Addressable Locations Bank 3
18h
In addition to direct register access, some individual bits 17h
are also accessible. These are individually addressable Bank 2
10h
bits in both the RAM and SFR area. In the Scratchpad
0Fh
RAM area, registers 20h to 2Fh are bit-addressable. This Bank 1
provides 128 (16 × 8) individual bits available to software. 08h
A bit access is distinguished from a full-register access by 07h
Bank 0
the type of instruction. In the SFR area, any register
location ending in a 0h or 8h is bit-addressable. Figure 22 00h
shows details of the on-chip RAM addressing including the MSB LSB
locations of individual RAM bits.
Working Registers
As part of the lower 128 bytes of RAM, there are four banks Figure 22. Scratchpad Register Addressing
of Working Registers, as shown in Figure 20. The Working
Registers are general-purpose RAM locations that can be
Thus, an instruction can designate the value stored in R0
addressed in a special way. They are designated R0
(for example) to address the upper RAM. The 16 bytes
through R7. Since there are four banks, the currently
immediately above the these registers are
selected bank will be used by any instruction using R0−R7.
bit-addressable, so any of the 128 bits in this area can be
This design allows software to change context by simply
directly accessed using bit-addressable instructions.
switching banks. Bank access is controlled via the
35
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
36
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
Serial Flash Programming Mode The recommended baud rate range for SFPM is 2400 to
19200. If communication errors occur, decreasing the
Serial Flash Programming mode (SFPM) is used to
baud rate may improve communication performance.
download Program and Data Memory into the onboard
Flash Memory on the MSC120x. It is initiated by holding Also note that in SFPM, the Brownout Detect circuit is
the P1.0/PROG pin low during the reset cycle, as shown disabled and AVDD must be > 2.0V.
in Figure 23. After the reset cycle, the host can
communicate with the MSC120x through USART0. Refer
to application note SBAA076 (www.ti.com) for serial INTERRUPTS
programming commands and protocol.
The MSC120x use a three-priority interrupt system. As
In SFPM, the MSC120x uses the internal oscillator in low shown in Table 6, each interrupt source has an
frequency mode (that is, the external clock is disabled). independent priority bit, flag, interrupt vector, and enable
The internal oscillator frequency is affected by the power (except that nine interrupts share the Auxiliary Interrupt,
supply voltage and device temperature. Therefore, in AI, at the highest priority). In addition, interrupts can be
order to avoid losing communication during programming, globally enabled or disabled. The interrupt structure is
it is important to have a stable power supply and compatible with the original 8051 family. All of the standard
temperature environment during serial communication. interrupts are available.
MSC120x
Reset Circuit (or VDD) RST AVDD
DVDD
P1.0/PROG
P3.1 TXD
Serial RS232 Host PC
Port 0 P3.0 RXD Transceiver or
Serial Terminal
37
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
(1) These interrupts set the AI flag (EICON.4) and are enabled by EAI (EICON.5).
(2) If edge-triggered, cleared automatically by hardware when the service routine is vectored to. If level-triggered, the flag follows the state of the pin.
(3) Cleared automatically by hardware when interrupt vector occurs.
(4) Globally enabled by EA (IE.7).
38
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
NOTE: HCR0 is programmable only in SFPM, but can be read in UAM using the faddr_data_read Boot ROM routine.
RSL Reset Sector Lock. The reset sector can be used to provide another method of Flash Memory programming, which
bit 5 allows Program Memory updates without changing the jumpers for in-circuit code updates or program development.
The code in this boot sector would then provide the monitor and programming routines with the ability to jump into
the main Flash code when programming is finished.
0: Enable Reset Sector Writing
1: Enable Read-Only mode for reset sector (4kB) (default). Same effect as PML for the MSC120xY2.
EBR Enable Boot ROM. Boot ROM is 1kB of code located in ROM, not to be confused with the 4kB Boot Sector located
bit 4 in Flash Memory.
0: Disable Internal Boot ROM
1: Enable Internal Boot ROM (default)
39
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
NOTE: HCR1 is programmable only in SFPM, but can be read in UAM using the faddr_data_read Boot ROM routine.
DBSEL3−0 Digital Supply Brownout Level Select. The values listed are nominal. The actual value will vary depending on
device clock frequency and supply voltage. For high clock frequencies, the variation could be on the order of 10%
below the nominal value.
bits 7−4 0000: 4.6V
0001: 4.2V
0010: 3.8V
0011: 3.6V
0100: 3.3V
0101: 3.1V
0110: 2.9V
0111: 2.7V
1000: 2.6V
1001: Reserved
1010: Reserved
1011: Reserved
1100: Reserved
1101: Reserved
1110: Reserved
1111: Reserved
40
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
NOTE: HCR2 is programmable only in SFPM, but can be read in UAM using the faddr_data_read Boot ROM routine.
41
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
SPIDATA
9Bh 00h
I2CDATA
9Ch
9Dh
9Eh
9Fh
A0h
A1h
A2h
A3h
A4h AIPOL SECIP SUMIP ADCIP MSECIP I2CIP CNTIP ALVDIP 0 00h
A5h PAI 0 0 0 0 PAI3 PAI2 PAI1 PAI0 00h
A6h AIE ESEC ESUM EADC EMSEC EI2C ECNT EALV 0 00h
A7h AISTAT SEC SUM ADC MSEC I2C CNT ALVD 0 00h
A8h IE EA 0 0 ES0 ET1 EX1 ET0 EX0 00h
A9h
42
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
B1h
B2h
B3h P3DDRL P33H P33L P32H P32L P31H P31L P30H P30L 00h
B4h P3DDRH P37H P37L P36H P36L P35H P35L P34H P34L 00h
B5h IDAC 00h
B6h
B7h
B8h IP 1 0 0 PS0 PT1 PX1 PT0 PX0 80h
B9h
BAh
BBh
BCh
BDh
BEh
BFh
C0h
C1h
C2h
C3h
C4h
C5h
C6h EWU EWUWDT EWUEX1 EWUEX0 00h
C7h SYSCLK 0 0 DIVMOD1 DIVMOD0 0 DIV2 DIV1 DIV0 00h
C8h
C9h
CAh
CBh
CCh
CDh
CEh
CFh
D0h PSW CY AC F0 RS1 RS0 OV F1 P 00h
D1h OCL LSB 00h
D2h OCM 00h
D3h OCH MSB 00h
D4h GCL LSB 5Ah
D5h GCM ECh
D6h GCH MSB 5Fh
43
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
(1) For the MSC1200/01, the ADC result is contained in ADRESH, ADRESM, and ADRESL. For the MSC1202, the ADC result is contained in
ADRESM and ADRESL (that is, shifted right one byte) and the MSB is sign-extended (Bipolar mode) or zero-padded (Unipolar mode) in
ADRESH. Therefore, when migrating between the MSC1200/01 and MSC1202, the ADC result calculation must be adjusted accordingly. For
all devices, the ADC interrupt is cleared by reading ADRESL.
(2) Dependent on active clock mode.
44
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
45
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
46
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
SP.7−0 Stack Pointer. The stack pointer identifies the location where the stack will begin. The stack pointer is incremented before
bits 7−0 every PUSH or CALL operation and decremented after each POP or RET/RETI. This register defaults to 07h after reset.
DPL0.7−0 Data Pointer Low 0. This register is the low byte of the standard 8051 16-bit data pointer. DPL0 and DPH0 are used
bits 7−0 to point to non-scratchpad data RAM. The current data pointer is selected by DPS (SFR 86h).
DPH0.7−0 Data Pointer High 0. This register is the high byte of the standard 8051 16-bit data pointer. DPL0 and DPH0 are used
bits 7−0 to point to non-scratchpad data RAM. The current data pointer is selected by DPS (SFR 86h).
DPL1.7−0 Data Pointer Low 1. This register is the low byte of the auxiliary 16-bit data pointer. When the SEL bit (DPS.0)
bits 7−0 (SFR 86h) is set, DPL1 and DPH1 are used in place of DPL0 and DPH0 during DPTR operations.
DPH1.7−0 Data Pointer High. This register is the high byte of the auxiliary 16-bit data pointer. When the SEL bit (DPS.0)
bits 7−0 (SFR 86h) is set, DPL1 and DPH1 are used in place of DPL0 and DPH0 during DPTR operations.
SEL Data Pointer Select. This bit selects the active data pointer.
bit 0 0: Instructions that use the DPTR will use DPL0 and DPH0.
1: Instructions that use the DPTR will use DPL1 and DPH1.
47
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
SMOD Serial Port 0 Baud Rate Doubler Enable. The serial baud rate doubling function for Serial Port 0.
bit 7 0: Serial Port 0 baud rate will be a standard baud rate.
1: Serial Port 0 baud rate will be double that defined by baud rate generation equation.
GF1 General-Purpose User Flag 1. This is a general-purpose flag for software control.
bit 3
GF0 General-Purpose User Flag 0. This is a general-purpose flag for software control.
bit 2
STOP Stop Mode Select. Setting this bit halts the internal oscillator and blocks external clocks. This bit always reads as 0.
bit 1 Exit with RESET. In this mode, internal peripherals are frozen and I/O pins are held in their current state. The ADC is
frozen, but IDAC and VREF remain active.
IDLE Idle Mode Select. Setting this bit freezes the CPU, Timer 0 and 1, and the USART; other peripherals remain active.
bit 0 This bit will always be read as a 0. Exit with AIE (A6h) and EWU (C6h) interrupts (refer to Figure 6 for clocks affected
during Idle mode).
TF1 Timer 1 Overflow Flag. This bit indicates when Timer 1 overflows its maximum count as defined by the current mode.
bit 7 This bit can be cleared by software and is automatically cleared when the CPU vectors to the Timer 1 interrupt service routine.
0: No Timer 1 overflow has been detected.
1: Timer 1 has overflowed its maximum count.
TR1 Timer 1 Run Control. This bit enables/disables the operation of Timer 1. Halting this timer preserves the current
bit 6 count in TH1, TL1.
0: Timer is halted.
1: Timer is enabled.
TF0 Timer 0 Overflow Flag. This bit indicates when Timer 0 overflows its maximum count as defined by the current mode.
bit 5 This bit can be cleared by software and is automatically cleared when the CPU vectors to the Timer 0 interrupt service routine.
0: No Timer 0 overflow has been detected.
1: Timer 0 has overflowed its maximum count.
TR0 Timer 0 Run Control. This bit enables/disables the operation of Timer 0. Halting this timer preserves the current
bit 4 count in TH0, TL0.
0: Timer is halted.
1: Timer is enabled.
IE1 Interrupt 1 Edge Detect. This bit is set when an edge/level of the type defined by IT1 is detected. If IT1 = 1, this bit
bit 3 will remain set until cleared in software or the start of the External Interrupt 1 service routine. If IT1 = 0, this bit will inversely
reflect the state of the INT1 pin.
IT1 Interrupt 1 Type Select. This bit selects whether the INT1 pin will detect edge- or level-triggered interrupts.
bit 2 0: INT1 is level-triggered.
1: INT1 is edge-triggered.
IE0 Interrupt 0 Edge Detect. This bit is set when an edge/level of the type defined by IT0 is detected. If IT0 = 1, this bit
bit 1 will remain set until cleared in software or the start of the External Interrupt 0 service routine. If IT0 = 0, this bit will inversely
reflect the state of the INT0 pin.
IT0 Interrupt 0 Type Select. This bit selects whether the INT0 pin will detect edge- or level-triggered interrupts.
bit 0 0: INT0 is level-triggered.
1: INT0 is edge-triggered.
48
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
GATE Timer 1 Gate Control. This bit enables/disables the ability of Timer 1 to increment.
bit 7 0: Timer 1 will clock when TR1 = 1, regardless of the state of pin INT1.
1: Timer 1 will clock only when TR1 = 1 and pin INT1 = 1.
C/T Timer 1 Counter/Timer Select.
bit 6 0: Timer is incremented by internal clocks.
1: Timer is incremented by pulses on T1 pin when TR1 (TCON.6, SFR 88h) is 1.
M1, M0 Timer 1 Mode Select. These bits select the operating mode of Timer 1.
bits 5−4
M1 M0 MODE
0 0 Mode 0: 8-bit counter with 5-bit prescale.
0 1 Mode 1: 16 bits.
1 0 Mode 2: 8-bit counter with auto reload.
1 1 Mode 3: Timer 1 is halted, but holds its count.
GATE Timer 0 Gate Control. This bit enables/disables the ability of Timer 0 to increment.
bit 3 0: Timer 0 will clock when TR0 = 1, regardless of the state of pin INT0 (software control).
1: Timer 0 will clock only when TR0 = 1 and pin INT0 = 1 (hardware control).
C/T Timer 0 Counter/Timer Select.
bit 2 0: Timer is incremented by internal clocks.
1: Timer is incremented by pulses on pin T0 when TR0 (TCON.4, SFR 88h) is 1.
M1, M0 Timer 0 Mode Select. These bits select the operating mode of Timer 0.
bits 1−0
M1 M0 MODE
0 0 Mode 0: 8-bit counter with 5-bit prescale.
0 1 Mode 1: 16 bits.
1 0 Mode 2: 8-bit counter with auto reload.
1 1 Mode 3: Two 8-bit counters.
TL0.7−0 Timer 0 LSB. This register contains the least significant byte of Timer 0.
bits 7−0
TL1.7−0 Timer 1 LSB. This register contains the least significant byte of Timer 1.
bits 7−0
49
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
TH0.7−0 Timer 0 MSB. This register contains the most significant byte of Timer 0.
bits 7−0
TH1.7−0 Timer 1 MSB. This register contains the most significant byte of Timer 1.
bits 7−0
T1M Timer 1 Clock Select. This bit controls the division of the system clock that drives Timer 1. Clearing this bit to 0
bit 4 maintains 8051 compatibility. This bit has no effect on instruction cycle timing.
0: Timer 1 uses a divide-by-12 of the crystal frequency.
1: Timer 1 uses a divide-by-4 of the crystal frequency.
T0M Timer 0 Clock Select. This bit controls the division of the system clock that drives Timer 0. Clearing this bit to 0
bit 3 maintains 8051 compatibility. This bit has no effect on instruction cycle timing.
0: Timer 0 uses a divide-by-12 of the crystal frequency.
1: Timer 0 uses a divide-by-4 of the crystal frequency.
MD2, MD1, MD0 Stretch MOVX Select. These bits select the time by which external MOVX cycles are to be stretched in the
bits 2−0 standard 8051 core. Since the MSC120x does not allow external memory access, these bits should be set to
000b to allow for the fastest Flash Data Memory access.
MXWS MOVX Write Select. This allows writing to the internal Flash Program Memory.
bit 0 0: No writes are allowed to the internal Flash Program Memory.
1: Writing is allowed to the internal Flash Program Memory, unless PML or RSL (HCR0, CADDR 3Fh) are set.
50
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
Port 1 (P1)
7 6 5 4 3 2 1 0 Reset Value
P1.7 P1.6 P1.5 P1.4 P1.3 P1.2 P1.1 P1.0
SFR 90h FFh
INT5 INT4 INT3 INT2/SS DIN DOUT PROG
P1.7−0 General-Purpose I/O Port 1. This register functions as a general-purpose I/O port. In addition, all the pins have an
bits 7−0 alternative function listed below. Each of the functions is controlled by several other SFRs. The associated Port 1
latch bit must contain a logic ‘1’ before the pin can be used in its alternate function capacity. To use the alternate
function, set the appropriate mode in P1DDRL (SFR AEh), P1DDRH (SFR AFh).
INT5 External Interrupt 5. A falling edge on this pin will cause an external interrupt 5 if enabled.
bit 7
INT4 External Interrupt 4. A rising edge on this pin will cause an external interrupt 4 if enabled.
bit 6
INT3 External Interrupt 3. A falling edge on this pin will cause an external interrupt 3 if enabled.
bit 5
INT2/SS External Interrupt 2. A rising edge on this pin will cause an external interrupt 2 if enabled. This pin can be used as
bit 4 slave select (SS) in SPI slave mode.
DIN Serial Data In. This pin receives serial data in SPI and I2C modes (in I2C mode, this pin should be configured as an
bit 3 input) or standard 8051.
DOUT Serial Data Out. This pin transmits serial data in SPI and I2C modes (in I2C mode, this pin should be configured as
bit 2 an open drain) or standard 8051.
PROG Program Mode. When this pin is pulled low at power-up, the device enters Serial Programming mode (refer to
bit 0 Figure 2).
IE5 External Interrupt 5 Flag. This bit will be set when a falling edge is detected on INT5. This bit must be cleared
bit 7 manually by software. Setting this bit in software will cause an interrupt if enabled.
IE4 External Interrupt 4 Flag. This bit will be set when a rising edge is detected on INT4. This bit must be cleared
bit 6 manually by software. Setting this bit in software will cause an interrupt if enabled.
IE3 External Interrupt 3 Flag. This bit will be set when a falling edge is detected on INT3. This bit must be cleared
bit 5 manually by software. Setting this bit in software will cause an interrupt if enabled.
IE2 External Interrupt 2 Flag. This bit will be set when a rising edge is detected on INT2. This bit must be cleared
bit 4 manually by software. Setting this bit in software will cause an interrupt if enabled.
51
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
CADDR Configuration Address. This register supplies the address for reading bytes in the 128 bytes of Flash Configuration
bits 7−0 Memory. It is recommended that faddr_data_read be used when accessing Configuration memory.This register is
also used as the address for the sfr_read and sfr_write routines, so it must be set prior to their use.
CAUTION: If this register is written to while executing from Flash Memory, the CDATA register will be incorrect.
CDATA Configuration Data. This register will contain the data in the 128 bytes of Flash Configuration Memory that
bits 7−0 is located at the last written address in the CADDR register. This is a read-only register.
SM0−2 Serial Port 0 Mode. These bits control the mode of serial Port 0. Modes 1, 2, and 3 have 1 start and 1 stop bit in
bits 7−5 addition to the 8 or 9 data bits.
MODE SM0 SM1 SM2 FUNCTION LENGTH PERIOD
0 0 0 0 Synchronous 8 bits 12 pCLK(1)
0 0 0 1 Synchronous 8 bits 4 pCLK(1)
1 0 1 0 Asynchronous 10 bits Timer 1 Baud Rate Equation
1 0 1 1 Asynchronous−Valid Stop Required(2) 10 bits Timer 1 Baud Rate Equation
2 1 0 0 Asynchronous 11 bits 64 pCLK(1) (SMOD = 0)
32 pCLK(1) (SMOD = 1)
2 1 0 1 Asynchronous with Multiprocessor Communication 11 bits 64 pCLK(1) (SMOD = 0)
32 pCLK(1) (SMOD = 1)
3 1 1 0 Asynchronous 11 bits Timer 1 Baud Rate Equation
3 1 1 1 Asynchronous with Multiprocessor Communication(3) 11 bits Timer 1 Baud Rate Equation
(1) pCLK will be equal to tCLK, except that pCLK will stop for Idle mode.
(2) RI_0 will only be activated when a valid STOP is received.
(3) RI_0 will not be activated if bit 9 = 0.
REN_0 Receive Enable. This bit enables/disables the serial Port 0 received shift register.
bit 4 0: Serial Port 0 reception disabled.
1: Serial Port 0 received enabled (modes 1, 2, and 3). Initiate synchronous reception (mode 0).
TB8_0 9th Transmission Bit State. This bit defines the state of the 9th transmission bit in serial Port 0 modes 2 and 3.
bit 3
RB8_0 9th Received Bit State. This bit identifies the state of the 9th reception bit of received data in serial Port 0 modes
bit 2 2 and 3. In serial port mode 1, when SM2_0 = 0, RB8_0 is the state of the stop bit. RB8_0 is not used in mode 0.
TI_0 Transmitter Interrupt Flag. This bit indicates that data in the serial Port 0 buffer has been completely shifted out. In serial
bit 1 port mode 0, TI_0 is set at the end of the 8th data bit. In all other modes, this bit is set at the end of the last data bit.
This bit must be manually cleared by software.
RI_0 Receiver Interrupt Flag. This bit indicates that a byte of data has been received in the serial Port 0 buffer. In serial
bit 0 port mode 0, RI_0 is set at the end of the 8th bit. In serial port mode 1, RI_0 is set after the last sample of the incoming
stop bit subject to the state of SM2_0. In modes 2 and 3, RI_0 is set after the last sample of RB8_0. This bit must
be manually cleared by software.
52
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
SBUF0 Serial Data Buffer 0. Data for Serial Port 0 is read from or written to this location. The serial transmit and receive
bits 7−0 buffers are separate registers, but both are addressed at this location.
53
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
SPIDATA SPI Data. Data for SPI is read from or written to this location. The SPI transmit and receive buffers are
bits 7−0 separate registers, but both are addressed at this location. Read to clear the receive interrupt and write to clear the
transmit interrupt.
I2CDATA I2C Data. Data for I2C is read from or written to this location. The I2C transmit and receive buffers are
bits 7−0 separate registers, but both are addressed at this location.
54
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
Interrupts are enabled by EICON.4 (SFR D8h). The other interrupts are controlled by the IE and EIE registers.
ALVDIP Analog Low Voltage Detect Interrupt Poll (before IRQ masking).
bit 1 0 = Analog low voltage detect interrupt poll inactive (AVDD > ALVD threshold; ALVD threshold set in LVDCON, E7h)
1 = Analog low voltage detect interrupt poll active (AVDD < ALVD threshold; ALVD threshold set in LVDCON, E7h)
PAI Pending Auxiliary Interrupt Register. The results of this register can be used as an index to vector to the
bits 3−0 appropriate interrupt routine. All of these interrupts vector through address 0033h.
55
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
Interrupts are enabled by EICON.4 (SFR D8h). The other interrupts are controlled by the IE and EIE registers.
ESEC Enable Second System Timer Interrupt (lowest priority auxiliary interrupt).
bit 7 Write: Set mask bit for this interrupt; 0 = masked, 1 = enabled.
Read: Second Timer Interrupt mask.
56
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
SEC Second System Timer Interrupt Status Flag (lowest priority AI).
bit 7 0: SEC interrupt cleared or masked.
1: SEC Interrupt active (it is cleared by reading SECINT, SFR F9h).
NOTE: If an interrupt is masked, the status can be read in AIPOL (SFR A4h).
57
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
EA Global Interrupt Enable. This bit controls the global masking of all interrupts except those in AIE (SFR A6h).
bit 7 0: Disable interrupt sources. This bit overrides individual interrupt mask settings for this register.
1: Enable all individual interrupt masks. Individual interrupts in this register will occur if enabled.
ES0 Enable Serial Port 0 Interrupt. This bit controls the masking of the serial Port 0 interrupt.
bit 4 0: Disable all serial Port 0 interrupts.
1: Enable interrupt requests generated by the RI_0 (SCON0.0, SFR 98h) or TI_0 (SCON0.1, SFR 98h) flags.
ET1 Enable Timer 1 Interrupt. This bit controls the masking of the Timer 1 interrupt.
bit 3 0: Disable Timer 1 interrupt.
1: Enable interrupt requests generated by the TF1 flag (TCON.7, SFR 88h).
EX1 Enable External Interrupt 1. This bit controls the masking of external interrupt 1.
bit 2 0: Disable external interrupt 1.
1: Enable interrupt requests generated by the INT1 pin.
ET0 Enable Timer 0 Interrupt. This bit controls the masking of the Timer 0 interrupt.
bit 1 0: Disable all Timer 0 interrupts.
1: Enable interrupt requests generated by the TF0 flag (TCON.5, SFR 88h).
EX0 Enable External Interrupt 0. This bit controls the masking of external interrupt 0.
bit 0 0: Disable external interrupt 0.
1: Enable interrupt requests generated by the INT0 pin.
58
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
59
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
60
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
Port 3 (P3)
7 6 5 4 3 2 1 0 Reset Value
P3.7 P3.6 P3.5 P3.4 P3.3 P3.2 P3.1 P3.0
SFR B0h FFh
SCK/SCL/CLKS T1 T0 INT1 INT0 TXD0 RXD0
P3.7−0 General-Purpose I/O Port 3. This register functions as a general-purpose I/O port. In addition, all the pins have an
bits 7−0 alternative function listed below. Each of the functions is controlled by several other SFRs. The associated Port 3
latch bit must contain a logic ‘1’ before the pin can be used in its alternate function capacity.
INT1 External Interrupt 1. A falling edge/low level on this pin will cause an external interrupt 1 if enabled.
bit 3
INT0 External Interrupt 0. A falling edge/low level on this pin will cause an external interrupt 0 if enabled.
bit 2
TXD0 Serial Port 0 Transmit. This pin transmits the serial Port 0 data in serial port modes 1, 2, 3, and emits the
bit 1 synchronizing clock in serial port mode 0.
RXD0 Serial Port 0 Receive. This pin receives the serial Port 0 data in serial port modes 1, 2, 3, and is a bidirectional data
bit 0 transfer pin in serial port mode 0.
61
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
62
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
NOTE: Port 3.7 also controlled by EA and Memory Access Control HCR1.1.
NOTE: Port 3.6 also controlled by EA and Memory Access Control HCR1.1.
63
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
IDAC
7 6 5 4 3 2 1 0 Reset Value
SFR B5h MSB LSB 00h
PS0 Serial Port 0 Interrupt. This bit controls the priority of the serial Port 0 interrupt.
bit 4 0 = Serial Port 0 priority is determined by the natural priority order.
1 = Serial Port 0 is a high-priority interrupt.
PT1 Timer 1 Interrupt. This bit controls the priority of the Timer 1 interrupt.
bit 3 0 = Timer 1 priority is determined by the natural priority order.
1 = Timer 1 priority is a high-priority interrupt.
PX1 External Interrupt 1. This bit controls the priority of external interrupt 1.
bit 2 0 = External interrupt 1 priority is determined by the natural priority order.
1 = External interrupt 1 is a high-priority interrupt.
PT0 Timer 0 Interrupt. This bit controls the priority of the Timer 0 interrupt.
bit 1 0 = Timer 0 priority is determined by the natural priority order.
1 = Timer 0 priority is a high-priority interrupt.
PX0 External Interrupt 0. This bit controls the priority of external interrupt 0.
bit 0 0 = External interrupt 0 priority is determined by the natural priority order.
1 = External interrupt 0 is a high-priority interrupt.
Auxiliary interrupts will wake up from Idle mode. They are enabled with EAI (EICON.5).
EWUWDT Enable Wake Up Watchdog Timer. Wake using watchdog timer interrupt.
bit 2 0 = Do not wake up on watchdog timer interrupt.
1 = Wake up on watchdog timer interrupt.
64
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
NOTE: Changing the SYSCLK registers affects all internal clocks, including the ADC clock.
Read:
DIVMOD DIVIDE MODE STATUS
00 No divide
01 Divider is in Immediate mode
10 Divider is in Delay mode
11 Manual mode
65
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
CY Carry Flag. This bit is set when the last arithmetic operation resulted in a carry (during addition) or a borrow (during
bit 7 subtraction). Otherwise, it is cleared to ‘0’ by all arithmetic operations.
AC Auxiliary Carry Flag. This bit is set to ‘1’ if the last arithmetic operation resulted in a carry into (during addition), or
bit 6 a borrow (during subtraction) from the high order nibble. Otherwise, it is cleared to ‘0’ by all arithmetic operations.
RS1, RS0 Register Bank Select 1−0. These bits select which register bank is addressed during register accesses.
bits 4−3
RS1 RS0 REGISTER BANK ADDRESS
0 0 0 00h − 07h
0 1 1 08h − 0Fh
1 0 2 10h − 17h
1 1 3 18h − 1Fh
OV Overflow Flag. This bit is set to ‘1’ if the last arithmetic operation resulted in a carry (addition), borrow (subtraction),
bit 2 or overflow (multiply or divide). Otherwise, it is cleared to ‘0’ by all arithmetic operations.
P Parity Flag. This bit is set to ‘1’ if the modulo-2 sum of the 8 bits of the accumulator is 1 (odd parity), and cleared to
bit 0 ‘0’ on even parity.
66
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
OCL ADC Offset Calibration Low Byte. This is the low byte of the 24-bit word that contains the ADC offset
bits 7−0 calibration. This value is written by the device after performing a calibration. This register is read/writable, so it can
be used for setting calibration values independent of the hardware-generated calibration values.
OCM ADC Offset Calibration Middle Byte. This is the middle byte of the 24-bit word that contains the ADC offset
bits 7−0 calibration. This value is written by the device after performing a calibration. This register is read/writable, so it can
be used for setting calibration values independent of the hardware-generated calibration values.
OCH ADC Offset Calibration High Byte. This is the high byte of the 24-bit word that contains the ADC offset
bits 7−0 calibration. This value is written by the device after performing a calibration. This register is read/writable, so it can
be used for setting calibration values independent of the hardware-generated calibration values.
GCL ADC Gain Calibration Low Byte. This is the low byte of the 24-bit word that contains the ADC gain
bits 7−0 calibration. This value is written by the device after performing a calibration. This register is read/writable, so it can
be used for setting calibration values independent of the hardware-generated calibration values.
GCM ADC Gain Calibration Middle Byte. This is the middle byte of the 24-bit word that contains the ADC gain
bits 7−0 calibration. This value is written by the device after performing a calibration. This register is read/writable, so it can
be used for setting calibration values independent of the hardware-generated calibration values.
67
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
GCH ADC Gain Calibration High Byte. This is the high byte of the 24-bit word that contains the ADC gain
bits 7−0 calibration. This value is written by the device after performing a calibration. This register is read/writable, so it can
be used for setting calibration values independent of the hardware-generated calibration values.
INP3−0 Input Multiplexer Positive Input. This selects the positive signal input.
bits 7−4
INP3 INP2 INP1 INP0 POSITIVE INPUT
0 0 0 0 AIN0 (default)
0 0 0 1 AIN1
0 0 1 0 AIN2
0 0 1 1 AIN3
0 1 0 0 AIN4
0 1 0 1 AIN5
0 1 1 0 AIN6 (MSC1200 only; for the MSC1201/02, this pin is internally tied to REFIN−)
0 1 1 1 AIN7 (MSC1200 only; for the MSC1201/02, this pin is internally tied to REFIN−)
1 0 0 0 AINCOM
1 1 1 1 Temperature Sensor (requires ADMUX = FFh)
INN3−0 Input Multiplexer Negative Input. This selects the negative signal input.
bits 3−0
INN3 INN2 INN1 INN0 NEGATIVE INPUT
0 0 0 0 AIN0
0 0 0 1 AIN1 (default)
0 0 1 0 AIN2
0 0 1 1 AIN3
0 1 0 0 AIN4
0 1 0 1 AIN5
0 1 1 0 AIN6 (MSC1200 Only)
0 1 1 1 AIN7 (MSC1200 Only)
1 0 0 0 AINCOM
1 1 1 1 Temperature Sensor (requires ADMUX = FFh)
68
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
EAI Enable Auxiliary Interrupt. The Auxiliary Interrupt accesses nine different interrupts which are masked and
bit 5 identified by SFR registers PAI (SFR A5h), AIE (SFR A6h), and AISTAT (SFR A7h).
0 = Auxiliary Interrupt disabled (default).
1 = Auxiliary Interrupt enabled.
AI Auxiliary Interrupt Flag. AI must be cleared by software before exiting the interrupt service routine, after the source
bit 4 of the interrupt is cleared. Otherwise, the interrupt occurs again. Setting AI in software generates an Auxiliary
Interrupt, if enabled.
0 = No Auxiliary Interrupt detected (default).
1 = Auxiliary Interrupt detected.
WDTI Watchdog Timer Interrupt Flag. WDTI must be cleared by software before exiting the interrupt service routine.
bit 3 Otherwise, the interrupt occurs again. Setting WDTI in software generates a watchdog time interrupt, if enabled. The
Watchdog timer can generate an interrupt or reset. The interrupt is available only if the reset action is disabled in
HCR0.
0 = No Watchdog Timer Interrupt Detected (default).
1 = Watchdog Timer Interrupt Detected.
ADRESL ADC Results Low Byte. This is the low byte of the ADC results.
bits 7−0 Reading from this register clears the ADC interrupt; however, AI in EICON (SFR D8) must also be cleared.
ADRESM ADC Results Middle Byte. This is the middle byte of the ADC results for the MSC1200/01 and the most significant
byte for the MSC1202.
bits 7−0
ADRESH ADC Results High Byte. This is the high byte and most significant byte of the ADC results for the MSC1200/01.
bits 7−0 This is a sign-extended (Bipolar mode) or zero-padded (Unipolar mode) byte for the MSC1202 (that is, all 0s for
positive ADC or unipolar results and all 1s for negative ADC results).
69
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
BOD Burnout Detect. When enabled, this connects a positive current source to the positive channel and a negative
bit 6 current source to the negative channel. If the channel is open circuit, then the ADC results will be full-scale (buffer
must be enabled).
0 = Burnout Current Sources Off (default).
1 = Burnout Current Sources On.
EVREF Enable Internal Voltage Reference. If an external voltage is used, the internal voltage reference should be disabled.
bit 5 0 = Internal Voltage Reference Off for external reference.
1 = Internal Voltage Reference On (default). Note that in this mode, REFIN− must be connected to AGND.
VREFH Voltage Reference High Select. The internal voltage reference can be selected to be 2.5V or 1.25V.
bit 4 0 = REFOUT/REF IN+ is 1.25V.
1 = REFOUT/REF IN+ is 2.5V (default).
EBUF Enable Buffer. Enables the input buffer to provide higher input impedance but limits the input voltage range and
bit 3 dissipates more power.
0 = Buffer disabled (default).
1 = Buffer enabled. Input signal limited to AVDD − 1.5V.
PGA2−0 Programmable Gain Amplifier. Sets the gain for the PGA from 1 to 128.
bits 2−0
PGA2 PGA1 PGA0 GAIN
0 0 0 1 (default)
0 0 1 2
0 1 0 4
0 1 1 8
1 0 0 16
1 0 1 32
1 1 0 64
1 1 1 128
70
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
OF_UF Overflow/Underflow. If this bit is set, the data in the Summation register is invalid; either an overflow or underflow
bit 6 occurred. This bit is cleared by writing a ‘0’ to it.
SM1−0 Settling Mode. Selects the type of filter or auto-select which defines the digital filter settling characteristics.
bits 5−4
SM1 SM0 SETTLING MODE
0 0 Auto
0 1 Fast Settling Filter
1 0 Sinc2 Filter
1 1 Sinc3 Filter
CAL2−0 Calibration Mode Control Bits. Writing to this register initiates calibration.
bits 2−0
CAL2 CAL1 CAL0 CALIBRATION MODE
0 0 0 No Calibration (default)
0 0 1 Self-Calibration, Offset and Gain
0 1 0 Self-Calibration, Offset only
0 1 1 Self-Calibration, Gain only
1 0 0 System Calibration, Offset only (requires external signal)
1 0 1 System Calibration, Gain only (requires external signal)
1 1 0 Reserved
1 1 1 Reserved
NOTE: Read value—000b.
71
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
Accumulator (A or ACC)
7 6 5 4 3 2 1 0 Reset Value
SFR E0h ACC.7 ACC.6 ACC.5 ACC.4 ACC.3 ACC.2 ACC.1 ACC.0 00h
ACC.7−0 Accumulator. This register serves as the accumulator for arithmetic and logic operations.
bits 7−0
72
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
The Summation register is powered down when the ADC is powered down. If all zeroes are written to this register, the 32-bit
SUMR3−0 registers will be cleared. The Summation registers will do sign-extend if Bipolar Mode is selected in ADCON1.
SCNT2−0 Summation Count. When the summation is complete an interrupt will be generated unless masked. Reading the
bits 5−3 SUMR0 register clears the interrupt.
73
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
Summation 0 (SUMR0)
7 6 5 4 3 2 1 0 Reset Value
SFR E2h LSB 00h
SUMR0 Summation 0. This is the least significant byte of the 32-bit summation register, or bits 0 to 7.
bits 7−0 Write: Will cause values in SUMR3−0 to be added to the summation register.
Read: Will clear the Summation Interrupt.
Summation 1 (SUMR1)
7 6 5 4 3 2 1 0 Reset Value
SFR E3h 00h
SUMR1 Summation 1. This is the most significant byte of the lowest 16 bits of the summation register, or bits 8−15.
bits 7−0
Summation 2 (SUMR2)
7 6 5 4 3 2 1 0 Reset Value
SFR E4h 00h
SUMR2 Summation 2. This is the most significant byte of the lowest 24 bits of the summation register, or bits 16−23.
bits 7−0
Summation 3 (SUMR3)
7 6 5 4 3 2 1 0 Reset Value
SFR E5h MSB 00h
SUMR3 Summation 3. This is the most significant byte of the 32-bit summation register, or bits 24−31.
bits 7−0
ODAC Offset DAC. This register will shift the input by up to half of the ADC full-scale input range. The Offset DAC
bits 7−0 value is summed into the ADC prior to conversion. Writing 00h or 80h to ODAC turns off the Offset DAC. The offset
DAC should be cleared prior to calibration, since the offset DAC analog output is applied directly to the ADC input.
NOTE: ODAC cannot be used to offset the analog inputs so that the buffer can be used for signals within 50mV of AGND.
74
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
EWDI Enable Watchdog Interrupt. This bit enables/disables the watchdog interrupt. The Watchdog timer is enabled by
bit 4 the WDTCON (SFR FFh) and PDCON (SFR F1h) registers.
0 = Disable the Watchdog Interrupt
1 = Enable Interrupt Request Generated by the Watchdog Timer
75
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
76
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
FER3−0 Set Erase. Flash Erase Time = (1 + FER) • (MSEC + 1) • tCLK. This can be broken into multiple, shorter erase times.
bits 7−4 For more Information, see Application Report SBAA137, Incremental Flash Memory Page Erase, available for
download from www.ti.com.
Industrial temperature range: 11ms
Commercial temperature range: 5ms
FWR3−0 Set Write. Set Flash Write Time = (1 + FWR) • (USEC + 1) • 5 • tCLK. Total writing time will be longer. For more
bits 3−0 Information, see Application Report SBAA087, In-Application Flash Programming, available for download from
www.ti.com.
Range: 30µs to 40µs.
B Register (B)
7 6 5 4 3 2 1 0 Reset Value
SFR F0h 00h
B.7−0 B Register. This register serves as a second accumulator for certain arithmetic operations.
bits 7−0
77
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
Turning peripheral modules off puts the MSC120x in the lowest power mode.
78
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
PSEN2−0 PSEN Mode Select. Defines the output on P3.6 in UAM or SFPM.
bits 7−3 00000: General-purpose I/O (default)
00001: SYSCLK
00011: Internal PSEN (refer to Figure 5 for timing)
00101: Internal ALE (refer to Figure 5 for timing)
00111: fOSC (buffered XIN oscillator clock)
01001: Memory WR (MOVX write)
01011: T0 Out (overflow)(1)
01101: T1 Out (overflow)(1)
01111: fMOD(2)
10001: SYSCLK/2 (toggles on rising edge)(2)
10011: Internal PSEN/2(2)
10101: Internal ALE/2(2)
10111: fOSC(2)
11001: Memory WR/2 (MOVX write)(2)
11011: T0 Out/2 (overflow)(2)
11101: T1 Out/2 (overflow)(2)
11111: fMOD/2(2)
(1) One period of these signals equal to tCLK.
(2) Duty cycle is 50%.
79
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
CLKSTAT2−0 Active Clock Status (read-only). Derived from HCR2 setting; refer to Table 3.
bits 7−5 000: Reserved
001: Reserved
010: Reserved
011: External Clock Mode
100: PLL High-Frequency (HF) Mode (must read PLLLOCK to determine active clock status)
101: PLL Low-Frequency (LF) Mode (must read PLLLOCK to determine active clock status)
110: Internal Oscillator High-Frequency (HF) Mode
111: Internal Oscillator Low-Frequency (LF) Mode
PLL9−8 PLL Counter Value Most Significant 2 Bits (refer to PLLL, SFR F4h).
bits 1−0
FREQ6−0 Clock Frequency − 1. This value + 1 divides the system clock to create the ADC clock.
bits 6−0 f CLK fOSC .
fACLK + , where fCLK +
ACLK ) 1 SYSCLK divider
f ACLK
fMOD +
64
f MOD
ADC Data Rate + fDATA +
Decimation Ratio
RSTREQ Reset Request. Setting this bit to ‘1’ and then clearing to ‘0’ will generate a system reset.
bit 0
80
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
PWDI Watchdog Interrupt Priority. This bit controls the priority of the watchdog interrupt.
bit 4 0 = The watchdog interrupt is low priority.
1 = The watchdog interrupt is high priority.
PX5 External Interrupt 5 Priority. This bit controls the priority of external interrupt 5.
bit 3 0 = External interrupt 5 is low priority.
1 = External interrupt 5 is high priority.
PX4 External Interrupt 4 Priority. This bit controls the priority of external interrupt 4.
bit 2 0 = External interrupt 4 is low priority.
1 = External interrupt 4 is high priority.
PX3 External Interrupt 3 Priority. This bit controls the priority of external interrupt 3.
bit 1 0 = External interrupt 3 is low priority.
1 = External interrupt 3 is high priority.
PX2 External Interrupt 2 Priority. This bit controls the priority of external interrupt 2.
bit 0 0 = External interrupt 2 is low priority.
1 = External interrupt 2 is high priority.
This system clock is divided by the value of the 16-bit register MSECH:MSECL. Then, that 1ms timer tick is divided by the
register HMSEC which provides the 100ms signal used by this seconds timer. Therefore, this seconds timer can generate
an interrupt which occurs from 100ms to 12.8 seconds. Reading this register will clear the Seconds Interrupt. This Interrupt
can be monitored in the AIE register.
WRT Write Control. Determines whether to write the value immediately or wait until the current count is finished.
bit 7 Read = 0.
0 = Delay Write Operation. The SEC value is loaded when the current count expires.
1 = Write Immediately. The counter is loaded once the CPU completes the write operation.
SECINT6−0 Seconds Count. Normal operation would use 100ms as the clock interval.
bits 6−0 Seconds Interrupt = (1 + SEC) • (HMSEC + 1) • (MSEC + 1) • tCLK.
81
#$
#$
#$$ www.ti.com
SBAS317E − APRIL 2004 − REVISED MAY 2006
The clock used for this timer is the 1ms clock, which results from dividing the system clock by the values in registers
MSECH:MSECL. Reading this register is necessary for clearing the interrupt; however, AI in EICON (SFR D8h) must also
be cleared.
WRT Write Control. Determines whether to write the value immediately or wait until the current count is finished.
bit 7 Read = 0.
0 = Delay Write Operation. The MSINT value is loaded when the current count expires.
1 = Write Immediately. The MSINT counter is loaded once the CPU completes the write operation.
MSINT6−0 Milliseconds Count. Normal operation would use 1ms as the clock interval.
bits 6−0 MS Interrupt Interval = (1 + MSINT) • (MSEC + 1) • tCLK
FREQ5−0 Clock Frequency − 1. This value + 1 divides the system clock to create a 1µs Clock.
bits 5−0 USEC = CLK/(FREQ + 1). This clock is used to set Flash write time. See FTCON (SFR EFh).
MSECL7−0 One Millisecond Timer Low Byte. This value in combination with the next register is used to create a 1ms clock.
bits 7−0 1ms = (MSECH • 256 + MSECL + 1) • tCLK. This clock is used to set Flash erase time. See FTCON (SFR EFh).
MSECH7−0 One Millisecond Timer High Byte. This value in combination with the previous register is used to create a 1ms clock.
bits 7−0 1ms = (MSECH • 256 + MSECL + 1) • tCLK.
WRT Write Control. Determines whether to write the value immediately or wait until the current count is finished.
Read = 0.
HMSEC7−0 One Hundred Millisecond Timer. This clock divides the 1ms clock to create a 100ms clock.
bits 7−0 100ms = (MSECH • 256 + MSECL + 1) • (HMSEC + 1) • tCLK.
82
#$
#$
www.ti.com #$$
SBAS317E − APRIL 2004 − REVISED MAY 2006
83
PACKAGE OPTION ADDENDUM
www.ti.com 10-Dec-2020
PACKAGING INFORMATION
Orderable Device Status Package Type Package Pins Package Eco Plan Lead finish/ MSL Peak Temp Op Temp (°C) Device Marking Samples
(1) Drawing Qty (2) Ball material (3) (4/5)
(6)
MSC1200Y2PFBT ACTIVE TQFP PFB 48 250 RoHS & Green NIPDAU Level-2-260C-1 YEAR -40 to 125 MSC1200Y2
MSC1200Y3PFBT ACTIVE TQFP PFB 48 250 RoHS & Green NIPDAU Level-2-260C-1 YEAR -40 to 125 MSC1200Y3
MSC1202Y2RHHT ACTIVE VQFN RHH 36 250 RoHS & Green NIPDAU Level-2-260C-1 YEAR -40 to 125 MSC
1202Y2
MSC1202Y2RHHTG4 ACTIVE VQFN RHH 36 250 RoHS & Green NIPDAU Level-2-260C-1 YEAR -40 to 125 MSC
1202Y2
MSC1202Y3RHHR ACTIVE VQFN RHH 36 2500 RoHS & Green NIPDAU Level-2-260C-1 YEAR -40 to 125 MSC
1202Y3
MSC1202Y3RHHT ACTIVE VQFN RHH 36 250 RoHS & Green NIPDAU Level-2-260C-1 YEAR -40 to 125 MSC
1202Y3
(1)
The marketing status values are defined as follows:
ACTIVE: Product device recommended for new designs.
LIFEBUY: TI has announced that the device will be discontinued, and a lifetime-buy period is in effect.
NRND: Not recommended for new designs. Device is in production to support existing customers, but TI does not recommend using this part in a new design.
PREVIEW: Device has been announced but is not in production. Samples may or may not be available.
OBSOLETE: TI has discontinued the production of the device.
(2)
RoHS: TI defines "RoHS" to mean semiconductor products that are compliant with the current EU RoHS requirements for all 10 RoHS substances, including the requirement that RoHS substance
do not exceed 0.1% by weight in homogeneous materials. Where designed to be soldered at high temperatures, "RoHS" products are suitable for use in specified lead-free processes. TI may
reference these types of products as "Pb-Free".
RoHS Exempt: TI defines "RoHS Exempt" to mean products that contain lead but are compliant with EU RoHS pursuant to a specific EU RoHS exemption.
Green: TI defines "Green" to mean the content of Chlorine (Cl) and Bromine (Br) based flame retardants meet JS709B low halogen requirements of <=1000ppm threshold. Antimony trioxide based
flame retardants must also meet the <=1000ppm threshold requirement.
(3)
MSL, Peak Temp. - The Moisture Sensitivity Level rating according to the JEDEC industry standard classifications, and peak solder temperature.
(4)
There may be additional marking, which relates to the logo, the lot trace code information, or the environmental category on the device.
(5)
Multiple Device Markings will be inside parentheses. Only one Device Marking contained in parentheses and separated by a "~" will appear on a device. If a line is indented then it is a continuation
of the previous line and the two combined represent the entire Device Marking for that device.
Addendum-Page 1
PACKAGE OPTION ADDENDUM
www.ti.com 10-Dec-2020
(6)
Lead finish/Ball material - Orderable Devices may have multiple material finish options. Finish options are separated by a vertical ruled line. Lead finish/Ball material values may wrap to two
lines if the finish value exceeds the maximum column width.
Important Information and Disclaimer:The information provided on this page represents TI's knowledge and belief as of the date that it is provided. TI bases its knowledge and belief on information
provided by third parties, and makes no representation or warranty as to the accuracy of such information. Efforts are underway to better integrate information from third parties. TI has taken and
continues to take reasonable steps to provide representative and accurate information but may not have conducted destructive testing or chemical analysis on incoming materials and chemicals.
TI and TI suppliers consider certain information to be proprietary, and thus CAS numbers and other limited information may not be available for release.
In no event shall TI's liability arising out of such information exceed the total purchase price of the TI part(s) at issue in this document sold by TI to Customer on an annual basis.
Addendum-Page 2
PACKAGE MATERIALS INFORMATION
www.ti.com 30-Dec-2020
Pack Materials-Page 1
PACKAGE MATERIALS INFORMATION
www.ti.com 30-Dec-2020
Pack Materials-Page 2
GENERIC PACKAGE VIEW
RHH 36 VQFN - 1 mm max height
6 x 6, 0.5 mm pitch PLASTIC QUAD FLATPACK - NO LEAD
This image is a representation of the package family, actual package may vary.
Refer to the product data sheet for package details.
4225440/A
www.ti.com
PACKAGE OUTLINE
RHH0036D SCALE 2.300
VQFN - 1 mm max height
PLASTIC QUAD FLATPACK - NO LEAD
6.1
B A
5.9
6.1
5.9
1.0
0.8
SEATING PLANE
0.05 0.08 C
4.2 0.1
0.00
2X 4
SYMM (0.2) TYP
EXPOSED
THERMAL PAD 10 18
9
19
SYMM 37
2X 4
32X 0.5
1 27
0.30
PIN 1 ID 36X
36 28 0.18
0.1 C A B
0.65
36X 0.05
0.45
4225415/A 10/2019
NOTES:
1. All linear dimensions are in millimeters. Any dimensions in parenthesis are for reference only. Dimensioning and tolerancing
per ASME Y14.5M.
2. This drawing is subject to change without notice.
3. The package thermal pad must be soldered to the printed circuit board for thermal and mechanical performance.
www.ti.com
EXAMPLE BOARD LAYOUT
RHH0036D VQFN - 1 mm max height
PLASTIC QUAD FLATPACK - NO LEAD
( 4.2)
SYMM
36 28 SEE SOLDER MASK
DETAIL
36X (0.75)
36X (0.24) 1 27
(1.85)
32X (0.5) TYP
(0.69)
SYMM 37 TYP
(5.65)
(R0.05) TYP
( 0.2) TYP
VIA 9 19
10 18
(0.69)
TYP
(1.85) TYP
(5.65)
LAND PATTERN EXAMPLE
EXPOSED METAL SHOWN
SCALE: 15X
0.07 MIN
0.07 MAX ALL AROUND
ALL AROUND
METAL UNDER
METAL EDGE SOLDER MASK
EXPOSED
METAL SOLDER MASK EXPOSED SOLDER MASK
OPENING METAL OPENING
4. This package is designed to be soldered to a thermal pad on the board. For more information, see Texas Instruments literature
number SLUA271 (www.ti.com/lit/slua271).
5. Vias are optional depending on application, refer to device data sheet. If any vias are implemented, refer to their locations shown
on this view. It is recommended that vias under paste be filled, plugged or tented.
www.ti.com
EXAMPLE STENCIL DESIGN
RHH0036D VQFN - 1 mm max height
PLASTIC QUAD FLATPACK - NO LEAD
9X ( 1.18) (1.38)
TYP
36 28
36X (0.75)
36X (0.24) 1 27
32X (0.5)
(1.38) TYP
SYMM 37
(5.65)
(R0.05) TYP
9 19
10 18
SYMM
(5.65)
EXPOSED PAD 37
71% PRINTED SOLDER COVERAGE BY AREA UNDER PACKAGE
4225415/A 10/2019
NOTES: (continued)
6. Laser cutting apertures with trapezoidal walls and rounded corners may offer better paste release. IPC-7525 may have alternate
design recommendations.
www.ti.com
MECHANICAL DATA
0,27
0,50 0,08 M
0,17
36 25
37 24
48 13
0,13 NOM
1 12
5,50 TYP
7,20
SQ Gage Plane
6,80
9,20
SQ
8,80 0,25
0,05 MIN 0°– 7°
1,05
0,95
0,75
Seating Plane 0,45
0,08
1,20 MAX
4073176 / B 10/96
TI PROVIDES TECHNICAL AND RELIABILITY DATA (INCLUDING DATASHEETS), DESIGN RESOURCES (INCLUDING REFERENCE
DESIGNS), APPLICATION OR OTHER DESIGN ADVICE, WEB TOOLS, SAFETY INFORMATION, AND OTHER RESOURCES “AS IS”
AND WITH ALL FAULTS, AND DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION ANY
IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF THIRD
PARTY INTELLECTUAL PROPERTY RIGHTS.
These resources are intended for skilled developers designing with TI products. You are solely responsible for (1) selecting the appropriate
TI products for your application, (2) designing, validating and testing your application, and (3) ensuring your application meets applicable
standards, and any other safety, security, or other requirements. These resources are subject to change without notice. TI grants you
permission to use these resources only for development of an application that uses the TI products described in the resource. Other
reproduction and display of these resources is prohibited. No license is granted to any other TI intellectual property right or to any third
party intellectual property right. TI disclaims responsibility for, and you will fully indemnify TI and its representatives against, any claims,
damages, costs, losses, and liabilities arising out of your use of these resources.
TI’s products are provided subject to TI’s Terms of Sale (www.ti.com/legal/termsofsale.html) or other applicable terms available either on
ti.com or provided in conjunction with such TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable
warranties or warranty disclaimers for TI products.
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2020, Texas Instruments Incorporated