ST6215CB6/XXX [STMICROELECTRONICS]
8-BIT, MROM, 8MHz, MICROCONTROLLER, PDIP28, 0.600 INCH, PLASTIC, DIP-28;型号: | ST6215CB6/XXX |
厂家: | ST |
描述: | 8-BIT, MROM, 8MHz, MICROCONTROLLER, PDIP28, 0.600 INCH, PLASTIC, DIP-28 时钟 微控制器 光电二极管 外围集成电路 |
文件: | 总105页 (文件大小:1505K) |
中文: | 中文翻译 | 下载: | 下载PDF数据表文档文件 |
ST6215C ST6225C
8-bit MCUs with A/D converter,
two timers, oscillator safeguard & safe reset
■ Memories
– 2K or 4K bytes Program memory (OTP,
EPROM, FASTROM or ROM) with read-out
protection
– 64 bytes RAM
■ Clock, Reset and Supply Management
– Enhanced reset system
– Low Voltage Detector (LVD) for Safe Reset
PDIP28
S028
– Clock sources: crystal/ceramic resonator or
RC network, external clock, backup oscillator
(LFAO)
– Oscillator Safeguard (OSG)
– 2 Power Saving Modes: Wait and Stop
■ Interrupt Management
– 4 interrupt vectors plus NMI and RESET
– 20 external interrupt lines (on 2 vectors)
– 1 external non-interrupt line
■ 20 I/O Ports
– 20 multifunctional bidirectional I/O lines
– 16 alternate function lines
– 4 high sink outputs (20mA)
■ 2 Timers
SS0P28
– Configurable watchdog timer
– 8-bit timer/counter with a 7-bit prescaler
■ Analog Peripheral
– 8-bit ADC with 16 input channels
■ Instruction Set
CDIP28W
(See Section 12.5 for Ordering Information)
– 8-bit data manipulation
– 40 basic instructions
– 9 addressing modes
– Bit manipulation
■ Development Tools
– Full hardware/software development package
Device Summary
Features
ST6215C
ST6225C
Program memory - bytes
RAM - bytes
2K
4K
64
3.0V to 6V
Operating Supply
Clock Frequency
Operating Temperature
Packages
8MHz Max
-40°C to +125°C
PDIP28 / SO28 / SSOP28
January 2009
Rev 4
1/105
1
Table of Contents
1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 PIN DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3 MEMORY MAPS, PROGRAMMING MODES AND OPTION BYTES . . . . . . . . . . . . . . . . . . . . . . 9
3.1 MEMORY AND REGISTER MAPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.1.2 Program Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.3 Readout Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.4 Data Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.5 Stack Space . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.6 Data ROM Window Mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.2 PROGRAMMING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.1 Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2.2 EPROM Erasing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.3 OPTION BYTES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 CENTRAL PROCESSING UNIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2 MAIN FEATURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.3 CPU REGISTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5 CLOCKS, SUPPLY AND RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.1 CLOCK SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
5.1.1 Main Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
5.1.2 Oscillator Safeguard (OSG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
5.1.3 Low Frequency Auxiliary Oscillator (LFAO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.1.4 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
5.2 LOW VOLTAGE DETECTOR (LVD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5.3 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3.2 RESET Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.3.3 RESET Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
5.3.4 Watchdog Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.3.5 LVD Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6 INTERRUPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6.1 INTERRUPT RULES AND PRIORITY MANAGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.2 INTERRUPTS AND LOW POWER MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.3 NON MASKABLE INTERRUPT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.4 PERIPHERAL INTERRUPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.5 EXTERNAL INTERRUPTS (I/O PORTS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.5.1 Notes on using External Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
6.6 INTERRUPT HANDLING PROCEDURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.6.1 Interrupt Response Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
6.7 REGISTER DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
7 POWER SAVING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2/105
2
Table of Contents
7.2 WAIT MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
7.3 STOP MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
7.4 NOTES RELATED TO WAIT AND STOP MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.4.1 Exit from Wait and Stop Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
7.4.2 Recommended MCU Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
8 I/O PORTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2 FUNCTIONAL DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2.1 Digital Input Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2.2 Analog Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2.3 Output Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2.4 Alternate Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
8.2.5 Instructions NOT to be used to access Port Data registers (SET, RES, INC and DEC) 40
8.2.6 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
8.3 LOW POWER MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
8.4 INTERRUPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
8.5 REGISTER DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
9 ON-CHIP PERIPHERALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.1 WATCHDOG TIMER (WDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.1.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
9.1.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
9.1.4 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
9.1.5 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
9.1.6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
9.1.7 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
9.2 8-BIT TIMER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
9.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
9.2.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
9.2.3 Counter/Prescaler Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.2.4 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
9.2.5 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
9.2.6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
9.2.7 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
9.3 A/D CONVERTER (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
9.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
9.3.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
9.3.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
9.3.4 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
9.3.5 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.3.6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
9.3.7 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
10 INSTRUCTION SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.1 ST6 ARCHITECTURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
10.2 ADDRESSING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
3/105
3
Table of Contents
10.3 INSTRUCTION SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
11 ELECTRICAL CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.1 PARAMETER CONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.1.1Minimum and Maximum Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.1.2Typical Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.1.3Typical Curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.1.4Loading Capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.1.5Pin Input Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.2 ABSOLUTE MAXIMUM RATINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
11.2.1Voltage Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
11.2.2Current Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
11.2.3Thermal Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
11.3 OPERATING CONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
11.3.1General Operating Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
11.3.2Operating Conditions with Low Voltage Detector (LVD) . . . . . . . . . . . . . . . . . . . . . 66
11.4 SUPPLY CURRENT CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
11.4.1RUN Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
11.4.2WAIT Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
11.4.3STOP Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
11.4.4Supply and Clock System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
11.4.5On-Chip Peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
11.5 CLOCK AND TIMING CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
11.5.1General Timings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
11.5.2External Clock Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
11.5.3Crystal and Ceramic Resonator Oscillators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
11.5.4RC Oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
11.5.5Oscillator Safeguard (OSG) and Low Frequency Auxiliary Oscillator (LFAO) . . . . . 76
11.6 MEMORY CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
11.6.1RAM and Hardware Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
11.6.2EPROM Program Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
11.7 EMC CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
11.7.1Functional EMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
11.7.2Absolute Electrical Sensitivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
11.7.3ESD Pin Protection Strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
11.8 I/O PORT PIN CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.8.1General Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
11.8.2Output Driving Current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
11.9 CONTROL PIN CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
11.9.1Asynchronous RESET Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
11.9.2NMI Pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
11.10 TIMER PERIPHERAL CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.10.1Watchdog Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.10.28-Bit Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.11 8-BIT ADC CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
12 GENERAL INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
12.1 PACKAGE MECHANICAL DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
4/105
1
Table of Contents
12.2 THERMAL CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
12.3 ECOPACK INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
12.4 PACKAGE/SOCKET FOOTPRINT PROPOSAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
12.5 ORDERING INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
12.6 TRANSFER OF CUSTOMER CODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
12.6.1FASTROM Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
12.6.2ROM Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
13 DEVELOPMENT TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
14 ST6 APPLICATION NOTES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
15 SUMMARY OF CHANGES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
16 TO GET MORE INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
5/105
1
ST6215C ST6225C
1 INTRODUCTION
The ST6215C, 25C devices are low cost members
of the ST62xx 8-bit HCMOS family of microcontrol-
lers, which is targeted at low to medium complexity
applications. All ST62xx devices are based on a
building block approach: a common core is sur-
rounded by a number of on-chip peripherals.
mable option bytes of the OTP/EPROM versions
in the ROM option list (See Section 12.6 on page
97).
The ST62P15C/P25C are the Factory Advanced
Service Technique ROM (FASTROM) versions of
ST62T15C,T25C OTP devices.
The ST62E25C is the erasable EPROM version of
the ST62T15C, T25C devices, which may be used
during the development phase for the ST62T15C,
T25C target devices, as well as the respective
ST6215C, 25C ROM devices.
They offer the same functionality as OTP devices,
but they do not have to be programmed by the
customer (See Section 12 on page 91).
These compact low-cost devices feature a Timer
comprising an 8-bit counter with a 7-bit program-
mable prescaler, an 8-bit A/D Converter with 16
analog inputs and a Digital Watchdog timer, mak-
ing them well suited for a wide range of automo-
tive, appliance and industrial applications.
OTP and EPROM devices are functionally identi-
cal. OTP devices offer all the advantages of user
programmability at low cost, which make them the
ideal choice in a wide range of applications where
frequent code changes, multiple code versions or
last minute programmability are required.
For easy reference, all parametric data is located
in Section 11 on page 63.
The ROM based versions offer the same function-
ality, selecting the options defined in the program-
Figure 1. Block Diagram
8-BIT
A/D CONVERTER
PA0..PA3 (20mA Sink)
PA4..PA7 / Ain
PORT A
V
PP
PB0..PB7 / Ain
PC4..PC7 / Ain
PORT B
PORT C
NMI
INTERRUPTS
DATA ROM
USER
PROGRAM
:
SELECTABLE
MEMORY
(2K or 4K Bytes)
TIMER
TIMER
DATA RAM
64 Bytes
WATCHDOG
TIMER
PC
STACK LEVEL 1
STACK LEVEL 2
STACK LEVEL 3
STACK LEVEL 4
STACK LEVEL 5
STACK LEVEL 6
8-BIT CORE
POWER
RESET
RESET
OSCILLATOR
SUPPLY
V
V
OSCin OSCout
DD SS
6/105
4
ST6215C ST6225C
2 PIN DESCRIPTION
Figure 2. 28-Pin Package Pinout
V
V
1
28
27
26
25
24
23
22
21
20
19
18
17
16
15
DD
SS
TIMER
OSCin
PA0/20mA Sink
PA1/20mA Sink
2
3
OSCout
NMI
PA2/20mA Sink
PA3/20mA Sink
PA4/Ain
4
5
it1
Ain/PC7
Ain/PC6
Ain/PC5
Ain/PC4
6
PA5/Ain
7
it2
PA6/Ain
8
9
PA7/Ain
PB0/Ain
PB1/Ain
V
10
11
12
PP
RESET
Ain/PB7
Ain/PB6
Ain/PB5
PB2/Ain
PB3/Ain
PB4/Ain
it2
13
14
it2
itX associated interrupt vector
Table 1. Device Pin Description
Main Function
(after Reset)
Pin n°
Pin Name
Alternate Function
1
2
3
4
5
6
7
8
9
V
S
Main power supply
DD
TIMER
I/O Timer input or output
OSCin
OSCout
NMI
I
O
I
External clock input or resonator oscillator inverter input
Resonator oscillator inverter output or resistor input for RC oscillator
Non maskable interrupt (falling edge sensitive)
PC7/Ain
PC6/Ain
PC5/Ain
PC4/Ain
I/O Pin C7 (IPU)
I/O Pin C6 (IPU)
I/O Pin C5 (IPU)
I/O Pin C4 (IPU)
Analog input
Analog input
Analog input
Analog input
Must be held at Vss for normal operation, if a 12.5V level is applied to the pin
during the reset phase, the device enters EPROM programming mode.
10
V
PP
11
12
13
RESET
PB7/Ain
PB6/Ain
I/O Top priority non maskable interrupt (active low)
I/O Pin B7 (IPU)
I/O Pin B6 (IPU)
Analog input
Analog input
7/105
5
ST6215C ST6225C
Main Function
(after Reset)
Pin n°
Pin Name
PB5/Ain
Alternate Function
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
I/O Pin B5 (IPU)
I/O Pin B4 (IPU)
I/O Pin B3 (IPU)
I/O Pin B2 (IPU)
I/O Pin B1 (IPU)
I/O Pin B0 (IPU)
I/O Pin A7 (IPU)
I/O Pin A6 (IPU)
I/O Pin A5 (IPU)
I/O Pin A4 (IPU)
I/O Pin A3 (IPU)
I/O Pin A2 (IPU)
I/O Pin A1 (IPU)
I/O Pin A0 (IPU)
Analog input
Analog input
Analog input
Analog input
Analog input
Analog input
Analog input
Analog input
Analog input
Analog input
PB4/Ain
PB3/Ain
PB2/Ain
PB1/Ain
PB0/Ain
PA7/Ain
PA6/Ain
PA5/Ain
PA4/Ain
PA3/ 20mA Sink
PA2/ 20mA Sink
PA1/ 20mA Sink
PA0/ 20mA Sink
V
S
Ground
SS
Legend / Abbreviations for Table 1:
I = input, O = output, S = supply, IPU = input pull-up
The input with pull-up configuration (reset state) is valid as long as the user software does not change it.
Refer to Section 8 "I/O PORTS" on page 38 for more details on the software configuration of the I/O ports.
8/105
6
ST6215C ST6225C
3 MEMORY MAPS, PROGRAMMING MODES AND OPTION BYTES
3.1 MEMORY AND REGISTER MAPS
3.1.1 Introduction
Briefly, Program space contains user program
code in OTP and user vectors; Data space con-
tains user data in RAM and in OTP, and Stack
space accommodates six levels of stack for sub-
routine and interrupt service routine nesting.
The MCU operates in three separate memory
spaces: Program space, Data space, and Stack
space. Operation in these three memory spaces is
described in the following paragraphs.
Figure 3. Memory Addressing Diagram
PROGRAM SPACE
000h
DATA SPACE
000h
RESERVED
03Fh
040h
DATA READ-ONLY
MEMORY WINDOW
07Fh
PROGRAM
MEMORY
080h
081h
082h
083h
084h
X REGISTER
Y REGISTER
V REGISTER
W REGISTER
(see Figure 4
on page 10)
RAM
0BFh
0C0h
HARDWARE
0FF0h
CONTROL
REGISTERS
INTERRUPT &
(see Table 2)
RESET VECTORS
0FFFh
ACCUMULATOR
0FFh
9/105
1
ST6215C ST6225C
MEMORY MAP (Cont’d)
Figure 4. Program Memory Map
ST6215C
ST6225C
0000h
0000h
*
RESERVED
07Fh
080h
NOT IMPLEMENTED
07FFh
0800h
*
RESERVED
087Fh
0880h
USER
PROGRAM MEMORY
3872 BYTES
USER
PROGRAM MEMORY
1824 BYTES
0F9Fh
0F9Fh
0FA0h
0FEFh
0FF0h
0FF7h
0FF8h
0FFBh
0FFCh
0FFDh
0FFEh
0FFFh
0FA0h
0FEFh
0FF0h
0FF7h
0FF8h
0FFBh
0FFCh
0FFDh
0FFEh
0FFFh
*
*
RESERVED
RESERVED
INTERRUPT VECTORS
INTERRUPT VECTORS
*
*
RESERVED
RESERVED
NMI VECTOR
NMI VECTOR
USER RESET VECTOR
USER RESET VECTOR
(*) Reserved areas should be filled with 0FFh
10/105
1
ST6215C ST6225C
MEMORY MAP (Cont’d)
3.1.2 Program Space
such as constants and look-up tables in OTP/
EPROM.
Program Space comprises the instructions to be
executed, the data required for immediate ad-
dressing mode instructions, the reserved factory
test area and the user vectors. Program Space is
addressed via the 12-bit Program Counter register
(PC register). Thus, the MCU is capable of ad-
dressing 4K bytes of memory directly.
3.1.4.1 Data ROM
All read-only data is physically stored in program
memory, which also accommodates the Program
Space. The program memory consequently con-
tains the program code to be executed, as well as
the constants and look-up tables required by the
application.
3.1.3 Readout Protection
The Program Memory in OTP or EPROM devices
can be protected against external readout of mem-
ory by setting the Readout Protection bit in the op-
tion byte (Section 3.3 on page 16).
The Data Space locations in which the different
constants and look-up tables are addressed by the
processor core may be thought of as a 64-byte
window through which it is possible to access the
read-only data stored in OTP/EPROM.
In the EPROM parts, Readout Protection option
can be desactivated only by U.V. erasure that also
results in the whole EPROM context being erased.
3.1.4.2 Data RAM
The data space includes the user RAM area, the
accumulator (A), the indirect registers (X), (Y), the
short direct registers (V), (W), the I/O port regis-
ters, the peripheral data and control registers, the
interrupt option register and the Data ROM Win-
dow register (DRWR register).
Note: Once the Readout Protection is activated, it
is no longer possible, even for STMicroelectronics,
to gain access to the OTP contents. Returned
parts can therefore not be accepted if the Readout
Protection bit is set.
3.1.4 Data Space
3.1.5 Stack Space
Data Space accommodates all the data necessary
for processing the user program. This space com-
prises the RAM resource, the processor core and
peripheral registers, as well as read-only data
Stack space consists of six 12-bit registers which
are used to stack subroutine and interrupt return
addresses, as well as the current program counter
contents.
11/105
1
ST6215C ST6225C
MEMORY MAP (Cont’d)
Table 2. Hardware Register Map
Register
Reset
Address
Block
Register Name
X,Y index registers
Remarks
Label
Status
080h
to 083h
CPU
X,Y,V,W
xxh
R/W
V,W short direct registers
1) 2) 3)
0C0h
0C1h
0C2h
DRA
DRB
DRC
Port A Data Register
Port B Data Register
Port C Data Register
00h
00h
00h
R/W
R/W
R/W
1) 2) 3)
1) 2) 3)
I/O Ports
I/O Ports
0C3h
Reserved (1 Byte)
2)
0C4h
0C5h
0C6h
DDRA
DDRB
DDRC
Port A Direction Register
Port B Direction Register
Port C Direction Register
00h
00h
00h
R/W
R/W
R/W
2)
2)
0C7h
0C8h
0C9h
Reserved (1 Byte)
Interrupt Option Register
CPU
IOR
xxh
xxh
Write-only
Write-only
ROM
DRWR
Data ROM Window register
0CAh
0CBh
Reserved (2 Bytes)
2)
2)
2)
0CCh
0CDh
0CEh
ORA
ORB
ORC
Port A Option Register
Port B Option Register
Port C Option Register
00h
00h
00h
R/W
R/W
R/W
I/O Ports
0CFh
Reserved (1 byte)
0D0h
0D1h
ADR
ADCR
A/D Converter Data Register
A/D Converter Control Register
xxh
40h
Read-only
Ro/Wo
ADC
7Fh
0FFh
0D2h
0D3h
0D4h
PSCR
TCR
TSCR
Timer 1 Prescaler Register
Timer 1 Counter Register
Timer 1 Status Control Register
R/W
R/W
R/W
Timer1
00h
0FEh
xxh
0D5h
to 0D7h
Reserved (3 Bytes)
Watchdog Register
Watchdog
Timer
0D8h
WDGR
R/W
R/W
0D9h
to 0FEh
Reserved (38 Bytes)
Accumulator
0FFh
CPU
A
Legend:
x = undefined, R/W = Read/Write, Ro = Read-only Bit(s) in the register, Wo = Write-only Bit(s)
in the register.
Notes:
1. The contents of the I/O port DR registers are readable only in output configuration. In input configura-
tion, the values of the I/O pins are returned instead of the DR register contents.
2. The bits associated with unavailable pins must always be kept at their reset value.
3. Do not use single-bit instructions (SET, RES...) on Port Data Registers if any pin of the port is configured
in input mode (refer to Section 8 "I/O PORTS" on page 38 for more details).
12/105
1
ST6215C ST6225C
MEMORY MAP (Cont’d)
3.1.6 Data ROM Window Mechanism
3.1.6.1 Data ROM Window Register (DRWR)
The Data read-only memory window is located
from address 0040h to address 007Fh in Data
space. It allows direct reading of 64 consecutive
bytes located anywhere in program memory, be-
tween address 0000h and 0FFFh.
The DRWR can be addressed like any RAM loca-
tion in the Data Space.
This register is used to select the 64-byte block of
program memory to be read in the Data ROM win-
dow (from address 40h to address 7Fh in Data
space). The DRWR register is not cleared on re-
set, therefore it must be written to before access-
ing the Data read-only memory window area for
the first time.
There are 64 blocks of 64 bytes in a 4K device:
– Block 0 is related to the address range 0000h to
003Fh.
– Block 1 is related to the address range 0040h to
007Fh.
Address: 0C9h
—
Write Only
and so on...
Reset Value = xxh (undefined)
All the program memory can therefore be used to
store either instructions or read-only data. The
Data ROM window can be moved in steps of 64
bytes along the program memory by writing the
appropriate code in the Data ROM Window Regis-
ter (DRWR).
7
0
-
-
DRWR5 DRWR4 DRWR3 DRWR2 DRWR1 DRWR0
Bits 7:6 = Reserved, must be cleared.
Figure 5. Data ROM Window
PROGRAM
Bits 5:0 = DRWR[5:0] Data read-only memory
Window Register Bits. These are the Data read-
only memory Window bits that correspond to the
upper bits of the data read-only memory space.
DATA SPACE
SPACE
0000h
000h
Caution: This register is undefined on reset, it is
write-only, therefore do not read it nor access it us-
ing Read-Modify-Write instructions (SET, RES,
INC and DEC).
040h
07Fh
DATA ROM
WINDOW
64-BYTE
ROM
0FFh
0FFFh
13/105
1
ST6215C ST6225C
MEMORY MAP (Cont’d)
3.1.6.2 Data ROM Window memory addressing
tion is automatically handled by the ST6 develop-
ment tools.
In cases where some data (look-up tables for ex-
ample) are stored in program memory, reading
these data requires the use of the Data ROM win-
dow mechanism. To do this:
Please refer to the user manual of the correspod-
ing tool.
3.1.6.3 Recommendations
1. The DRWR register has to be loaded with the
64-byte block number where the data are located
(in program memory). This number also gives the
start address of the block.
Care is required when handling the DRWR regis-
ter as it is write only. For this reason, the DRWR
contents should not be changed while executing
an interrupt service routine, as the service routine
cannot save and then restore the register’s previ-
ous contents. If it is impossible to avoid writing to
the DRWR during the interrupt service routine, an
image of the register must be saved in a RAM lo-
cation, and each time the program writes to the
DRWR, it must also write to the image register.
The image register must be written first so that, if
an interrupt occurs between the two instructions,
the DRWR is not affected.
2. Then, the offset address of the byte in the Data
ROM Window (corresponding to the offset in the
64-byte block in program memory) has to be load-
ed in a register (A, X,...).
When the above two steps are completed, the
data can be read.
To understand how to determine the DRWR and
the content of the register, please refer to the ex-
ample shown in Figure 6. In any case the calcula-
Figure 6. Data read-only memory Window Memory Addressing
DATA SPACE
000h
PROGRAM SPACE
0000h
040h
OFFSET
21h
DATA
061h
07Fh
0400h
64 bytes
DATA
OFFSET
0421h
DRWR
0FFh
10h
07FFh
DATA address in Program memory : 421h
DRWR content : 421h / 3Fh (64) = 10H data is located in 64-bytes window number 10h
64-byte window start address : 10h x 3Fh = 400h
Register (A, X,...)content : Offset = (421h - 400h) + 40h ( Data ROM Window start address in data space) = 61h
14/105
1
ST6215C ST6225C
3.2 PROGRAMMING MODES
3.2.1 Program Memory
Note: OTP/EPROM devices can be programmed
with the development tools available from
STMicroelectronics (please refer to Section 13 on
page 100).
EPROM/OTP programming mode is set by a
+12.5V voltage applied to the TEST/V pin. The
programming flow of the ST62T15C,T25C/E25C is
described in the User Manual of the EPROM Pro-
gramming Board.
PP
3.2.2 EPROM Erasing
The EPROM devices can be erased by exposure
to Ultra Violet light. The characteristics of the MCU
are such that erasure begins when the memory is
exposed to light with a wave lengths shorter than
approximately 4000Å. It should be noted that sun-
light and some types of fluorescent lamps have
wavelengths in the range 3000-4000Å.
Table 3. ST6215C Program Memory Map
Device Address
Description
0000h-087Fh
0880h-0F9Fh
0FA0h-0FEFh
0FF0h-0FF7h
0FF8h-0FFBh
0FFCh-0FFDh
0FFEh-0FFFh
Reserved
User ROM
Reserved
It is thus recommended that the window of the
MCU packages be covered by an opaque label to
prevent unintentional erasure problems when test-
ing the application in such an environment.
Interrupt Vectors
Reserved
NMI Interrupt Vector
Reset Vector
The recommended erasure procedure is exposure
to short wave ultraviolet light which have a wave-
length 2537Å. The integrated dose (i.e. U.V. inten-
sity x exposure time) for erasure should be a mini-
Table 4. ST6225C Program Memory Map
Device Address
Description
2
mum of 30W-sec/cm . The erasure time with this
0000h-007Fh
0080h-0F9Fh
0FA0h-0FEFh
0FF0h-0FF7h
0FF8h-0FFBh
0FFCh-0FFDh
0FFEh-0FFFh
Reserved
User ROM
Reserved
dosage is approximately 30 to 40 minutes using an
2
ultraviolet lamp with 12000µW/cm power rating.
The EPROM device should be placed within
2.5cm (1inch) of the lamp tubes during erasure.
Interrupt Vectors
Reserved
NMI Interrupt Vector
Reset Vector
15/105
1
ST6215C ST6225C
3.3 OPTION BYTES
Each device is available for production in user pro-
grammable versions (OTP) as well as in factory
coded versions (ROM). OTP devices are shipped
to customers with a default content (00h), while
ROM factory coded parts contain the code sup-
plied by the customer. This implies that OTP de-
vices have to be configured by the customer using
the Option Bytes while the ROM devices are facto-
ry-configured.
0: Low Voltage Detector disabled
1: Low Voltage Detector enabled.
LSB OPTION BYTE
Bit 7 = PROTECT Readout Protection.
This option bit enables or disables external access
to the internal program memory.
0: Program memory not read-out protected
1: Program memory read-out protected
The two option bytes allow the hardware configu-
ration of the microcontroller to be selected.
The option bytes have no address in the memory
map and can be accessed only in programming
mode (for example using a standard ST6 program-
ming tool).
In masked ROM devices, the option bytes are
fixed in hardware by the ROM code (see Section
12.6.2 "ROM Version" on page 98). It is therefore
impossible to read the option bytes.
Bit 6 = OSC Oscillator selection.
This option bit selects the main oscillator type.
0: Quartz crystal, ceramic resonator or external
clock
1: RC network
Bits 5:4 = Reserved, must be always cleared.
The option bytes can be only programmed once. It
is not possible to change the selected options after
they have been programmed.
Bit 3 = NMI PULL NMI Pull-Up on/off.
This option bit enables or disables the internal pull-
up on the NMI pin.
0: Pull-up disabled
In order to reach the power consumption value in-
dicated in Section 11.4, the option byte must be
programmed to its default value. Otherwise, an
over-consumption will occur.
1: Pull-up enabled
Bit 2 = TIM PULL TIMER Pull-Up on/off.
This option bit enables or disables the internal pull-
up on the TIMER pin.
0: Pull-up disabled
1: Pull-up enabled
MSB OPTION BYTE
Bits 15:10 = Reserved, must be always cleared.
Bit 9 = EXTCNTL External STOP MODE control.
0: EXTCNTL mode not available. STOP mode is
not available with the watchdog active.
1: EXTCNTL mode available. STOP mode is avail-
able with the watchdog active by setting NMI pin
to one.
Bit 1 = WDACT Hardware or software watchdog.
This option bit selects the watchdog type.
0: Software (watchdog to be enabled by software)
1: Hardware (watchdog always enabled)
Bit 0 = OSGEN Oscillator Safeguard on/off.
This option bit enables or disables the oscillator
Safeguard (OSG) feature.
Bit 8 = LVD Low Voltage Detector on/off.
This option bit enable or disable the Low Voltage
Detector (LVD) feature.
0: Oscillator Safeguard disabled
1: Oscillator Safeguard enabled
MSB OPTION BYTE
LSB OPTION BYTE
15
8
7
0
EXT
PRO-
TECT
NMI
TIM
WD OSG
Reserved
CTL
LVD
OSC Res. Res.
PULL PULL ACT EN
Default
Value
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
X
16/105
1
ST6215C ST6225C
4 CENTRAL PROCESSING UNIT
4.1 INTRODUCTION
tions. The accumulator can be addressed in Data
Space as a RAM location at address FFh. Thus
the ST6 can manipulate the accumulator just like
any other register in Data Space.
The CPU Core of ST6 devices is independent of the
I/O or Memory configuration. As such, it may be
thought of as an independent central processor
communicating with on-chip I/O, Memory and Pe-
ripherals via internal address, data, and control
buses.
Index Registers (X, Y). These two registers are
used in Indirect addressing mode as pointers to
memory locations in Data Space. They can also
be accessed in Direct, Short Direct, or Bit Direct
addressing modes. They are mapped in Data
Space at addresses 80h (X) and 81h (Y) and can
be accessed like any other memory location.
4.2 MAIN FEATURES
■ 40 basic instructions
Short Direct Registers (V, W). These two regis-
ters are used in Short Direct addressing mode.
This means that the data stored in V or W can be
accessed with a one-byte instruction (four CPU cy-
cles). V and W can also be accessed using Direct
and Bit Direct addressing modes. They are
mapped in Data Space at addresses 82h (V) and
83h (W) and can be accessed like any other mem-
ory location.
■ 9 main addressing modes
■ Two 8-bit index registers
■ Two 8-bit short direct registers
■ Low power modes
■ Maskable hardware interrupts
■ 6-level hardware stack
4.3 CPU REGISTERS
Note: The X and Y registers can also be used as
Short Direct registers in the same way as V and W.
TheST6FamilyCPUcorefeaturessixregistersand
three pairs of flags available to the programmer.
These are described in the following paragraphs.
Program Counter (PC). The program counter is a
12-bit register which contains the address of the
next instruction to be executed by the core. This
ROM location may be an opcode, an operand, or
the address of an operand.
Accumulator (A). The accumulator is an 8-bit
general purpose register used in all arithmetic cal-
culations, logical operations, and data manipula-
Figure 7. CPU Registers
7
0
ACCUMULATOR
SIX LEVEL
STACK
RESET VALUE = xxh
7
0
0
X INDEX REGISTER
Y INDEX REGISTER
RESET VALUE = xxh
7
CN ZN
CI ZI
CNMI ZNMI
NORMAL FLAGS
INTERRUPT FLAGS
NMI FLAGS
RESET VALUE = xxh
7
0
0
V SHORT INDIRECT
REGISTER
RESET VALUE = xxh
7
W SHORT INDIRECT
REGISTER
RESET VALUE = xxh
11
0
PROGRAM COUNTER
RESET VALUE = RESET VECTOR @ 0FFEh-0FFFh
x = Undefined value
17/105
1
ST6215C ST6225C
CPU REGISTERS (Cont’d)
The 12-bit length allows the direct addressing of
4096 bytes in Program Space.
Z : Zero flag
This flag is set if the result of the last arithmetic or
logical operation was equal to zero; otherwise it is
cleared.
However, if the program space contains more than
4096 bytes, the additional memory in program
space can be addressed by using the Program
ROM Page register.
0: The result of the last operation is different from
zero
1: The result of the last operation is zero
The PC value is incremented after reading the ad-
dress of the current instruction. To execute relative
jumps, the PC and the offset are shifted through
the ALU, where they are added; the result is then
shifted back into the PC. The program counter can
be changed in the following ways:
Switching between the three sets of flags is per-
formed automatically when an NMI, an interrupt or
a RETI instruction occurs. As NMI mode is auto-
matically selected after the reset of the MCU, the
ST6 core uses the NMI flags first.
Stack. The ST6 CPU includes a true LIFO (Last In
First Out) hardware stack which eliminates the
need for a stack pointer. The stack consists of six
separate 12-bit RAM locations that do not belong
to the data space RAM area. When a subroutine
call (or interrupt request) occurs, the contents of
each level are shifted into the next level down,
while the content of the PC is shifted into the first
level (the original contents of the sixth stack level
are lost). When a subroutine or interrupt return oc-
curs (RET or RETI instructions), the first level reg-
ister is shifted back into the PC and the value of
each level is popped back into the previous level.
– JP (Jump) instruction
– CALL instruction
PC = Jump address
PC = Call address
– Relative Branch InstructionPC = PC +/- offset
– Interrupt
– Reset
PC = Interrupt vector
PC = Reset vector
– RET & RETI instructions PC = Pop (stack)
– Normal instruction PC = PC + 1
Flags (C, Z). The ST6 CPU includes three pairs of
flags (Carry and Zero), each pair being associated
with one of the three normal modes of operation:
Normal mode, Interrupt mode and Non Maskable
Interrupt mode. Each pair consists of a CARRY
flag and a ZERO flag. One pair (CN, ZN) is used
during Normal operation, another pair is used dur-
ing Interrupt mode (CI, ZI), and a third pair is used
in the Non Maskable Interrupt mode (CNMI, ZN-
MI).
Figure 8. Stack manipulation
PROGRAM
COUNTER
ON RETURN
FROM
ON
LEVEL 1
LEVEL 2
LEVEL 3
LEVEL 4
LEVEL 5
LEVEL 6
The ST6 CPU uses the pair of flags associated
with the current mode: as soon as an interrupt (or
a Non Maskable Interrupt) is generated, the ST6
CPU uses the Interrupt flags (or the NMI flags) in-
stead of the Normal flags. When the RETI instruc-
tion is executed, the previously used set of flags is
restored. It should be noted that each flag set can
only be addressed in its own context (Non Maska-
ble Interrupt, Normal Interrupt or Main routine).
The flags are not cleared during context switching
and thus retain their status.
INTERRUPT,
OR
INTERRUPT,
OR
SUBROUTINE
CALL
SUBROUTINE
Since the accumulator, in common with all other
data space registers, is not stored in this stack,
management of these registers should be per-
formed within the subroutine.
C : Carry flag.
This bit is set when a carry or a borrow occurs dur-
ing arithmetic operations; otherwise it is cleared.
The Carry flag is also set to the value of the bit
tested in a bit test instruction; it also participates in
the rotate left instruction.
0: No carry has occured
1: A carry has occured
Caution: The stack will remain in its “deepest” po-
sition if more than 6 nested calls or interrupts are
executed, and consequently the last return ad-
dress will be lost.
It will also remain in its highest position if the stack
is empty and a RET or RETI is executed. In this
case the next instruction will be executed.
18/105
1
ST6215C ST6225C
5 CLOCKS, SUPPLY AND RESET
5.1 CLOCK SYSTEM
The main oscillator of the MCU can be driven by
any of these clock sources:
Table 5 illustrates various possible oscillator con-
figurations using an external crystal or ceramic
resonator, an external clock input, an external re-
NET
the LFAO.
– external clock signal
sistor (R
), or the lowest cost solution using only
– external AT-cut parallel-resonant crystal
– external ceramic resonator
For more details on configuring the clock options,
refer to the Option Bytes section of this document.
– external RC network (R
).
NET
The internal MCU clock frequency (f ) is divided
In addition, an on-chip Low Frequency Auxiliary
Oscillator (LFAO) is available as a back-up clock
system or to reduce power consumption.
INT
by 12 to drive the Timer, the Watchdog timer and
the A/D converter, by 13 to drive the CPU core and
the SPI and by 1 or 3 to drive the ARTIMER, as
shown in Figure 9.
An optional Oscillator Safeguard (OSG) filters
spikes from the oscillator lines, and switches to the
LFAO backup oscillator in the event of main oscil-
lator failure. It also automatically limits the internal
With an 8 MHz oscillator, the fastest CPU cycle is
therefore 1.625µs.
clock frequency (f ) as a function of V , in order
INT
DD
A CPU cycle is the smallest unit of time needed to
execute any operation (for instance, to increment
the Program Counter). An instruction may require
two, four, or five CPU cycles for execution.
to guarantee correct operation. These functions
are illustrated in Figure 10, and Figure 11.
Figure 9. Clock Circuit Block Diagram
OSCILLATOR SAFEGUARD (OSG)
SPI
: 13
: 12
f
OSG
filtering
CORE
OSC
8-BIT TIMER
WATCHDOG
0
1
Oscillator
Divider
f
MAIN
OSCILLATOR
INT
ADC
LFAO
: 1
: 3
OSCOFF BIT
(ADCR REGISTER)
8-BIT ARTIMER
8-BIT ARTIMER
OSG ENABLE OPTION BIT (See OPTION BYTE SECTION)
19/105
1
ST6215C ST6225C
CLOCK SYSTEM (Cont’d)
5.1.1 Main Oscillator
Table 5. Oscillator Configurations
Hardware Configuration
The oscillator configuration is specified by select-
ing the appropriate option in the option bytes (refer
to the Option Bytes section of this document).
When the CRYSTAL/RESONATOR option is se-
lected, it must be used with a quartz crystal, a ce-
ramic resonator or an external signal provided on
the OSCin pin. When the RC NETWORK option is
selected, the system clock is generated by an ex-
ternal resistor (the capacitor is implemented inter-
nally).
External Clock
ST6
OSCin
OSCout
NC
EXTERNAL
CLOCK
The main oscillator can be turned off (when the
OSG ENABLED option is selected) by setting the
OSCOFF bit of the ADC Control Register (not
available on some devices). This will automatically
start the Low Frequency Auxiliary Oscillator
(LFAO).
2)
Crystal/Resonator Clock
ST6
OSCin
OSCout
The main oscillator can be turned off by resetting
the OSCOFF bit of the A/D Converter Control Reg-
ister or by resetting the MCU. When the main os-
cillator starts there is a delay made up of the oscil-
lator start-up delay period plus the duration of the
C
C
L2
L1
software instruction at a clock frequency f
.
LOAD
LFAO
3)
CAPACITORS
Caution: It should be noted that when the RC net-
work option is selected, the accuracy of the fre-
quency is about 20% so it may not be suitable for
some applications (For more details, please refer
to the Electrical Characteristics Section).
RC Network
ST6
OSCin
NC
OSCout
R
NET
LFAO
ST6
OSCin
OSCout
NC
Notes:
1. To select the options shown in column 1 of the above
table, refer to the Option Byte section.
2.This schematic are given for guidance only and are sub-
ject to the schematics given by the crystal or ceramic res-
onator manufacturer.
3. For more details, please refer to the Electrical Charac-
teristics Section.
20/105
1
ST6215C ST6225C
CLOCK SYSTEM (Cont’d)
5.1.2 Oscillator Safeguard (OSG)
imum internal clock frequency, f , is limited to
INT
OSG
f
, which is supply voltage dependent.
The Oscillator Safeguard (OSG) feature is a
means of dramatically improving the operational
integrity of the MCU. It is available when the OSG
ENABLED option is selected in the option byte (re-
fer to the Option Bytes section of this document).
5.1.2.2 Management of Supply Voltage
Variations
Over-frequency, at a given power supply level, is
seen by the OSG as spikes; it therefore filters out
some cycles in order that the internal clock fre-
quency of the device is kept within the range the
The OSG acts as a filter whose cross-over fre-
quency is device dependent and provides three
basic functions:
particular device can stand (depending on V ),
DD
and below f
: the maximum authorised frequen-
OSG
– Filtering spikes on the oscillator lines which
would result in driving the CPU at excessive fre-
quencies
cy with OSG enabled.
5.1.2.3 LFAO Management
– Management of the Low Frequency Auxiliary
Oscillator (LFAO), (useable as low cost internal
clock source, backup clock in case of main oscil-
lator failure or for low power consumption)
When the OSG is enabled, the Low Frequency
Auxiliary Oscillator can be used (see Section
5.1.3).
– Automatically limiting the f
a function of supply voltage, to ensure correct
operation even if the power supply drops.
clock frequency as
Note: The OSG should be used wherever possible
as it provides maximum security for the applica-
tion. It should be noted however, that it can in-
crease power consumption and reduce the maxi-
INT
5.1.2.1 Spike Filtering
mum operating frequency to f
Characteristics section).
(see Electrical
OSG
Spikes on the oscillator lines result in an effectively
increased internal clock frequency. In the absence
of an OSG circuit, this may lead to an over fre-
quency for a given power supply voltage. The
OSG filters out such spikes (as illustrated in Figure
10). In all cases, when the OSG is active, the max-
Caution: Care has to be taken when using the
OSG, as the internal frequency is defined between
a minimum and a maximum value and may vary
depending on both V and temperature. For pre-
DD
cise timing measurements, it is not recommended
to use the OSG.
Figure 10. OSG Filtering Function
f
f
f
f
OSC< OSG
OSC> OSG
f
f
OSC
OSG
f
INT
Figure 11. LFAO Oscillator Function
MAIN OSCILLATOR
STOPS
MAIN OSCILLATOR
RESTARTS
f
f
OSC
LFAO
f
INT
INTERNAL CLOCK DRIVEN BY LFAO
21/105
1
ST6215C ST6225C
CLOCK SYSTEM (Cont’d)
5.1.3 Low Frequency Auxiliary Oscillator
(LFAO)
The Low Frequency Auxiliary Oscillator is auto-
matically switched off as soon as the main oscilla-
tor starts.
The Low Frequency Auxiliary Oscillator has three
main purposes. Firstly, it can be used to reduce
power consumption in non timing critical routines.
Secondly, it offers a fully integrated system clock,
without any external components. Lastly, it acts as
a backup oscillator in case of main oscillator fail-
ure.
5.1.4 Register Description
ADC CONTROL REGISTER (ADCR)
Address: 0D1h
—
Read/Write
Reset value: 0100 0000 (40h)
This oscillator is available when the OSG ENA-
BLED option is selected in the option byte (refer to
the Option Bytes section of this document). In this
case, it automatically starts one of its periods after
the first missing edge of the main oscillator, what-
ever the reason for the failure (main oscillator de-
fective, no clock circuitry provided, main oscillator
switched off...). See Figure 11.
7
0
ADCR ADCR ADCR ADCR ADCR OSC ADCR ADCR
OFF
7
6
5
4
3
1
0
Bit 7:3, 1:0 = ADCR[7:3], ADCR[1:0] ADC Control
Register.
These bits are used to control the A/D converter (if
available on the device) otherwise they are not
used.
User code, normal interrupts, WAIT and STOP in-
structions, are processed as normal, at the re-
duced f
frequency. The A/D converter accura-
LFAO
Bit 2 = OSCOFF Main Oscillator Off.
0: Main oscillator enabled
1: Main oscillator disabled
cy is decreased, since the internal frequency is be-
low 1.2 MHz.
At power on, until the main oscillator starts, the re-
set delay counter is driven by the LFAO. If the
main oscillator starts before the 2048 cycle delay
has elapsed, it takes over.
Note: The OSG must be enabled using the OS-
GEN option in the Option Byte, otherwise the OS-
COFF setting has no effect.
22/105
1
ST6215C ST6225C
5.2 LOW VOLTAGE DETECTOR (LVD)
The on-chip Low Voltage Detector is enabled by
setting a bit in the option bytes (refer to the Option
Bytes section of this document).
The LVD Reset circuitry generates a reset when
DD
V
is below:
– VIT+ when V is rising
DD
The LVD allows the device to be used without any
external RESET circuitry. In this case, the RESET
pin should be left unconnected.
– VIT- when V is falling
DD
The LVD function is illustrated in Figure 12.
If the LVD is enabled, the MCU can be in only one
of two states:
If the LVD is not used, an external circuit is manda-
tory to ensure correct Power On Reset operation,
see figure in the Reset section. For more details,
please refer to the application note AN669.
– Over the input threshold voltage, it is running un-
der full software control
The LVD generates a static Reset when the supply
voltage is below a reference value. This means
that it secures the power-up as well as the power-
down keeping the ST6 in reset.
– Below the input threshold voltage, it is in static
safe reset
In these conditions, secure operation is guaran-
teed without the need for external reset hardware.
The VIT- reference value for a voltage drop is lower
than the VIT+ reference value for power-on in order
to avoid a parasitic reset when the MCU starts run-
ning and sinks current on the supply (hysteresis).
During a Low Voltage Detector Reset, the RESET
pin is held low, thus permitting the MCU to reset
other devices.
Figure 12. Low Voltage Detector Reset
V
DD
V
hyst
V
V
IT+
IT-
RESET
23/105
1
ST6215C ST6225C
5.3 RESET
5.3.1 Introduction
The RESET vector fetch phase duration is 2 clock
cycles.
The MCU can be reset in three ways:
■ A low pulse input on the RESET pin
■ Internal Watchdog reset
When a reset occurs:
– The stack is cleared
– The PC is loaded with the address of the Reset
vector. It is located in program ROM starting at
address 0FFEh.
■ Internal Low Voltage Detector (LVD) reset
5.3.2 RESET Sequence
The basic RESET sequence consists of 3 main
phases:
A jump to the beginning of the user program must
be coded at this address.
■ Internal (watchdog or LVD) or external Reset
– The interrupt flag is automatically set, so that the
CPU is in Non Maskable Interrupt mode. This
prevents the initialization routine from being in-
terrupted. The initialization routine should there-
fore be terminated by a RETI instruction, in order
to go back to normal mode.
event
■ A delay of 2048 clock (f ) cycles
INT
■ RESET vector fetch
The reset delay allows the oscillator to stabilise
and ensures that recovery has taken place from
the Reset state.
Figure 13. RESET Sequence
V
DD
V
V
IT+
IT-
WATCHDOG
RESET
WATCHDOG UNDERFLOW
LVD
RESET
RESET PIN
INTERNAL
RESET
RUN
RUN
RUN
RUN
RESET
RESET
RESET
2048 CLOCK CYCLE (f
) DELAY
INT
24/105
1
ST6215C ST6225C
RESET (Cont’d)
5.3.3 RESET Pin
If the RESET pin is grounded while the MCU is in
RUN or WAIT modes, processing of the user pro-
gram is stopped (RUN mode only), the I/O ports
are configured as inputs with pull-up resistors and
the main oscillator is restarted. When the level on
the RESET pin then goes high, the initialization se-
quence is executed at the end of the internal delay
period.
The RESET pin may be connected to a device on
the application board in order to reset the MCU if
required. The RESET pin may be pulled low in
RUN, WAIT or STOP mode. This input can be
used to reset the internal state of the MCU and en-
sure it starts-up correctly. The pin, which is con-
nected to an internal pull-up, is active low and fea-
tures a Schmitt trigger input. A delay (2048 clock
cycles) added to the external signal ensures that
even short pulses on the RESET pin are accepted
If the RESET pin is grounded while the MCU is in
STOP mode, the oscillator starts up and all the I/O
ports are configured as inputs with pull-up resis-
tors. When the RESET pin level then goes high,
the initialization sequence is executed at the end
of the internal delay period.
as valid, provided V
has completed its rising
DD
phase and that the oscillator is running correctly
(normal RUN or WAIT modes). The MCU is kept in
the Reset state as long as the RESET pin is held
low.
A simple external RESET circuitry is shown in Fig-
ure 15. For more details, please refer to the appli-
cation note AN669.
Figure 14. Reset Block Diagram
INTERNAL
RESET
fINT
V
DD
R
PU
RESET
1)
R
ESD
WATCHDOG RESET
LVD RESET
1) Resistive ESD protection.
25/105
1
ST6215C ST6225C
RESET (Cont’d)
5.3.4 Watchdog Reset
Figure 16. Reset Processing
The MCU provides a Watchdog timer function in
order to be able to recover from software hang-
ups. If the Watchdog register is not refreshed be-
fore an end-of-count condition is reached, a
Watchdog reset is generated.
RESET
2048
CLOCK CYCLE
DELAY
After a Watchdog reset, the MCU restarts in the
same way as if a Reset was generated by the RE-
SET pin.
INTERNAL
RESET
Note: When a watchdog reset occurs, the RESET
pin is tied low for very short time period, to flag the
reset phase. This time is not long enough to reset
external circuits.
NMI MASK SET
INT LATCH CLEARED
(IF PRESENT)
For more details refer to the Watchdog Timer
chapter.
SELECT
NMI MODE FLAGS
5.3.5 LVD Reset
Two different RESET sequences caused by the in-
ternal LVD circuitry can be distinguished:
■ Power-On RESET
■ Voltage Drop RESET
PUT FFEh
ON ADDRESS BUS
During an LVD reset, the RESET pin is pulled low
when V <VIT+ (rising edge) or V <VIT- (falling
DD
DD
edge).
YES
For more details, refer to the LVD chapter.
IS RESET STILL
PRESENT?
Caution: Do not externally connect directly the
RESET pin to VDD, this may cause damage to the
component in case of internal RESET (Watchdog
or LVD).
NO
LOAD PC
FROM RESET LOCATIONS
FFEh/FFFh
Figure 15. Simple External Reset Circuitry
V
V
DD
DD
FETCH INSTRUCTION
R
C
RESET
ST62xx
R > 4.7 K
Typical: R = 10K
C = 10nF
26/105
1
ST6215C ST6225C
6 INTERRUPTS
The ST6 core may be interrupted by four maska-
ble interrupt sources, in addition to a Non Maska-
ble Interrupt (NMI) source. The interrupt process-
ing flowchart is shown in Figure 18.
must write a Jump instruction to the associated in-
terrupt service routine.
When an interrupt source generates an interrupt
request, the PC register is loaded with the address
of the interrupt vector, which then causes a Jump
to the relevant interrupt service routine, thus serv-
icing the interrupt.
Maskable interrupts must be enabled by setting
the GEN bit in the IOR register. However, even if
they are disabled (GEN bit = 0), interrupt events
are latched and may be processed as soon as the
GEN bit is set.
Interrupts are triggered by events either on exter-
nal pins, or from the on-chip peripherals. Several
events can be ORed on the same interrupt vector.
On-chip peripherals have flag registers to deter-
mine which event triggered the interrupt.
Each source is associated with a specific Interrupt
Vector, located in Program space (see Interrupt
Mapping table). In the vector location, the user
27/105
1
ST6215C ST6225C
Figure 17. Interrupts Block Diagram
V
DD
VECTOR #0
NMI
LATCH
CLEARED BY H/W
AT START OF VECTOR #0 ROUTINE
I/O PORT REGISTER
“INPUT WITH INTERRUPT”
CONFIGURATION
PA0..PA7
LATCH
0
VECTOR #1
CLEARED BY H/W
1
AT START OF
VECTOR #1 ROUTINE
LES BIT
(IOR REGISTER)
EXIT FROM
STOP/WAIT
I/O PORT REGISTER
“INPUT WITH INTERRUPT”
CONFIGURATION
PB0..PB7
PC4..PC7
VECTOR #2
LATCH
ESB BIT
(IOR REGISTER)
CLEARED
BY H/W AT START OF
VECTOR #2 ROUTINE
TMZ BIT
ETI BIT
VECTOR #3
VECTOR #4
TIMER
(TSCR REGISTER)
EAI BIT
EOC BIT
A/D CONVERTER
(ADCR REGISTER)
GEN BIT
(IOR REGISTER)
28/105
1
ST6215C ST6225C
6.1 INTERRUPT RULES AND PRIORITY
MANAGEMENT
6.3 NON MASKABLE INTERRUPT
This interrupt is triggered when a falling edge oc-
curs on the NMI pin regardless of the state of the
GEN bit in the IOR register. An interrupt request
on NMI vector #0 is latched by a flip flop which is
automatically reset by the core at the beginning of
the NMI service routine.
■ A Reset can interrupt the NMI and peripheral
interrupt routines
■ The Non Maskable Interrupt request has the
highest priority and can interrupt any peripheral
interrupt routine at any time but cannot interrupt
another NMI interrupt.
■ No peripheral interrupt can interrupt another. If
more than one interrupt request is pending,
these are processed by the processor core
according to their priority level: vector #1 has the
highest priority while vector #4 the lowest. The
priority of each interrupt source is fixed by
hardware (see Interrupt Mapping table).
6.4 PERIPHERAL INTERRUPTS
Different peripheral interrupt flags in the peripheral
control registers are able to cause an interrupt
when they are active if both:
– The GEN bit of the IOR register is set
– The corresponding enable bit is set in the periph-
eral control register.
6.2 INTERRUPTS AND LOW POWER MODES
Peripheral interrupts are linked to vectors #3 and
#4. Interrupt requests are flagged by a bit in their
corresponding control register. This means that a
request cannot be lost, because the flag bit must
be cleared by user software.
All interrupts cause the processor to exit from
WAIT mode. Only the external and some specific
interrupts from the on-chip peripherals cause the
processor to exit from STOP mode (refer to the
“Exit from STOP“ column in the Interrupt Mapping
Table).
29/105
1
ST6215C ST6225C
6.5 EXTERNAL INTERRUPTS (I/O Ports)
External interrupt vectors can be loaded into the
PC register if the corresponding external interrupt
occurred and if the GEN bit is set. These interrupts
allow the processor to exit from STOP mode.
This is due to the vector #2 circuitry.The worka-
round is to discard this first interrupt request in the
routine (using a flag for example).
Masking of One Interrupt by Another on Vector
#2.
The external interrupt polarity is selected through
the IOR register.
When two or more port pins (associated with inter-
rupt vector #2) are configured together as input
with interrupt (falling edge sensitive), as long as
one pin is stuck at '0', the other pin can never gen-
erate an interrupt even if an active edge occurs at
this pin. The same thing occurs when one pin is
stuck at '1' and interrupt vector #2 is configured as
rising edge sensitive.
External interrupts are linked to vectors #1 and #
2.
Interrupt requests on vector #1 can be configured
either as edge or level-sensitive using the LES bit
in the IOR Register.
Interrupt requests from vector #2 are always edge
sensitive. The edge polarity can be configured us-
ing the ESB bit in the IOR Register.
To avoid this the first pin must input a signal that
goes back up to '1' right after the falling edge. Oth-
erwise, in the interrupt routine for the first pin, de-
activate the “input with interrupt” mode using the
port control registers (DDR, OR, DR). An active
edge on another pin can then be latched.
In edge-sensitive mode, a latch is set when a edge
occurs on the interrupt source line and is cleared
when the associated interrupt routine is started.
So, an interrupt request can be stored until com-
pletion of the currently executing interrupt routine,
before being processed. If several interrupt re-
quests occurs before completion of the current in-
terrupt routine, only the first request is stored.
I/O port Configuration Spurious Interrupt on
Vector #2
If a pin associated with interrupt vector #2 is in ‘in-
put with pull-up’ state, a ‘0’ level is present on the
pin and the ESB bit = 0, when the I/O pin is config-
ured as interrupt with pull-up by writing to the
DDRx, ORx and DRx register bits, an interrupt is
latched although a falling edge may not have oc-
curred on the associated pin.
Storing of interrupt requests is not possible in level
sensitive mode. To be taken into account, the low
level must be present on the interrupt pin when the
MCU samples the line after instruction execution.
6.5.1 Notes on using External Interrupts
ESB bit Spurious Interrupt on Vector #2
In the opposite case, if the pin is in interrupt with
pull-up state , a 0 level is present on the pin and
the ESB bit =1, when the I/O port is configured as
input with pull-up by writing to the DDRx, ORx and
DRx bits, an interrupt is latched although a rising
edge may not have occurred on the associated
pin.
If a pin associated with interrupt vector #2 is con-
figured as interrupt with pull-up, whenever vector
#2 is configured to be rising edge sensitive (by set-
ting the ESB bit in the IOR register), an interrupt is
latched although a rising edge may not have oc-
cured on the associated pin.
30/105
1
ST6215C ST6225C
6.6 INTERRUPT HANDLING PROCEDURE
The interrupt procedure is very similar to a call pro-
cedure, in fact the user can consider the interrupt
as an asynchronous call procedure. As this is an
asynchronous event, the user cannot know the
context and the time at which it occurred. As a re-
sult, the user should save all Data space registers
which may be used within the interrupt routines.
The following list summarizes the interrupt proce-
dure:
Figure 18. Interrupt Processing Flow Chart
INSTRUCTION
FETCH
INSTRUCTION
EXECUTE
INSTRUCTION
When an interrupt request occurs, the following
actions are performed by the MCU automatically:
LOAD PC FROM
INTERRUPT VECTOR
– The core switches from the normal flags to the
interrupt flags (or the NMI flags).
– The PC contents are stored in the top level of the
stack.
– The normal interrupt lines are inhibited (NMI still
active).
– The internal latch (if any) is cleared.
WAS
NO
THE INSTRUCTION
CLEAR
?
A RETI
*)
INTERNAL LATCH
YES
IS THE CORE
ALREADY IN
NORMAL MODE?
YES
DISABLE
MASKABLE INTERRUPT
–TheassociatedinterruptvectorisloadedinthePC.
NO
When an interrupt request occurs, the following
actions must be performed by the user software:
ENABLE
MASKABLE INTERRUPTS
PUSH THE
PC INTO THE STACK
– User selected registers have to be saved within
the interrupt service routine (normally on a soft-
ware stack).
SELECT
NORMAL FLAGS
SELECT
– The source of the interrupt must be determined
by polling the interrupt flags (if more than one
source is associated with the same vector).
– The RETI (RETurn from Interrupt) instruction
must end the interrupt service routine.
INTERRUPT FLAGS
“POP”
THE STACKED PC
After the RETI instruction is executed, the MCU re-
turns to the main routine.
NO
IS THERE AN
AN INTERRUPT REQUEST
AND INTERRUPT MASK?
Caution: When a maskable interrupt occurs while
the ST6 core is in NORMAL mode and during the
execution of an “ldi IOR, 00h” instruction (disabling
all maskable interrupts): if the interrupt request oc-
curs during the first 3 cycles of the “ldi” instruction
(which is a 4-cycle instruction) the core will switch
to interrupt mode BUT the flags CN and ZN will
NOT switch to the interrupt pair CI and ZI.
YES
*)
If a latch is present on the interrupt source line
Table 6. Interrupt Response Time
Minimum
Maximum
6 CPU cycles
11 CPU cycles
6.6.1 Interrupt Response Time
This is defined as the time between the moment
when the Program Counter is loaded with the in-
terrupt vector and when the program has jump to
the interrupt subroutine and is ready to execute
the code. It depends on when the interrupt occurs
while the core is processing an instruction.
One CPU cycle is 13 external clock cycles thus 11
CPU cycles = 11 x (13 /8M) = 17.875 µs with an 8
MHz external quartz.
31/105
1
ST6215C ST6225C
6.7 REGISTER DESCRIPTION
INTERRUPT OPTION REGISTER (IOR)
1: Low level sensitive mode is selected for inter-
rupt vector #1
Address: 0C8h
—
Write Only
Reset status: 00h
Bit 5 = ESB Edge Selection bit.
0: Falling edge mode on interrupt vector #2
1: Rising edge mode on interrupt vector #2
7
-
0
-
LES ESB GEN
-
-
-
Bit 4 = GEN Global Enable Interrupt.
0: Disable all maskable interrupts
1: Enable all maskable interrupts
Caution: This register is write-only and cannot be
accessed by single-bit operations (SET, RES,
DEC,...).
Note: When the GEN bit is cleared, the NMI inter-
rupt is active but cannot be used to exit from STOP
or WAIT modes.
Bit 7 =Reserved, must be cleared.
Bits 3:0 = Reserved, must be cleared.
Bit 6 = LES Level/Edge Selection bit.
0: Falling edge sensitive mode is selected for inter-
rupt vector #1
Table 7. Interrupt Mapping
Exit
from
STOP
Vector
Source
Block
Register
Label
Vector
Address
Priority
Order
Description
Flag
number
RESET
NMI
Reset
N/A
N/A
N/A
N/A
yes
yes
FFEh-FFFh
FFCh-FFDh
FFAh-FFBh
FF8h-FF9h
FF6h-FF7h
FF4h-FF5h
FF2h-FF3h
FF0h-FF1h
Highest
Priority
Vector #0
Non Maskable Interrupt
NOT USED
Vector #1 Port A
Vector #2 Port B, C
Vector #3 TIMER
Ext. Interrupt Port A
Ext. Interrupt Port B, C
Timer underflow
N/A
N/A
N/A
N/A
yes
yes
yes
no
Lowest
Priority
TSCR
ADCR
TMZ
EOC
Vector #4
ADC
End Of Conversion
32/105
1
ST6215C ST6225C
7 POWER SAVING MODES
7.1 INTRODUCTION
To give a large measure of flexibility to the applica-
tion in terms of power consumption, two main pow-
er saving modes are implemented in the ST6 (see
Figure 19).
Figure 19. Power Saving Mode Transitions
High
RUN
In addition, the Low Frequency Auxiliary Oscillator
(LFAO) can be used instead of the main oscillator
to reduce power consumption in RUN and WAIT
modes.
LFAO
WAIT
After a RESET the normal operating mode is se-
lected by default (RUN mode). This mode drives
the device (CPU and embedded peripherals) by
means of a master clock which is based on the
main oscillator frequency.
STOP
From Run mode, the different power saving
modes may be selected by calling the specific ST6
software instruction or for the LFAO by setting the
relevant register bit. For more information on the
LFAO, please refer to the Clock chapter.
Low
POWER CONSUMPTION
33/105
1
ST6215C ST6225C
7.2 WAIT MODE
The MCU goes into WAIT mode as soon as the
WAIT instruction is executed. This has the follow-
ing effects:
Figure 20. WAIT Mode Flowchart
OSCILLATOR
On
– Program execution is stopped, the microcontrol-
ler software can be considered as being in a “fro-
zen” state.
Clock to PERIPHERALS Yes
WAIT INSTRUCTION
Clock to CPU
No
– RAM contents and peripheral registers are pre-
served as long as the power supply voltage is
higher than the RAM retention voltage.
N
– The oscillator is kept running to provide a clock
to the peripherals; they are still active.
RESET
WAIT mode can be used when the user wants to
reduce the MCU power consumption during idle
periods, while not losing track of time or the ability
to monitor external events. WAIT mode places the
MCU in a low power consumption mode by stop-
ping the CPU. The active oscillator (main oscillator
or LFAO) is kept running in order to provide a clock
signal to the peripherals.
N
Y
INTERRUPT
Y
OSCILLATOR
Restart
If the power consumption has to be further re-
duced, the Low Frequency Auxiliary Oscillator
(LFAO) can be used in place of the main oscillator,
if its operating frequency is lower. If required, the
LFAO must be switched on before entering WAIT
mode.
Clock to PERIPHERALS Yes
Clock to CPU Yes
2048
CLOCK CYCLE
Exit from Wait mode
The MCU remains in WAIT mode until one of the
following events occurs:
DELAY
– RESET (Watchdog, LVD or RESET pin)
– A peripheral interrupt (timer, ADC,...),
OSCILLATOR
On
Clock to PERIPHERALS Yes
– An external interrupt (I/O port, NMI)
The Program Counter then branches to the start-
ing address of the interrupt or RESET service rou-
tine. Refer to Figure 20.
Clock to CPU
Yes
See also Section 7.4.1.
FETCH RESET VECTOR
OR SERVICE INTERRUPT
34/105
1
ST6215C ST6225C
7.3 STOP MODE
STOP mode is the lowest power consumption
mode of the MCU (see Figure 22).
The Program Counter then points to the starting
address of the interrupt or RESET service routine
(see Figure 21).
The MCU goes into STOP mode as soon as the
STOP instruction is executed. This has the follow-
ing effects:
STOP Mode and Watchdog
When the Watchdog is active (hardware or soft-
ware activation), the STOP instruction is disabled
and a WAIT instruction will be executed in its place
unless the EXCTNL option bit is set to 1 in the op-
tion bytes and a a high level is present on the NMI
pin. In this case, the STOP instruction will be exe-
cuted and the Watchdog will be frozen.
– Program execution is stopped, the microcontrol-
ler can be considered as being “frozen”.
– The contents of RAM and the peripheral regis-
ters are kept safely as long as the power supply
voltage is higher than the RAM retention voltage.
– The oscillator is stopped, so peripherals cannot
work except the those that can be driven by an
external clock.
Figure 21. STOP Mode Timing Overview
2048
Exit from STOP Mode
CLOCKCYCLE
RUN
STOP
RUN
DELAY
The MCU remains in STOP mode until one of the
following events occurs:
– RESET (Watchdog, LVD or RESET pin)
STOP
INSTRUCTION
– A peripheral interrupt (assuming this peripheral
can be driven by an external clock)
– An external interrupt (I/O port, NMI)
In all cases a delay of 2048 clock cycles (fINT) is
generated to make sure the oscillator has started
properly.
RESET
OR
INTERRUPT
FETCH
VECTOR
35/105
1
ST6215C ST6225C
STOP MODE (Cont’d)
Figure 22. STOP Mode Flowchart
STOP INSTRUCTION
ENABLE
WATCHDOG
DISABLE
1
EXCTNL
VALUE
1)
0
LEVEL
ON
OSCILLATOR
Off
1
2)
Clock to PERIPHERALS No
0
NMI PIN
Clock to CPU
No
N
RESET
OSCILLATOR
On
Clock to PERIPHERALS Yes
Clock to CPU No
N
3)
Y
INTERRUPT
Y
OSCILLATOR
Restart
Clock to PERIPHERALS Yes
Clock to CPU Yes
Y
N
RESET
2048
CLOCK CYCLE
N
DELAY
INTERRUPT
OSCILLATOR
On
Y
Clock to PERIPHERALS Yes
Clock to CPU Yes
FETCH RESET VECTOR
OR SERVICE INTERRUPT
Notes:
1. EXCTNL is an option bit. See option byte section for more details.
2. Peripheral clocked with an external clock source can still be active.
3. Only some specific interrupts can exit the MCU from STOP mode (such as external interrupt). Refer to
the Interrupt Mapping table for more details.
36/105
1
ST6215C ST6225C
7.4 NOTES RELATED TO WAIT AND STOP MODES
7.4.1 Exit from Wait and Stop Modes
7.4.1.1 NMI Interrupt
as soon as an interrupt occurs. Nevertheless, two
cases must be considered:
– If the interrupt is a normal one, the interrupt rou-
tine in which the WAIT or STOP mode was en-
tered will be completed, starting with the
execution of the instruction which follows the
STOP or the WAIT instruction, and the MCU is
still in interrupt mode. At the end of this routine
pending interrupts will be serviced according to
their priority.
It should be noted that when the GEN bit in the
IOR register is low (interrupts disabled), the NMI
interrupt is active but cannot cause a wake up from
STOP/WAIT modes.
7.4.1.2 Restart Sequence
When the MCU exits from WAIT or STOP mode, it
should be noted that the restart sequence de-
pends on the original state of the MCU (normal, in-
terrupt or non-maskable interrupt mode) prior to
entering WAIT or STOP mode, as well as on the
interrupt type.
– In the event of a non-maskable interrupt, the
non-maskable interrupt service routine is proc-
essed first, then the routine in which the WAIT or
STOP mode was entered will be completed by
executing the instruction following the STOP or
WAIT instruction. The MCU remains in normal in-
terrupt mode.
Normal Mode. If the MCU was in the main routine
when the WAIT or STOP instruction was execut-
ed, exit from Stop or Wait mode will occur as soon
as an interrupt occurs; the related interrupt routine
is executed and, on completion, the instruction
which follows the STOP or WAIT instruction is
then executed, providing no other interrupts are
pending.
7.4.2 Recommended MCU Configuration
For lowest power consumption during RUN or
WAIT modes, the user software must configure
the MCU as follows:
– Configure unused I/Os as output push-pull low
mode
Non Maskable Interrupt Mode. If the STOP or
WAIT instruction has been executed during execu-
tion of the non-maskable interrupt routine, the
MCU exits from Stop or Wait mode as soon as an
interrupt occurs: the instruction which follows the
STOP or WAIT instruction is executed, and the
MCU remains in non-maskable interrupt mode,
even if another interrupt has been generated.
– Place all peripherals in their power down modes
before entering STOP mode
– Select the Low Frequency Auxiliary Oscillator
(provided this runs at a lower frequency than the
main oscillator).
The WAIT and STOP instructions are not execut-
ed if an enabled interrupt request is pending.
Normal Interrupt Mode. If the MCU was in inter-
rupt mode before the STOP or WAIT instruction
was executed, it exits from STOP or WAIT mode
37/105
1
ST6215C ST6225C
8 I/O PORTS
8.1 INTRODUCTION
Each I/O port contains up to 8 pins. Each pin can
be programmed independently as digital input
(with or without pull-up and interrupt generation),
digital output (open drain, push-pull) or analog in-
put (when available).
All input lines can be individually connected by
software to the interrupt system by programming
the OR and DR registers accordingly. The inter-
rupt trigger modes (falling edge, rising edge and
low level) can be configured by software for each
port as described in the Interrupt section.
The I/O pins can be used in either standard or al-
ternate function mode.
8.2.2 Analog Inputs
Standard I/O mode is used for:
Some pins can be configured as analog inputs by
programming the OR and DR registers according-
ly, see Table 8. These analog inputs are connect-
ed to the on-chip 8-bit Analog to Digital Converter.
– Transfer of data through digital inputs and out-
puts (on specific pins):
– External interrupt generation
Caution: ONLY ONE pin should be programmed
as an analog input at any time, since by selecting
more than one input simultaneously their pins will
be effectively shorted.
Alternate function mode is used for:
– Alternate signal input/output for the on-chip
peripherals
8.2.3 Output Modes
The generic I/O block diagram is shown in Figure
23.
The output configuration is selected by setting the
corresponding DDR register bit. In this case, writ-
ing to the DR register applies this digital value to
the I/O pin through the latch. Then, reading the DR
register returns the previously stored value.
8.2 FUNCTIONAL DESCRIPTION
Each port is associated with 3 registers located in
Data space:
Two different output modes can be selected by
software through the OR register: push-pull and
open-drain.
– Data Register (DR)
– Data Direction Register (DDR)
– Option Register (OR)
DR register value and output pin status:
Each I/O pin may be programmed using the corre-
sponding register bits in the DDR, DR and OR reg-
isters: bit x corresponding to pin x of the port. Table
8 illustrates the various port configurations which
can be selected by user software.
DR
0
Push-pull
Open-drain
V
V
SS
SS
DD
1
V
Floating
Note: The open drain setting is not a true open
drain. This means it has the same structure as the
push-pull setting but the P-buffer is deactivated.
To avoid damaging the device, please respect the
During MCU initialization, all I/O registers are
cleared and the input mode with pull-up and no in-
terrupt generation is selected for all the pins, thus
avoiding pin conflicts.
V
absolute maximum rating described in the
OUT
Electrical Characteristics section.
8.2.1 Digital Input Modes
8.2.4 Alternate Functions
The input configuration is selected by clearing the
corresponding DDR register bit.
When an on-chip peripheral is configured to use a
pin, the alternate function (timer input/output...) is
not systematically selected but has to be config-
ured through the DDR, OR and DR registers. Re-
fer to the chapter describing the peripheral for
more details.
In this case, reading the DR register returns the
digital value applied to the external I/O pin.
Different input modes can be selected by software
through the DR and OR registers, see Table 8.
External Interrupt Function
38/105
1
ST6215C ST6225C
I/O PORTS (Cont’d)
Figure 23. I/O Port Block Diagram
PULL-UP
RESET
V
DD
V
DD
DATA
DIRECTION
REGISTER
V
DD
Pxx I/O Pin
DATA
REGISTER
ST6
INTERNAL
BUS
N-BUFFER
OPTION
REGISTER
P-BUFFER
CLAMPING
DIODES
CMOS
SCHMITT
TRIGGER
TO INTERRUPT
TO ADC
Table 8. I/O Port Configurations
DDR
OR
0
DR
0
Mode
Input
Option
0
0
0
0
1
1
With pull-up, no interrupt
No pull-up, no interrupt
0
1
Input
1
0
Input
With pull-up and with interrupt
Analog input (when available)
1
1
Input
0
x
Output
Output
Open-drain output (20mA sink when available)
Push-pull output (20mA sink when available)
1
x
Note: x = Don’t care
39/105
1
ST6215C ST6225C
I/O PORTS (Cont’d)
8.2.5 Instructions NOT to be used to access
Port Data registers (SET, RES, INC and DEC)
2. Handling Unused Port Bits
On ports that have less than 8 external pins con-
nected:
DO NOT USE READ-MODIFY-WRITE INSTRUC-
TIONS (SET, RES, INC and DEC) ON PORT
DATA REGISTERS IF ANY PIN OF THE PORT IS
CONFIGURED IN INPUT MODE.
– Leave the unbonded pins in reset state and do
not change their configuration.
– Do not use instructions that act on a whole port
register (INC, DEC, or read operations). Unavail-
able bits must be masked by software (AND in-
struction). Thus, when a read operation
performed on an incomplete port is followed by a
comparison, use a mask.
These instructions make an implicit read and write
back of the entire register. In port input mode,
however, the data register reads from the input
pins directly, and not from the data register latch-
es. Since data register information in input mode is
used to set the characteristics of the input pin (in-
terrupt, pull-up, analog input), these may be unin-
tentionally reprogrammed depending on the state
of the input pins.
3. High Impedance Input
On any CMOS device, it is not recommended to
connect high impedance on input pins. The choice
of these impedance has to be done with respect to
the maximum leakage current defined in the da-
tasheet. The risk is to be close or out of specifica-
tion on the input levels applied to the device.
As a general rule, it is better to only use single bit
instructions on data registers when the whole (8-
bit) port is in output mode. In the case of inputs or
of mixed inputs and outputs, it is advisable to keep
a copy of the data register in RAM. Single bit in-
structions may then be used on the RAM copy, af-
ter which the whole copy register can be written to
the port data register:
8.3 LOW POWER MODES
The WAIT and STOP instructions allow the
ST62xx to be used in situations where low power
consumption is needed. The lowest power con-
sumption is achieved by configuring I/Os in output
push-pull low mode.
SET bit, datacopy
LD a, datacopy
LD DRA, a
8.2.6 Recommendations
Mode
WAIT
STOP
Description
1. Safe I/O State Switching Sequence
No effect on I/O ports. External interrupts
cause the device to exit from WAIT mode.
Switching the I/O ports from one state to another
should be done in a sequence which ensures that
no unwanted side effects can occur. The recom-
mended safe transitions are illustrated in Figure 24
The Interrupt Pull-up to Input Analog transition
(and vice-vesra) is potentially risky and should be
avoided when changing the I/O operating mode.
No effect on I/O ports. External interrupts
cause the device to exit from STOP mode.
8.4 INTERRUPTS
The external interrupt event generates an interrupt
if the corresponding configuration is selected with
DDR, DR and OR registers (see Table 8) and the
GEN-bit in the IOR register is set.
Figure 24. Diagram showing Safe I/O State Transitions
Interrupt
Input
010*
011
001
pull-up
Analog
Input
000
pull-up (Reset
Input
state)
Output
Output
100
101
111
Open Drain
Open Drain
Output
Push-pull
Output
Push-pull
110
Note *. xxx = DDR, OR, DR Bits respectively
40/105
1
ST6215C ST6225C
I/O PORTS (Cont’d)
Table 9. I/O Port Option Selections
AVAILABLE
ON(1)
MODE
SCHEMATIC
V
V
V
DD
V
DD
Input
PA0-PA7
PB0-PB7
PC4-PC7
Data in
DDRx
0
ORx
0
DRx
1
Interrupt
Reset state
Input
DD
V
DD
PA0-PA7
PB0-PB7
PC4-PC7
with pull up
Data in
DDRx
0
ORx
0
DRx
0
Interrupt
Input
DD
V
DD
with pull up
with interrupt
PA0-PA7
PB0-PB7
PC4-PC7
Data in
DDRx
0
ORx
1
DRx
0
Interrupt
V
DD
Analog Input
PA4-PA7
PB0-PB7
PC4-PC7
ADC
DDRx
0
ORx
1
DRx
1
Open drain output (5mA) PA4-PA7
V
DD
P-buffer disconnected
PB0-PB7
PC4-PC7
Data out
Open drain output (20 mA) PA0-PA3
DDRx
1
ORx
0
DRx
0/1
Push-pull output (5mA) PA4-PA7
PB0-PB7
PC4-PC7
V
DD
Data out
Push-pull output (20 mA) PA0-PA3
DDRx
1
ORx
1
DRx
0/1
Note 1. Provided the correct configuration has been selected (see Table 8).
41/105
1
ST6215C ST6225C
I/O PORTS (Cont’d)
8.5 REGISTER DESCRIPTION
Bits 7:0 = DDR[7:0] Data direction register bits.
The DDR register gives the input/output direction
configuration of the pins. Each bit is set and
cleared by software.
DATA REGISTER (DR)
Port x Data Register
DRx with x = A, B or C.
Addresses 0C0h, 0C1h and 0C2h- Read/Write
0: Input mode
1: Output mode
Reset Value: 0000 0000 (00h)
OPTION REGISTER (OR)
7
0
Port x Option Register
ORx with x = A, B or C.
DR7
DR6
DR5
DR4
DR3
DR2
DR1
DR0
Addresses: 0CCh, 0CDh and 0CEh - Read/Write
Bits 7:0 = DR[7:0] Data register bits.
Reset Value: 0000 0000 (00h)
Reading the DR register returns either the DR reg-
ister latch content (pin configured as output) or the
digital value applied to the I/O pin (pin configured
as input).
7
0
OR7
OR6
OR5
OR4
OR3
OR2
OR1
OR0
Caution: In input mode, modifying this register will
modify the I/O port configuration (see Table 8).
Bits 7:0 = OR[7:0] Option register bits.
Do not use the Single bit instructions on I/O port
data registers. See (Section 8.2.5).
The OR register allows to distinguish in output
mode if the push-pull or open drain configuration is
selected.
Output mode:
DATA DIRECTION REGISTER (DDR)
0: Open drain output(with P-Buffer deactivated)
1: Push-pull Output
Port x Data Direction Register
DDRx with x = A, B or C.
Input mode: See Table 8.
Addresses: 0C4h, 0C5h and 0C6h - Read/Write
Each bit is set and cleared by software.
Caution: Modifying this register, will also modify
the I/O port configuration in input mode. (see Ta-
ble 8).
Reset Value: 0000 0000 (00h)
7
0
DDR7 DDR6 DDR5 DDR4 DDR3 DDR2 DDR1 DDR0
Table 10. I/O Port Register Map and Reset Values
Address
(Hex.)
Register
Label
7
6
5
4
3
2
1
0
Reset Value
of all I/O port registers
0
0
0
0
0
0
0
0
0C0h
0C1h
0C2h
0C4h
0C5h
0C6h
0CCh
0CDh
0CEh
DRA
DRB
MSB
MSB
MSB
LSB
LSB
LSB
DRC
DDRA
DDRB
DDRC
ORA
ORB
ORC
42/105
1
ST6215C ST6225C
9 ON-CHIP PERIPHERALS
9.1 WATCHDOG TIMER (WDG)
9.1.1 Introduction
9.1.2 Main Features
■ Programmable timer (64 steps of 3072 clock
The Watchdog timer is used to detect the occur-
rence of a software fault, usually generated by ex-
ternal interference or by unforeseen logical condi-
tions, which causes the application program to
abandon its normal sequence. The Watchdog cir-
cuit generates an MCU reset on expiry of a pro-
grammed time period, unless the program refresh-
es the counter’s contents before the SR bit be-
comes cleared.
cycles)
■ Software reset
■ Reset (if watchdog activated) when the SR bit
reaches zero
■ Hardware or software watchdog activation
selectable by option bit (Refer to the option
bytes section)
Figure 25. Watchdog Block Diagram
RESET
WATCHDOG REGISTER (WDGR)
T0
T5
SR
T1
C
T2
T4
T3
bit 7
bit 0
7-BIT DOWNCOUNTER
CLOCK DIVIDER
f
int /12
÷ 256
43/105
1
ST6215C ST6225C
WATCHDOG TIMER (Cont’d)
9.1.3 Functional Description
mode availability (refer to the description of the
WDACT and EXTCNTL bits on the Option Bytes).
The watchdog activation is selected through an
option in the option bytes:
When STOP mode is not required, hardware acti-
vation without EXTERNAL STOP MODE CON-
TROL should be preferred, as it provides maxi-
mum security, especially during power-on.
– HARDWARE Watchdog option
After reset, the watchdog is permanently active,
the C bit in the WDGR is forced high and the user
can not change it. However, this bit can be read
equally as 0 or 1.
When STOP mode is required, hardware activa-
tion and EXTERNAL STOP MODE CONTROL
should be chosen. NMI should be high by default,
to allow STOP mode to be entered when the MCU
is idle.
– SOFTWARE Watchdog option
After reset, the watchdog is deactivated. The func-
tion is activated by setting C bit in the WDGR reg-
ister. Once activated, it cannot be deactivated.
The counter value stored in the WDGR register
(bits SR:T0), is decremented every 3072 clock cy-
cles. The length of the timeout period can be pro-
grammed by the user in 64 steps of 3072 clock cy-
cles.
The NMI pin can be connected to an I/O line (see
Figure 26) to allow its state to be controlled by soft-
ware. The I/O line can then be used to keep NMI
low while Watchdog protection is required, or to
avoid noise or key bounce. When no more
processing is required, the I/O line is released and
the device placed in STOP mode for lowest power
consumption.
If the watchdog is activated (by setting the C bit)
and when the SR bit is cleared, the watchdog initi-
ates a reset cycle pulling the reset pin low for typi-
cally 500ns.
Figure 26. A typical circuit making use of the
EXERNAL STOP MODE CONTROL feature
The application program must write in the WDGR
register at regular intervals during normal opera-
tion to prevent an MCU reset. The value to be
stored in the WDGR register must be between
FEh and 02h (see Table 11). To run the watchdog
function the following conditions must be true:
SWITCH
NMI
– The C bit is set (watchdog activated)
I/O
– The SR bit is set to prevent generating an imme-
diate reset
– The T[5:0] bits contain the number of decre-
ments which represent the time delay before the
watchdog produces a reset.
VR02002
Table 11. Watchdog Timing (f
= 8 MHz)
OSC
2. When software activation is selected (WDACT
bit in Option byte) and the Watchdog is not activat-
ed, the downcounter may be used as a simple 7-
bit timer (remember that the bits are in reverse or-
der).
WDGR Register
initial value
WDG timeout period
(ms)
Max.
Min.
FEh
02h
24.576
0.384
9.1.3.1 Software Reset
The software activation option should be chosen
only when the Watchdog counter is to be used as
a timer. To ensure the Watchdog has not been un-
expectedly activated, the following instructions
should be executed:
The SR bit can be used to generate a software re-
set by clearing the SR bit while the C bit is set.
9.1.4 Recommendations
jrr 0, WDGR, #+3; If C=0,jump to next
1. The Watchdog plays an important supporting
role in the high noise immunity of ST62xx devices,
and should be used wherever possible. Watchdog
related options should be selected on the basis of
a trade-off between application security and STOP
ldi WDGR, 0FDH
next :
; SR=0 -> reset
44/105
1
ST6215C ST6225C
WATCHDOG TIMER (Cont’d)
These instructions test the C bit and reset the
MCU (i.e. disable the Watchdog) if the bit is set
(i.e. if the Watchdog is active), thus disabling the
Watchdog.
Note: This note applies only when the watchdog is
used as a standard timer. It is recommended to
read the counter twice, as it may sometimes return
an invalid value if the read is performed while the
counter is decremented (counter bits in transient
state). To validate the return value, both values
read must be equal. The counter decrements eve-
For more information on the use of the watchdog,
please read application note AN1015.
ry 384 µs at 8 MHz fOSC
.
9.1.5 Low Power Modes
Mode Description
WAIT No effect on Watchdog.
Behaviour depends on the EXTCNTL option in the Option bytes:
STOP
1. Watchdog disabled:
The MCU will enter Stop mode if a STOP instruction is executed.
2. Watchdog enabled and EXTCNTL option disabled:
If a STOP instruction is encountered, it is interpreted as a WAIT.
3. Watchdog and EXTCNTL option enabled:
If a STOP instruction is encountered when the NMI pin is low, it is interpreted as a WAIT. If, however, the
STOP instruction is encountered when the NMI pin is high, the Watchdog counter is frozen and the CPU en-
ters STOP mode.
When the MCU exits STOP mode (i.e. when an interrupt is generated), the Watchdog resumes its activity.
9.1.6 Interrupts
None.
45/105
1
ST6215C ST6225C
WATCHDOG TIMER (Cont’d)
9.1.7 Register Description
WATCHDOG REGISTER (WDGR)
Address: 0D8h - Read/Write
Reset Value: 1111 1110 (FEh)
Bit 0 = C Watchdog Control bit.
If the hardware option is selected (WDACT bit in
Option byte), this bit is forced high and cannot be
changed by the user (the Watchdog is always ac-
tive). When the software option is selected
(WDACT bit in Option byte), the Watchdog func-
tion is activated by setting the C bit, and cannot
then be deactivated (except by resetting the
MCU).
7
0
T0
T1
T2
T3
T4
T5
SR
C
When C is kept cleared the counter can be used
as a 7-bit timer.
Bits 7:2 = T[5:0] Downcounter bits
Caution: These bits are reversed and shifted with
respect to the physical counter: bit-7 (T0) is the
LSB of the Watchdog downcounter and bit-2 (T5)
is the MSB.
0: Watchdog deactivated
1: Watchdog activated
Bit 1 = SR: Software Reset bit
Software can generate a reset by clearing this bit
while the C bit is set. When C = 0 (Watchdog de-
activated) the SR bit is the MSB of the 7-bit timer.
0: Generate (write)
1: No software reset generated, MSB of 7-bit timer
46/105
1
ST6215C ST6225C
9.2 8-BIT TIMER
9.2.1 Introduction
9.2.2 Main Features
■ Time-out downcounting mode with up to 15-bit
The 8-Bit Timer on-chip peripheral is a free run-
ning downcounter based on an 8-bit downcounter
with a 7-bit programmable prescaler, giving a max-
accuracy
■ External counter clock source (valid also in
15
imum count of 2 . The peripheral may be config-
STOP mode)
ured in three different operating modes.
■ Interrupt capability on counter underflow
■ Output signal generation
■ External pulse length measurement
■ Event counter
The timer can be used in WAIT and STOP modes
to wake up the MCU.
Figure 27. Timer Block Diagram
TIMER
PIN
7
0
8-BIT DOWN COUNTER
f
f
INT/12
COUNTER
TCR
REGISTER
TCR7 TCR6 TCR5 TCR4 TCR3 TCR2 TCR1 TCR0
f
EXT
LATCH
7
0
TSCR
REGISTER
TMZ
ETI
TOUT DOUT
PSI
PS2
PS1
PS0
INTERRUPT
f
PRESCALER
PSCR REGISTER
PSCR6 PSCR5 PSCR4 PSCR3 PSCR2 PSCR1 PSCR0
7
0
PSCR7
/1
/128
/64
/32
/16
/8
/4
/2
PROGRAMMABLE PRESCALER
47/105
1
ST6215C ST6225C
8-BIT TIMER (Cont’d)
9.2.3 Counter/Prescaler Description
caler and the counter run at the rate of the select-
ed clock source.
Prescaler
Counter and Prescaler Initialization
The prescaler input can be the internal frequency
f
divided by 12 or an external clock applied to
After RESET, the counter and the prescaler are in-
itialized to 0FFh and 7Fh respectively.
INT
the TIMER pin. The prescaler decrements on the
rising edge, depending on the division factor pro-
grammed by the PS[2:0] bits in the TSCR register.
The 7-bit prescaler can be initialized to 7Fh by
clearing the PSI bit. Direct write access to the
prescaler is also possible when PSI =1. Then, any
value between 0 and 7Fh can be loaded into it.
The state of the 7-bit prescaler can be read in the
PSCR register.
When the prescaler reaches 0, it is automatically
reloaded with 7Fh.
The 8-bit counter can be initialized separately by
writing to the TCR register.
9.2.3.1 8-bit Counting and Interrupt Capability
on Counter Underflow
Counter
The free running 8-bit downcounter is fed by the
output of the programmable prescaler, and is dec-
remented on every rising edge of the f
clock signal coming from the prescaler.
Whatever the division factor defined for the pres-
caler, the Timer Counter works as an 8-bit down-
counter. The input clock frequency is user selecta-
ble using the PS[2:0] bits.
COUNTER
It is possible to read or write the contents of the
counter on the fly, by reading or writing the timer
counter register (TCR).
When the downcounter decrements to zero, the
TMZ (Timer Zero) bit in the TSCR is set. If the ETI
(Enable Timer Interrupt) bit in the TSCR is also
set, an interrupt request is generated.
When the downcounter reaches 0, it is automati-
cally reloaded with the value 0FFh.
The Timer interrupt can be used to exit the MCU
from WAIT or STOP mode.
Counter Clock and Prescaler
The TCR can be written at any time by software to
define a time period ending with an underflow
event, and therefore manage delay or timer func-
tions.
The counter clock frequency is given by:
PS[2:0]
f
= f
/ 2
COUNTER
PRESCALER
where f
can be:
PRESCALER
– f /12
TMZ is set when the downcounter reaches zero;
however, it may also be set by writing 00h in the
TCRregisterorbysettingbit7oftheTSCRregister.
INT
– f
(input on TIMER pin)
EXT
– f /12 gated by TIMER pin
INT
The TMZ bit must be cleared by user software
when servicing the timer interrupt to avoid unde-
sired interrupts when leaving the interrupt service
routine.
The timer input clock feeds the 7-bit programma-
ble prescaler. The prescaler output can be pro-
grammed by selecting one of the 8 available pres-
caler taps using the PS[2:0] bits in the Status/Con-
trol Register (TSCR). Thus the division factor of
the prescaler can be set to 2 (where n equals 0, to
7). See Figure 27.
Note: A write to the TCR register will predominate
over the 8-bit counter decrement to 00h function,
i.e. if a write and a TCR register decrement to 00h
occur simultaneously, the write will take prece-
dence, and the TMZ bit is not set until the 8-bit
counter underflows again.
n
The clock input is enabled by the PSI (Prescaler
Initialize) bit in the TSCR register. When PSI is re-
set, the counter is frozen and the prescaler is load-
ed with the value 7Fh. When PSI is set, the pres-
48/105
1
ST6215C ST6225C
8-BIT TIMER (Cont’d)
9.2.4 Functional Description
the DDR, OR and DR registers. For more details,
please refer to the I/O Ports section.
There are three operating modes, which are se-
lected by the TOUT and DOUT bits (see TSCR
register). These three modes correspond to the
two clocks which can be connected to the 7-bit
Figure 28. f
Clock in Gated Mode
TIMER
f
/12
INT
prescaler (f
÷ 12 or TIMER pin signal), and to
INT
the output mode.
f
PRESCALER
The settings for the different operating modes are
summarized Table 12.
TIMER
f
EXT
Table 12. Timer Operating Modes
Figure 29. Gated Mode Operation
Timer
Function
TOUT DOUT
Application
COUNTER VALUE
Event Counter External counter clock
VALUE 1
xx1
0
0
1
1
0
1
0
1
(input)
source
Gated input
(input)
External Pulse length
measurement
Output “0”
(output)
VALUE 2
xx2
Output signal
generation
Output “1”
(output)
TIMER PIN
1
PULSE LENGTH
9.2.4.1 Gated Mode
(TOUT = “0”, DOUT = “1”)
In this mode, the prescaler is decremented by the
Timer clock input, but only when the signal on the
TIMER pin is held high (f /12 gated by TIMER
INT
pin). See Figure 28 and Figure 29.
TIMER CLOCK
This mode is selected by clearing the TOUT bit in
the TSCR register (i.e. as input) and setting the
DOUT bit.
Note: In this mode, if the TIMER pin is multi-
plexed, the corresponding port control bits have to
be set in input with pull-up configuration through
49/105
1
ST6215C ST6225C
8-BIT TIMER (Cont’d)
9.2.4.2 Event Counter Mode
(TOUT = “0”, DOUT = “0”)
bit transition is used to latch the DOUT bit in the
TSCR and, if the TOUT bit is set, DOUT is trans-
ferredtotheTIMERpin.Thisoperatingmodeallows
external signal generation on the TIMER pin. See
Figure 33.
In this mode, the TIMER pin is the input clock of
the Timer prescaler which is decremented on eve-
ry rising edge of the input clock (allowing event
count). See Figure 30 and Figure 31.
This mode is selected by setting the TOUT bit in
the TSCR register (i.e. as output) and setting the
DOUT bit to output a high level or clearing the
DOUT bit to output a low level.
This mode is selected by clearing the TOUT bit in
the TSCR register (i.e. as input) and clearing the
DOUT bit.
Note: As soon as the TOUT bit is set, The timer
pin is configured as output push-pull regardless of
the corresponding I/O port control registers setting
(if the TIMER pin is multiplexed).
Note: In this mode, if the TIMER pin is multi-
plexed, the corresponding port control bits have to
be set in input with pull-up configuration.
Figure 30. f
Clock in Event Counter Mode
TIMER
Figure 32. Output Mode Control
f
TIMER
PRESCALER
TIMER
LATCH
Figure 31. Event Counter Mode Operation
TMZ
TOUT DOUT
COUNTER VALUE
VALUE 1
XX1
Figure 33. Output Mode Operation
Counter
FFh
VALUE 2
XX2
TIMER PIN
At each zero event
TIMER PIN
1
DOUT has to be
copied to the TIMER
pin
9.2.4.3 Output Mode
(TOUT = “1”, DOUT = “data out”)
In Output mode, the TIMER pin is connected to the
DOUT latch, hence the Timer prescaler is clocked
bytheprescalerclockinput(f /12).SeeFigure32.
INT
The user can select the prescaler division ratio us-
ingthePS[2:0]bitsintheTSCRregister.WhenTCR
decrements to zero, it sets the TMZ bit in the TSCR.
The TMZ bit can be tested under program control to
perform a timer function whenever it goes high and
has to be cleared by the user. The low-to-high TMZ
st
1
downcount:
Default output value is 0
50/105
1
ST6215C ST6225C
8-BIT TIMER (Cont’d)
9.2.5 Low Power Modes
9.2.6 Interrupts
Interrupt Event
Mode
Description
Exit
from
Wait
Exit
from
Stop
Event Enable
No effect on timer.
Timer interrupt events cause the device to
exit from WAIT mode.
Flag
Bit
WAIT
Timer Zero
Event
TMZ
ETI
Yes
Yes
Timer registers are frozen except in Event
Counter mode (with external clock on TIM-
ER pin).
STOP
51/105
1
ST6215C ST6225C
8-BIT TIMER (Cont’d)
9.2.7 Register Description
ETI=0 the timer interrupt is disabled. If ETI=1 and
TMZ=1 an interrupt request is generated.
0: Interrupt disabled (reset state)
1: Interrupt enabled
PRESCALER COUNTER REGISTER (PSCR)
Address: 0D2h - Read/Write
Reset Value: 0111 1111 (7Fh)
7
0
Bit 5 = TOUT Timer Output Control.
When low, this bit selects the input mode for the
TIMER pin. When high the output mode is select-
ed.
PSCR PSCR PSCR PSCR PSCR PSCR PSCR PSCR
0
7
6
5
4
3
2
1
0: Input mode (reset state)
Bit 7 = PSCR7: Not used, always read as “0”.
Bits 6:0 = PSCR[6:0] Prescaler LSB.
1: Output mode, the TIMER pin is configured as
push-pull output
TIMER COUNTER REGISTER (TCR)
Address: 0D3h - Read / Write
Bit 4 = DOUT Data Output.
Data sent to the timer output when TMZ is set high
(output mode only). Input mode selection (input
mode only).
Reset Value: 1111 1111 (FFh)
7
0
Bit 3 = PSI: Prescaler Initialize bit.
Used to initialize the prescaler and inhibit its count-
ing. When PSI=“0” the prescaler is set to 7Fh and
the counter is inhibited. When PSI=“1” the prescal-
er is enabled to count downwards. As long as
PSE=“1” both counter and prescaler are not run-
ning
TCR7 TCR6 TCR5 TCR4 TCR3 TCR2 TCR1 TCR0
Bits 7:0 = TCR[7:0] Timer counter bits.
TIMER STATUS CONTROL REGISTER (TSCR)
Address: 0D4h - Read/Write
Reset Value: 0000 0000 (00h)
0: Counting disabled
1: Counting enabled
7
0
Bits 1:0 = PS[2:0] Prescaler Mux. Select.
These bits select the division ratio of the prescaler
register.
TMZ
ETI
TOUT DOUT PSI
PS2
PS1
PS0
Bit 7 = TMZ Timer Zero bit.
Table 13. Prescaler Division Factors
A low-to-high transition indicates that the timer
count register has underflowed. It means that the
TCR value has changed from 00h to FFh.
This bit must be cleared by user software.
0: Counter has not underflowed
PS2
0
PS1
0
PS0
0
Divided by
1
2
4
0
0
1
0
1
0
1: Counter underflow occurred
0
1
1
8
1
1
1
1
0
0
1
1
0
1
0
1
16
32
64
128
Bit 6 = ETI Enable Timer Interrupt.
When set, enables the timer interrupt request. If
Table 14. 8-Bit Timer Register Map and Reset Values
Address
Register Label
7
6
5
4
3
2
1
0
(Hex.)
PSCR
Reset Value
PSCR7 PSCR6 PSCR5 PSCR4 PSCR3 PSCR2 PSCR1 PSCR0
0D2h
0
1
1
1
1
1
1
1
TCR
Reset Value
TSCR
Reset Value
TCR7
1
TMZ
0
TCR6
1
ETI
0
TCR5
1
TOUT
0
TCR4
1
DOUT
0
TCR3
1
PSI
0
TCR2
1
PS2
0
TCR1
1
PS1
0
TCR0
1
PS0
0
0D3h
0D4h
52/105
1
ST6215C ST6225C
9.3 A/D CONVERTER (ADC)
9.3.1 Introduction
9.3.2 Main Features
■ 8-bit conversion
The on-chip Analog to Digital Converter (ADC) pe-
ripheral is a 8-bit, successive approximation con-
verter. This peripheral has multiplexed analog in-
put channels (refer to device pin out description)
that allow the peripheral to convert the analog volt-
age levels from different sources.
■ Multiplexed analog input channels
■ Linear successive approximation
■ Data register (DR) which contains the results
■ End of Conversion flag
■ On/Off bit (to reduce consumption)
The result of the conversion is stored in a 8-bit
Data Register. The A/D converter is controlled
through a Control Register.
■ Typical conversion time 70 µs (with an 8 MHz
crystal)
The block diagram is shown in Figure 34.
Figure 34. ADC Block Diagram
f
f
ADC
INT
DIV 12
AD
CR0
AD
CR3
AD
CR1
OSC
OFF
EAI EOC STA PDS
ADCR
I/O PORT
AIN0
AIN1
ANALOG TO DIGITAL
CONVERTER
PORT
MUX
AINx
DDRx
ORx
ADR
ADR7 ADR6 ADR5 ADR4 ADR3 ADR2 ADR1 ADR0
DRx
53/105
1
ST6215C ST6225C
A/D CONVERTER (Cont’d)
9.3.3 Functional Description
9.3.3.4 Software Procedure
9.3.3.1 Analog Power Supply
Refer to the Control register (ADCR) and Data reg-
ister (ADR) in Section 9.3.7 for the bit definitions.
The high and low level reference voltage pins are
internally connected to the V and V pins.
Analog Input Configuration
DD
SS
Conversion accuracy may therefore be impacted
by voltage drops and noise in the event of heavily
loaded or badly decoupled power supply lines.
The analog input must be configured through the
Port Control registers (DDRx, ORx and DRx). Re-
fer to the I/O port chapter.
9.3.3.2 Digital A/D Conversion Result
ADC Configuration
The conversion is monotonic, meaning that the re-
sult never decreases if the analog input does not
and never increases if the analog input does not.
In the ADCR register:
– Reset the PDS bit to power on the ADC. This bit
must be set at least one instruction before the
beginning of the conversion to allow stabilisation
of the A/D converter.
If the input voltage (V ) is greater than or equal
AIN
to V
(high-level voltage reference) then the
DDA
conversion result in the DR register is FFh (full
scale) without overflow indication.
– Set the EAI bit to enable the ADC interrupt if
needed.
If input voltage (V ) is lower than or equal to
AIN
ADC Conversion
V
(low-level voltage reference) then the con-
SSA
In the ADCR register:
version result in the DR register is 00h.
– Set the STA bit to start a conversion. This auto-
matically clears (resets to “0”) the End Of Con-
version Bit (EOC).
The A/D converter is linear and the digital result of
the conversion is stored in the ADR register. The
accuracy of the conversion is described in the par-
ametric section.
When a conversion is complete
R
is the maximum recommended impedance
– The EOC bit is set by hardware to flag that con-
version is complete and that the data in the ADC
data conversion register is valid.
AIN
for an analog input signal. If the impedance is too
high, this will result in a loss of accuracy due to
leakage and sampling not being completed in the
allocated time. Refer to the electrical characteris-
tics chapter for more details.
– An interrupt is generated if the EAI bit was set
Setting the STA bit will start a new count and will
clear the EOC bit (thus clearing the interrupt con-
dition)
With an oscillator clock frequency less than
1.2MHz, conversion accuracy is decreased.
Note:
9.3.3.3 Analog Input Selection
Setting the STA bit must be done by a different in-
struction from the instruction that powers-on the
ADC (setting the PDS bit) in order to make sure
the voltage to be converted is present on the pin.
Selection of the input pin is done by configuring
the related I/O line as an analog input via the Data
Direction, Option and Data registers (refer to I/O
ports description for additional information).
Each conversion has to be separately initiated by
writing to the STA bit.
Caution: Only one I/O line must be configured as
an analog input at any time. The user must avoid
any situation in which more than one I/O pin is se-
lected as an analog input simultaneously, because
they will be shorted internally.
The STA bit is continuously scanned so that, if the
user sets it to “1” while a previous conversion is in
progress, a new conversion is started before com-
pleting the previous one. The start bit (STA) is a
write only bit, any attempt to read it will show a log-
ical “0”.
54/105
1
ST6215C ST6225C
A/D CONVERTER (Cont’d)
9.3.4 Recommendations
bances and power supply variations due to output
switching. Nevertheless, the WAIT instruction
should be executed as soon as possible after the
beginning of the conversion, because execution of
the WAIT instruction may cause a small variation
The following six notes provide additional informa-
tion on using the A/D converter.
1.The A/D converter does not feature a sample
and hold circuit. The analog voltage to be meas-
ured should therefore be stable during the entire
conversion cycle. Voltage variation should not ex-
ceed 1/2 LSB for optimum conversion accuracy.
A low pass filter may be used at the analog input
pins to reduce input voltage variation during con-
version.
of the V voltage. The negative effect of this var-
DD
iation is minimized at the beginning of the conver-
sion when the converter is less sensitive, rather
than at the end of conversion, when the least sig-
nificant bits are determined.
The best configuration, from an accuracy stand-
point, is WAIT mode with the Timer stopped. In
this case only the ADC peripheral and the oscilla-
tor are then still working. The MCU must be woken
up from WAIT mode by the ADC interrupt at the
end of the conversion. The microcontroller can
also be woken up by the Timer interrupt, but this
means the Timer must be running and the result-
ing noise could affect conversion accuracy.
2. When selected as an analog channel, the input
pin is internally connected to a capacitor C of
ad
typically 9pF. For maximum accuracy, this capaci-
tor must be fully charged at the beginning of con-
version. In the worst case, conversion starts one
instruction (6.5 µs) after the channel has been se-
lected. The impedance of the analog voltage
source (ASI) in worst case conditions, is calculat-
ed using the following formula:
Caution: When an I/O pin is used as an analog in-
6.5µs = 9 x C x ASI
ad
put, A/D conversion accuracy will be impaired if
(capacitor charged to over 99.9%), i.e. 30 kΩ in-
negative current injections (V < V ) occur from
INJ
SS
cluding a 50% guardband.
adjacent I/O pins with analog input capability. Re-
fer to Figure 35. To avoid this:
The ASI can be higher if C has been charged for
ad
a longer period by adding instructions before the
start of conversion (adding more than 26 CPU cy-
cles is pointless).
– Use another I/O port located further away from
the analog pin, preferably not multiplexed on the
A/D converter
3. Since the ADC is on the same chip as the micro-
processor, the user should not switch heavily load-
ed output signals during conversion, if high preci-
sion is required. Such switching will affect the sup-
ply voltages used as analog references.
– Increase the input resistance R
current injections) and reduce R
conversion accuracy).
(to reduce the
ADC
IN J
(to preserve
Figure 35. Leakage from Digital Inputs
4. Conversion accuracy depends on the quality of
the power supplies (V and V ). The user must
DD
SS
take special care to ensure a well regulated refer-
ence voltage is present on the V and V pins
DD
SS
(power supply voltage variations must be less than
0.1V/ms). This implies, in particular, that a suitable
Digital
Input
decoupling capacitor is used at the V pin.
DD
The converter resolution is given by:
PBy/AINy
R
I/O Port
INJ
(Digital I/O)
V
– V
DD
SS
-------------------------------
256
V
INJ
Leakage Current
if V < V
INJ
SS
The Input voltage (Ain) which is to be converted
must be constant for 1µs before conversion and
remain constant during conversion.
Analog
Input
PBx/AINx
R
5. Conversion resolution can be improved if the
power supply voltage (V ) to the microcontroller
ADC
A/D
Converter
DD
is lowered.
V
AIN
6. In order to optimize the conversion resolution,
the user can configure the microcontroller in WAIT
mode, because this mode minimises noise distur-
55/105
1
ST6215C ST6225C
A/D CONVERTER (Cont’d)
9.3.5 Low Power Modes
cally cleared when the STA bit is set. Data in the
data conversion register are valid only when this
bit is set to “1”.
Mode
Description
0: Conversion is not complete
No effect on A/D Converter. ADC interrupts
cause the device to exit from Wait mode.
WAIT
STOP
1: Conversion can be read from the ADR register
A/D Converter disabled.
Bit 5 = STA: Start of Conversion. Write Only.
0: No effect
1: Start conversion
Note: The A/D converter may be disabled by clear-
ing the PDS bit. This feature allows reduced power
consumption when no conversion is needed.
Note: Setting this bit automatically clears the EOC
bit. If the bit is set again when a conversion is in
progress, the present conversion is stopped and a
new one will take place. This bit is write only, any
attempt to read it will show a logical zero.
9.3.6 Interrupts
Exit
from
Wait
Exit
from
Stop
Event Enable
Interrupt Event
Flag
Bit
Bit 4 = PDS Power Down Selection.
End of Conver-
sion
EOC
EAI
Yes
No
0: A/D converter is switched off
1: A/D converter is switched on
Note: The EOC bit is cleared only when a new
conversion is started (it cannot be cleared by writ-
ing 0). To avoid generating further EOC interrupt,
the EAI bit has to be cleared within the ADC inter-
rupt subroutine.
Bit 3 = ADCR3 Reserved, must be cleared.
Bit 2 = OSCOFF Main Oscillator off.
9.3.7 Register Description
0: Main Oscillator enabled
1: Main Oscillator disabled
A/D CONVERTER CONTROL REGISTER (AD-
CR)
Note: This bit does not apply to the ADC peripher-
al but to the main clock system. Refer to the Clock
System section.
Address: 0D1h - Read/Write (Bit 6 Read Only, Bit
5 Write Only)
Reset value: 0100 0000 (40h)
7
0
Bits 1:0 = ADCR[1:0] Reserved, must be cleared.
ADCR OSC ADCR ADCR
EAI
EOC
STA
PDS
3
OFF
1
0
A/D CONVERTER DATA REGISTER (ADR)
Address: 0D0h - Read only
Bit 7 = EAI Enable A/D Interrupt.
0: ADC interrupt disabled
1: ADC interrupt enabled
Reset value: xxxx xxxx (xxh)
7
0
Bit 6 = EOC End of conversion. Read Only
ADR7 ADR6 ADR5 ADR4 ADR3 ADR2 ADR1 ADR0
When a conversion has been completed, this bit is
set by hardware and an interrupt request is gener-
ated if the EAI bit is set. The EOC bit is automati-
Bits 7:0 = ADR[7:0]: 8 Bit A/D Conversion Result.
Table 15. ADC Register Map and Reset Values
Address
(Hex.)
Register
Label
7
6
5
4
3
2
1
0
ADR
Reset Value
ADR7
0
ADR6
0
ADR5
0
ADR4
0
ADR3
0
ADR2
0
ADR1
0
ADR0
0
0D0h
0D1h
ADCR
Reset Value
EAI
0
EOC
1
STA
0
PDS
0
ADCR3 OSCOFF ADCR1
ADCR0
0
0
0
0
56/105
1
ST6215C ST6225C
10 INSTRUCTION SET
10.1 ST6 ARCHITECTURE
The ST6 architecture has been designed for max-
imum efficiency while keeping byte usage to a
minimum; in short, to provide byte-efficient pro-
gramming. The ST6 core has the ability to set or
clear any register or RAM location bit in Data
space using a single instruction. Furthermore, pro-
grams can branch to a selected address depend-
ing on the status of any bit in Data space.
tended addressing mode are able to branch to any
address in the 4 Kbyte Program space.
Extended addressing mode instructions are two
bytes long.
Program Counter Relative. Relative addressing
mode is only used in conditional branch instruc-
tions. The instruction is used to perform a test and,
if the condition is true, a branch with a span of -15
to +16 locations next to the address of the relative
instruction. If the condition is not true, the instruc-
tion which follows the relative instruction is execut-
ed. Relative addressing mode instructions are one
byte long. The opcode is obtained by adding the
three most significant bits which characterize the
test condition, one bit which determines whether it
is a forward branch (when it is 0) or backward
branch (when it is 1) and the four least significant
bits which give the span of the branch (0h to Fh)
which must be added or subtracted from the ad-
dress of the relative instruction to obtain the
branch destination address.
10.2 ADDRESSING MODES
The ST6 has nine addressing modes, which are
described in the following paragraphs. Three dif-
ferent address spaces are available: Program
space, Data space, and Stack space. Program
space contains the instructions which are to be ex-
ecuted, plus the data for immediate mode instruc-
tions. Data space contains the Accumulator, the X,
Y, V and W registers, peripheral and Input/Output
registers, the RAM locations and Data ROM loca-
tions (for storage of tables and constants). Stack
space contains six 12-bit RAM cells used to stack
the return addresses for subroutines and inter-
rupts.
Bit Direct. In bit direct addressing mode, the bit to
be set or cleared is part of the opcode, and the
byte following the opcode points to the address of
the byte in which the specified bit must be set or
cleared. Thus, any bit in the 256 locations of Data
space memory can be set or cleared.
Immediate. In immediate addressing mode, the
operand of the instruction follows the opcode loca-
tion. As the operand is a ROM byte, the immediate
addressing mode is used to access constants
which do not change during program execution
(e.g., a constant used to initialize a loop counter).
Bit Test & Branch. Bit test and branch addressing
mode is a combination of direct addressing and
relative addressing. Bit test and branch instruc-
tions are three bytes long. The bit identification
and the test condition are included in the opcode
byte. The address of the byte to be tested is given
in the next byte. The third byte is the jump dis-
placement, which is in the range of -127 to +128.
This displacement can be determined using a la-
bel, which is converted by the assembler.
Direct. In direct addressing mode, the address of
the byte which is processed by the instruction is
stored in the location which follows the opcode. Di-
rect addressing allows the user to directly address
the 256 bytes in Data Space memory with a single
two-byte instruction.
Short Direct. The core can address the four RAM
registers X, Y, V, W (locations 80h, 81h, 82h, 83h)
in short-direct addressing mode. In this case, the
instruction is only one byte and the selection of the
location to be processed is contained in the op-
code. Short direct addressing is a subset of direct
addressing mode. (Note that 80h and 81h are also
indirect registers).
Indirect. In indirect addressing mode, the byte
processed by the register-indirect instruction is at
the address pointed to by the content of one of the
indirect registers, X or Y (80h, 81h). The indirect
register is selected by bit 4 of the opcode. Register
indirect instructions are one byte long.
Extended. In extended addressing mode, the 12-
bit address needed to define the instruction is ob-
tained by concatenating the four least significant
bits of the opcode with the byte following the op-
code. The instructions (JP, CALL) which use ex-
Inherent. In inherent addressing mode, all the in-
formation necessary for executing the instruction
is contained in the opcode. These instructions are
one byte long.
57/105
1
ST6215C ST6225C
10.3 INSTRUCTION SET
The ST6 offers a set of 40 basic instructions
which, when combined with nine addressing
modes, yield 244 usable opcodes. They can be di-
vided into six different types: load/store, arithme-
tic/logic, conditional branch, control instructions,
jump/call, and bit manipulation. The following par-
agraphs describe the different types.
Load & Store. These instructions use one, two or
three bytes depending on the addressing mode.
For LOAD, one operand is the Accumulator and
the other operand is obtained from data memory
using one of the addressing modes.
For Load Immediate, one operand can be any of
the 256 data space bytes while the other is always
immediate data.
All the instructions belonging to a given type are
presented in individual tables.
Table 16. Load & Store Instructions
Flags
Instruction
LD A, X
Addressing Mode
Short Direct
Bytes
Cycles
Z
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
*
C
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
1
1
1
1
1
1
1
1
2
2
1
1
1
1
2
3
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
LD A, Y
LD A, V
LD A, W
LD X, A
LD Y, A
Short Direct
Short Direct
Short Direct
Short Direct
Short Direct
Short Direct
Short Direct
Direct
LD V, A
LD W, A
LD A, rr
LD rr, A
Direct
LD A, (X)
LD A, (Y)
LD (X), A
LD (Y), A
LDI A, #N
LDI rr, #N
Indirect
Indirect
Indirect
Indirect
Immediate
Immediate
Legend:
X, Y Index Registers,
V, W Short Direct Registers
#
rr
Δ
*
Immediate data (stored in ROM memory)
Data space register
Affected
Not Affected
58/105
1
ST6215C ST6225C
INSTRUCTION SET (Cont’d)
Arithmetic and Logic. These instructions are
used to perform arithmetic calculations and logic
operations. In AND, ADD, CP, SUB instructions
one operand is always the accumulator while, de-
pending on the addressing mode, the other can be
either a data space memory location or an imme-
diate value. In CLR, DEC, INC instructions the op-
erand can be any of the 256 data space address-
es. In COM, RLC, SLA the operand is always the
accumulator.
Table 17. Arithmetic & Logic Instructions
Flags
Instruction
ADD A, (X)
Addressing Mode
Indirect
Bytes
Cycles
Z
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
*
C
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
*
1
1
2
2
1
1
2
2
2
3
1
1
1
2
2
1
1
1
1
2
2
1
1
1
1
1
1
2
2
1
1
1
2
1
1
2
2
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
ADD A, (Y)
ADD A, rr
ADDI A, #N
AND A, (X)
AND A, (Y)
AND A, rr
ANDI A, #N
CLR A
Indirect
Direct
Immediate
Indirect
Indirect
Direct
Immediate
Short Direct
Direct
CLR r
COM A
Inherent
Indirect
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
Δ
*
CP A, (X)
CP A, (Y)
CP A, rr
CPI A, #N
DEC X
Indirect
Direct
Immediate
Short Direct
Short Direct
Short Direct
Short Direct
Direct
DEC Y
*
DEC V
*
DEC W
*
DEC A
*
DEC rr
Direct
*
DEC (X)
DEC (Y)
INC X
Indirect
*
Indirect
*
Short Direct
Short Direct
Short Direct
Short Direct
Direct
*
INC Y
*
INC V
*
INC W
*
INC A
*
INC rr
Direct
*
INC (X)
Indirect
*
INC (Y)
Indirect
*
RLC A
Inherent
Inherent
Indirect
Δ
Δ
Δ
Δ
Δ
Δ
SLA A
SUB A, (X)
SUB A, (Y)
SUB A, rr
SUBI A, #N
Indirect
Direct
Immediate
Notes:
X,Y Index Registers
V, W Short Direct Registers
#
*
Immediate data (stored in ROM memory)
Not Affected
Δ
Affected
rr Data space register
59/105
1
ST6215C ST6225C
INSTRUCTION SET (Cont’d)
Conditional Branch. Branch instructions perform
a branch in the program when the selected condi-
tion is met.
Control Instructions. Control instructions control
microcontroller operations during program execu-
tion.
Bit Manipulation Instructions. These instruc-
tions can handle any bit in Data space memory.
One group either sets or clears. The other group
(see Conditional Branch) performs the bit test
branch operations.
Jump and Call. These two instructions are used
to perform long (12-bit) jumps or subroutine calls
to any location in the whole program space.
Table 18. Conditional Branch Instructions
Flags
Instruction
Branch If
Bytes
Cycles
Z
*
*
*
*
*
*
C
*
JRC e
C = 1
1
1
1
1
3
3
2
2
2
2
5
5
JRNC e
C = 0
Z = 1
*
JRZ e
*
JRNZ e
Z = 0
*
JRR b, rr, ee
JRS b, rr, ee
Bit = 0
Bit = 1
Δ
Δ
Notes:
b
e
3-bit address
rr
Δ
*
Data space register
Affected. The tested bit is shifted into carry.
Not Affected
5 bit signed displacement in the range -15 to +16
ee 8 bit signed displacement in the range -126 to +129
Table 19. Bit Manipulation Instructions
Flags
Instruction
Addressing Mode
Bytes
Cycles
Z
C
*
SET b,rr
Bit Direct
Bit Direct
2
2
4
4
*
*
RES b,rr
*
Notes:
b
3-bit address
Data space register
*
Not Affected
rr
Bit Manipulation Instructions should not be used on Port Data Registers and any registers with read only and/or write only bits (see I/O port
chapter)
Table 20. Control Instructions
Flags
Instruction
Addressing Mode
Bytes
Cycles
Z
*
C
*
NOP
Inherent
Inherent
Inherent
Inherent
Inherent
1
1
1
1
1
2
2
2
2
2
RET
*
*
RETI
STOP
WAIT
Δ
*
Δ
*
(1)
*
*
Notes:
1.
This instruction is deactivated and a WAIT is automatically executed instead of a STOP if the watchdog function is selected.
Δ
Affected
*Not Affected
Table 21. Jump & Call Instructions
Flags
Instruction
Addressing Mode
Bytes
Cycles
Z
*
C
*
CALL abc
Extended
Extended
2
2
4
4
JP abc
*
*
Notes:
abc 12-bit address
*
Not Affected
60/105
1
ST6215C ST6225C
Opcode Map Summary. The following table contains an opcode map for the instructions used by the ST6
LOW
LOW
0
1
2
0010
3
0011
4
0100
5
0101
6
0110
7
0111
0000
0001
HI
HI
2
JRNZ 4
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
ext 1
CALL 2
abc
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
pcr 3
JRNC 5
e
JRR 2
b0,rr,ee
bt 1
JRS 2
b0,rr,ee
bt 1
JRR 2
b4,rr,ee
JRZ
e NOP
pcr
2
JRC 4
LD
0
0
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
#
x
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
a,(x)
a,nn
0000
0000
1
2
pcr 2
JRNZ 4
1
prc 1
JRC 4
ind
LDI
JRZ 4
INC 2
1
1
e
e
0001
0001
1
2
pcr 2
JRNZ 4
pcr 1
JRZ
sd 1
2
prc 2
JRC 4
imm
CP
2
2
#
a,(x)
0010
0010
1
2
pcr 2
JRNZ 4
bt 1
JRS 2
pcr
JRZ 4
1
prc 1
JRC 4
ind
CPI
LD 2
3
3
b4,rr,ee
e
bt 1
a,x
#
a,nn
0011
0011
1
2
pcr 2
JRNZ 4
pcr 1
JRZ
sd 1
2
prc 2
JRC 4
imm
ADD
a,(x)
JRR 2
b2,rr,ee
bt 1
JRS 2
b2,rr,ee
bt 1
JRR 2
b6,rr,ee
bt 1
JRS 2
b6,rr,ee
bt 1
JRR 2
b1,rr,ee
bt 1
JRS 2
b1,rr,ee
bt 1
JRR 2
b5,rr,ee
bt 1
JRS 2
b5,rr,ee
bt 1
JRR 2
b3,rr,ee
bt 1
JRS 2
b3,rr,ee
bt 1
JRR 2
b7,rr,ee
bt 1
JRS 2
b7,rr,ee
4
4
e
e
e
e
e
e
e
e
e
e
e
e
0100
0100
1
2
pcr 2
JRNZ 4
pcr
JRZ 4
1
prc 1
JRC 4
ind
ADDI
INC 2
5
5
y
a,nn
0101
0101
1
2
pcr 2
JRNZ 4
pcr 1
JRZ
sd 1
2
prc 2
JRC 4
imm
INC
6
6
#
(x)
#
0110
0110
1
2
pcr 2
JRNZ 4
pcr
JRZ 4
1
prc 1
JRC
ind
LD 2
7
7
a,y
#
0111
0111
1
2
pcr 2
JRNZ 4
pcr 1
JRZ
sd 1
2
prc
JRC 4
LD
ind
8
8
(x),a
#
1000
1000
1
2
pcr 2
JRNZ 4
pcr
JRZ 4
1
prc 1
JRC
INC 2
9
9
v
1001
1001
1
2
pcr 2
JRNZ 4
pcr 1
JRZ
sd 1
2
prc
JRC 4
AND
a,(x)
A
1010
A
1010
#
1
2
pcr 2
JRNZ 4
pcr
JRZ 4
1
prc 1
JRC 4
ind
ANDI
LD 2
B
1011
B
1011
a,v
#
a,nn
1
2
pcr 2
JRNZ 4
pcr 1
JRZ
sd 1
2
prc 2
JRC 4
imm
SUB
C
1100
C
1100
a,(x)
1
2
pcr 2
JRNZ 4
pcr
JRZ 4
1
prc 1
JRC 4
ind
SUBI
INC 2
D
1101
D
1101
w
a,nn
1
2
pcr 2
JRNZ 4
pcr 1
JRZ
sd 1
2
prc 2
JRC 4
imm
DEC
E
1110
E
1110
#
(x)
#
1
2
pcr 2
JRNZ 4
pcr
JRZ 4
1
prc 1
JRC
ind
LD 2
F
1111
F
1111
a,w
1
pcr 2
ext 1
pcr 3
bt 1
pcr 1
sd 1
prc
Abbreviations for Addressing Modes: Legend:
dir
sd
Direct
Short Direct
#
e
b
rr
nn
Indicates Illegal Instructions
5-bit Displacement
3-bit Address
1-byte Data space address
1-byte immediate data
Mnemonic
2
e
1
Cycles
JRC
prc
imm Immediate
Operands
Bytes
inh
ext
b.d
bt
Inherent
Extended
Bit Direct
Bit Test
abc 12-bit address
ee 8-bit displacement
Addressing Mode
pcr
ind
Program Counter Relative
Indirect
61/105
1
ST6215C ST6225C
Opcode Map Summary (Continued)
LOW
LOW
8
9
A
1010
B
1011
C
1100
D
1101
E
1110
F
1111
1000
1001
HI
HI
2
JRNZ 4
JP 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
pcr 2
JRNC 4
e
RES 2
b0,rr
b.d 1
SET 2
b0,rr
b.d 1
RES 2
b4,rr
JRZ 4
LDI 2
JRC 4
LD
0
0
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
abc
e
e
e
rr,nn
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
e
a,(y)
a,rr
0000
0000
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 3
JRZ 4
imm 1
DEC 2
prc 1
JRC 4
ind
LD
1
1
x
0001
0001
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 4
sd 1
COM 2
prc 2
JRC 4
dir
CP
2
2
a
a,(y)
a,rr
0010
0010
1
2
pcr 2
JRNZ 4
ext 1
JP 2
b.d 1
SET 2
pcr
JRZ 4
1
prc 1
JRC 4
ind
CP
LD 2
3
3
b4,rr
e
b.d 1
x,a
0011
0011
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 2
sd 1
RETI 2
prc 2
JRC 4
dir
ADD
a,(y)
RES 2
b2,rr
b.d 1
SET 2
b2,rr
b.d 1
RES 2
b6,rr
b.d 1
SET 2
b6,rr
b.d 1
RES 2
b1,rr
b.d 1
SET 2
b1,rr
b.d 1
RES 2
b5,rr
b.d 1
SET 2
b5,rr
b.d 1
RES 2
b3,rr
b.d 1
SET 2
b3,rr
b.d 1
RES 2
b7,rr
b.d 1
SET 2
b7,rr
4
4
e
e
e
e
e
e
e
e
e
e
e
e
0100
0100
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 4
inh 1
DEC 2
prc 1
JRC 4
ind
ADD
5
5
y
a,rr
(y)
rr
0101
0101
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 2
sd 1
STOP 2
prc 2
JRC 4
dir
INC
6
6
0110
0110
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 4
inh 1
LD 2
prc 1
JRC 4
ind
INC
7
7
y,a
0111
0111
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ
sd 1
2
prc 2
JRC 4
dir
LD
8
8
#
v
(y),a
rr,a
1000
1000
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr
JRZ 4
1
prc 1
JRC 4
ind
LD
DEC 2
9
9
1001
1001
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 4
sd 1
RCL 2
prc 2
JRC 4
dir
AND
a,(y)
A
1010
A
1010
a
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 4
inh 1
LD 2
prc 1
JRC 4
ind
AND
B
1011
B
1011
v,a
a,rr
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 2
sd 1
RET 2
prc 2
JRC 4
dir
SUB
C
1100
C
1100
a,(y)
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 4
inh 1
DEC 2
prc 1
JRC 4
ind
SUB
D
1101
D
1101
w
a,rr
(y)
rr
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 2
sd 1
WAIT 2
prc 2
JRC 4
dir
DEC
E
1110
E
1110
1
2
pcr 2
JRNZ 4
ext 1
JP 2
pcr 1
JRZ 4
inh 1
LD 2
prc 1
JRC 4
ind
DEC
F
1111
F
1111
w,a
1
pcr 2
ext 1
pcr 2
b.d 1
pcr 1
sd 1
prc 2
dir
Abbreviations for Addressing Modes: Legend:
dir
sd
Direct
Short Direct
#
e
b
rr
nn
Indicates Illegal Instructions
5-bit Displacement
3-bit Address
1-byte Data space address
1-byte immediate data
2
e
1
Mnemonic
Cycles
Operands
Bytes
JRC
prc
imm Immediate
inh
ext
b.d
bt
Inherent
Extended
Bit Direct
Bit Test
abc 12-bit address
ee 8-bit Displacement
Addressing Mode
pcr
ind
Program Counter Relative
Indirect
62/105
1
ST6215C ST6225C
11 ELECTRICAL CHARACTERISTICS
11.1 PARAMETER CONDITIONS
Unless otherwise specified, all voltages are re-
Figure 36. Pin Loading Conditions
ferred to V
.
SS
11.1.1 Minimum and Maximum Values
Unless otherwise specified the minimum and max-
imum values are guaranteed in the worst condi-
tions of ambient temperature, supply voltage and
frequencies by tests in production on 100% of the
ST6 PIN
C
L
devices with an ambient temperature at T =25°C
A
and T =T max (given by the selected temperature
A
A
range).
Data based on characterization results, design
simulation and/or technology characteristics are
indicated in the table footnotes and are not tested
in production. Based on characterization, the min-
imum and maximum values refer to sample tests
and represent the mean value plus or minus three
times the standard deviation (mean 3Σ).
11.1.5 Pin Input Voltage
The input voltage measurement on a pin of the de-
vice is described in Figure 37.
Figure 37. Pin Input Voltage
11.1.2 Typical Values
Unless otherwise specified, typical data are based
ST6 PIN
on T =25°C, V =5V (for the 4.5V≤V ≤6.0V
A
DD
DD
voltage range) and
V
=3.3V (for the
DD
3V≤V ≤3.6V voltage range). They are given only
DD
V
IN
as design guidelines and are not tested.
11.1.3 Typical Curves
Unless otherwise specified, all typical curves are
given only as design guidelines and are not tested.
11.1.4 Loading Capacitor
The loading conditions used for pin parameter
measurement is shown in Figure 36.
63/105
1
ST6215C ST6225C
11.2 ABSOLUTE MAXIMUM RATINGS
Stresses above those listed as “absolute maxi-
mum ratings” may cause permanent damage to
the device. This is a stress rating only and func-
tional operation of the device under these condi-
tions is not implied. Exposure to maximum rating
conditions for extended periods may affect device
reliability.
11.2.1 Voltage Characteristics
Symbol
Ratings
Maximum value
7
Unit
V
- V
Supply voltage
DD
SS
1) & 2)
V
Input voltage on any pin
Output voltage on any pin
VSS-0.3 to VDD+0.3
VSS-0.3 to VDD+0.3
3500
IN
V
1) & 2)
V
OUT
V
Electro-static discharge voltage (Human Body Model)
ESD(HBM)
11.2.2 Current Characteristics
Symbol
Ratings
Maximum value
Unit
3)
3)
I
Total current into V power lines (source)
80
100
20
40
15
±5
VDD
DD
I
Total current out of V ground lines (sink)
SS
VSS
Output current sunk by any standard I/O and control pin
Output current sunk by any high sink I/O pin
Output current source by any I/Os and control pin
Injected current on RESET pin
I
mA
IO
2) & 4)
I
INJ(PIN)
Injected current on any other pin
±5
11.2.3 Thermal Characteristics
Symbol
Ratings
Value
Unit
T
Storage temperature range
-60 to +150
°C
STG
Maximum junction temperature
(see THERMAL CHARACTERISTICS section)
T
J
Notes:
1. Directly connecting the RESET and I/O pins to V or V could damage the device if an unintentional internal reset
DD
SS
is generated or an unexpected change of the I/O configuration occurs (for example, due to a corrupted program coun-
ter). To guarantee safe operation, this connection has to be done through a pull-up or pull-down resistor (typical: 4.7kΩ
for RESET, 10kΩ for I/Os). Unused I/O pins must be tied in the same way to V or V according to their reset con-
DD
SS
figuration.
2. When the current limitation is not possible, the V absolute maximum rating must be respected, otherwise refer to
IN
I
specification. A positive injection is induced by V >V while a negative injection is induced by V <V
.
SS
INJ(PIN)
IN
DD
IN
3. Power (V ) and ground (V ) lines must always be connected to the external supply.
DD
SS
4. Negative injection disturbs the analog performance of the device. In particular, it induces leakage currents throughout
the device including the analog inputs. To avoid undesirable effects on the analog functions, care must be taken:
- Analog input pins must have a negative injection less than 1mA (assuming that the impedance of the analog voltage
is lower than the specified limits).
- Pure digital pins must have a negative injection less than 1mA. In addition, it is recommended to inject the current as
far as possible from the analog input pins.
64/105
1
ST6215C ST6225C
11.3 OPERATING CONDITIONS
11.3.1 General Operating Conditions
Symbol
Parameter
Supply voltage
Conditions
see Figure 38
Min
Max
6
Unit
3.0
V
V
DD
1)
V
V
V
V
=3.0V, 1 & 6 Suffix
=3.0V, 3 Suffix
0
4
DD
DD
1)
0
4
f
Oscillator frequency
MHz
OSC
1)
=3.6V, 1 & 6Suffix
=3.6V, 3 Suffix
0
8
DD
1)
0
4
DD
f
f
f
f
=4MHz, 1 & 6 Suffix
=4MHz, 3 Suffix
3.0
3.0
3.6
4.5
0
6.0
6.0
6.0
6.0
70
85
125
OSC
OSC
OSC
OSC
V
Operating Supply Voltage
Ambient temperature range
V
DD
=8MHz, 1 & 6 Suffix
=8MHz, 3 Suffix
1 Suffix Version
6 Suffix Version
3 Suffix Version
-40
-40
T
°C
A
Notes:
1. An oscillator frequency above 1.2MHz is recommended for reliable A/D results.
2. Operating conditions with T =-40 to +125°C.
A
Figure 38. f
Maximum Operating Frequency Versus V Supply Voltage for OTP & ROM devices
DD
OSC
f
[MHz]
OSC
1 & 6 suffix version
8
7
6
5
4
3
2
1
3 suffix version
3
f
OSG
2
f
Min
OSG
1
SUPPLY
VOLTAGE (V
2.5
)
DD
3
3.6
4
4.5
5
5.5
6
1. In this area, operation is guaranteed at the quartz crystal frequency.
2. When the OSG is disabled, operation in this area is guaranteed at the crystal frequency. When the
OSG is enabled, operation in this area is guaranteed at a frequency of at least f Min.
OSG
3. When the OSG is disabled, operation in this area is guaranteed at the quartz crystal frequency. When
the OSG is enabled, access to this area is prevented. The internal frequency is kept at f
.
OSG
65/105
1
ST6215C ST6225C
OPERATING CONDITIONS (Cont’d)
11.3.2 Operating Conditions with Low Voltage Detector (LVD)
Subject to general operating conditions for V , f
, and T .
A
DD OSC
Conditions
1)
Symbol
Parameter
Min
Typ
Max
Unit
Reset release threshold
3.9
4.1
4.3
V
IT+
(V rise)
DD
V
Reset generation threshold
3.6
50
3.8
4
V
V
IT-
(V fall)
DD
LVD voltage threshold hysteresis
V
-V
IT+ IT-
300
700
mV
mV/s
ns
hys
2)
Vt
V
rise time rate
DD
POR
3)
t
Filtered glitch delay on V
Not detected by the LVD
30
g(VDD)
DD
Notes:
1. LVD typical data are based on T =25°C. They are given only as design guidelines and are not tested.
A
2. The minimum V rise time rate is needed to insure a correct device power-on and LVD reset. Not tested in production.
DD
3. Data based on characterization results, not tested in production.
3)
Figure 39. LVD Threshold Versus V and f
DD
OSC
FUNCTIONALITY
NOT GUARANTEED
IN THIS AREA
f
[MHz]
OSC
8
4
DEVICE UNDER
RESET
IN THIS AREA
FUNCTIONAL AREA
SUPPLY
VOLTAGE [V]
0
V
≥3.6
IT-
2.5
3
3.5
4
4.5
5
5.5
6
Figure 40. Typical LVD Thresholds Versus
Temperature for OTP devices
Figure 41. Typical LVD thresholds vs.
Temperature for ROM devices
Thresholds [V]
4.2
Thresholds [V]
4.2
4
4
V
IT+
VVdd up
IT+
V
IT-
V
3.8
3.6
3.8
3.6
IT-
-40°C
25°C
95°C
125°C
-40°C
25°C
95°C
125°C
T [°C]
T [°C]
66/105
1
ST6215C ST6225C
11.4 SUPPLY CURRENT CHARACTERISTICS
The following current consumption specified for
the ST6 functional operating modes over tempera-
ture range does not take into account the clock
source current consumption. To get the total de-
vice consumption, the two current values must be
added (except for STOP mode for which the clock
is stopped).
11.4.1 RUN Modes
1)
2)
Symbol
Parameter
Conditions
Typ
Max
Unit
0.5
1.3
1.6
2.2
3.3
0.7
1.7
2.4
3.3
4.8
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
3)
3)
Supply current in RUN mode
(see Figure 42 & Figure 43)
I
mA
DD
0.3
0.6
0.9
1.0
1.8
0.4
0.8
1.2
1.5
2.3
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
Supply current in RUN mode
(see Figure 42 & Figure 43)
Notes:
1. Typical data are based on T =25°C, V =5V (4.5V≤V ≤6.0V range) and V =3.3V (3V≤V ≤3.6V range).
A
DD
DD
DD
DD
2. Data based on characterization results, tested in production at V max. and f
max.
DD
OSC
3. CPU running with memory access, all I/O pins in input with pull-up mode (no load), all peripherals in reset state; clock
input (OSC ) driven by external square wave, OSG and LVD disabled, option bytes not programmed.
IN
Figure 42. Typical I in RUN vs. f
Figure 43. Typical I in RUN vs. Temperature
DD
DD
DD
CPU
(V = 5V)
IDD [mA]
5
IDD [mA]
3.5
8MHz
4MHz
2MHz
1MHz
32KHz
3
2.5
2
4
3
2
1
0
8MHz
4MHz
2MHz
1MHz
32KHz
1.5
1
0.5
0
3
4
5
6
-40
25
95
125
VDD [V]
T[°C]
67/105
1
ST6215C ST6225C
SUPPLY CURRENT CHARACTERISTICS (Cont’d)
11.4.2 WAIT Modes
1)
2)
Symbol
Parameter
Conditions
Typ
330
Max
Unit
550
600
650
700
800
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
3)
Supply current in WAIT mode
Option bytes not programmed
(see Figure 44)
350
370
410
480
18
26
41
57
70
60
80
120
180
200
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
3)
Supply current in WAIT mode
Option bytes programmed to 00H
(see Figure 45)
190
210
240
280
350
300
350
400
500
600
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
3)
Supply current in WAIT mode
(see Figure 46)
I
µA
DD
80
90
100
120
150
120
140
150
200
250
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
3)
Supply current in WAIT mode
Option bytes not programmed
(see Figure 44)
5
8
16
18
20
30
40
50
60
100
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
3)
Supply current in WAIT mode
Option bytes programmed to 00H
(see Figure 45)
60
65
80
100
130
100
110
120
150
210
f
f
f
f
f
=32kHz
=1MHz
=2MHz
=4MHz
=8MHz
OSC
OSC
OSC
OSC
OSC
3)
Supply current in WAIT mode
Option bytes not programmed
(see Figure 46)
Notes:
1. Typical data are based on T =25°C, V =5V (4.5V≤V ≤6.0V range) and V =3.3V (3V≤V ≤3.6V range).
A
DD
DD
DD
DD
2. Data based on characterization results, tested in production at V max. and f
max.
DD
OSC
3. All I/O pins in input with pull-up mode (no load), all peripherals in reset state; clock input (OSC ) driven by external
IN
square wave, OSG and LVD disabled.
68/105
1
ST6215C ST6225C
SUPPLY CURRENT CHARACTERISTICS (Cont’d)
Figure 44. Typical I
programmed
in WAIT vs f
and Temperature for OTP devices with option bytes not
DD
CPU
IDD [µA]
IDD [µA]
700
800
8MHz
1M
8MHz
4MHz
2MHz
1MHz
700
600
500
400
300
200
100
0
4MHz
2MHz
32KHz
32KHz
600
500
400
300
200
3
4
5
6
-40
25
95
125
VDD [V]
T[°C]
Figure 45. Typical I
programmed to 00H
in WAIT vs f
and Temperature for OTP devices with option bytes
DD
CPU
IDD [µA]
IDD [µA]
90
120
8MHz
1M
8MHz
4MHz
2MHz
1MHz
4MHz
32KHz
80
70
60
50
40
30
20
10
32KHz
100
2MHz
80
60
40
20
0
3
4
5
6
-20
25
95
VDD [V]
T[°C]
69/105
1
ST6215C ST6225C
SUPPLY CURRENT CHARACTERISTICS (Cont’d)
Figure 46. Typical I in WAIT vs f
and Temperature for ROM devices
DD
CPU
IDD [µA]
IDD [µA]
600
450
400
350
300
250
200
150
100
8MHz
4MHz
2MHz
1M
8MHz
4MHz
2MHz
1MHz
32KHz
32KHz
500
400
300
200
100
0
3
4
5
6
-20
25
95
125
VDD [V]
T[°C]
70/105
1
ST6215C ST6225C
SUPPLY CURRENT CHARACTERISTICS (Cont’d)
11.4.3 STOP Mode
1)
Symbol
Parameter
Conditions
Typ
Max
Unit
3)
10
20
OTP devices
ROM devices
0.3
4)
2)
Supply current in STOP mode
(see Figure 47 & Figure 48)
I
μA
DD
3)
2
0.1
4)
20
Notes:
1. Typical data are based on V =5.0V at T =25°C.
DD
A
2. All I/O pins in input with pull-up mode (no load), all peripherals in reset state, OSG and LVD disabled, option bytes
programmed to 00H. Data based on characterization results, tested in production at V max. and f
max.
CPU
DD
3. Maximum STOP consumption for -40°C<Ta<90°C
4. Maximum STOP consumption for -40°C<Ta<125°C
Figure 47. Typical I in STOP vs Temperature
Figure 48. Typical I in STOP vs Temperature
DD
DD
for OTP devices
for ROM devices
IDD [nA]
IDD [nA]
1200
Ta=-40°C
Ta=25°C
Ta=95°C
Ta=-40°C
Ta=25°C
Ta=95°C
Ta=125°C
Ta=125°C
1500
1000
500
0
1000
800
600
400
200
0
3
4
5
6
3
4
5
6
VDD [V]
VDD [V]
71/105
1
ST6215C ST6225C
SUPPLY CURRENT CHARACTERISTICS (Cont’d)
11.4.4 Supply and Clock System
The previous current consumption specified for
the ST6 functional operating modes over tempera-
ture range does not take into account the clock
source current consumption. To get the total de-
vice consumption, the two current values must be
added (except for STOP mode).
1)
2)
Symbol
Parameter
Conditions
=32 kHz,
Typ
Max
Unit
f
f
f
f
f
OSC
OSC
OSC
OSC
OSC
=1 MHz
=2 MHz
=4 MHz
=8 MHz
230
260
340
480
V
V
V
V
=5.0 V
=3.3 V
=5.0 V
=3.3 V
DD
DD
DD
DD
Supply current of RC oscillator
f
f
f
f
f
=32 kHz,
=1 MHz
=2 MHz
=4 MHz
=8 MHz
OSC
OSC
OSC
OSC
OSC
80
110
180
320
I
DD(CK)
f
f
f
f
f
=32 kHz,
=1 MHz
=2 MHz
=4 MHz
=8MHz
900
280
240
140
40
OSC
OSC
OSC
OSC
OSC
μA
Supply current of resonator oscillator
f
f
f
f
f
=32 kHz,
=1 MHz
=2 MHz
=4 MHz
=8 MHz
120
70
50
20
10
OSC
OSC
OSC
OSC
OSC
3)
I
LFAO supply current
V
V
V
=5.0 V
=5.0 V
=5.0 V
102
40
DD(LFAO)
DD
DD
DD
4)
I
OSG supply current
DD(OSG)
5)
I
LVD supply current
170
DD(LVD)
11.4.5 On-Chip Peripherals
Symbol
1)
Parameter
Conditions
Typ
Unit
V
V
V
V
=5.0 V
170
100
80
DD
DD
DD
DD
6)
I
8-bit Timer supply current
f
f
=8 MHz
=8 MHz
DD(TIM)
OSC
OSC
=3.3 V
=5.0 V
=3.3 V
µA
7)
I
ADC supply current when converting
DD(ADC)
50
Notes:
1. Typical data are based on T =25°C.
A
2. Data based on characterization results, not tested in production.
3. Data based on a differential I measurement between reset configuration (OSG and LFAO disabled) and LFAO run-
DD
ning (also includes the OSG stand alone consumption).
4. Data based on a differential I measurement between reset configuration with OSG disabled and OSG enabled.
DD
5. Data based on a differential I measurement between reset configuration with LVD disabled and LVD enabled.
DD
6. Data based on a differential I measurement between reset configuration (timer disabled) and timer running.
DD
7. Data based on a differential I measurement between reset configuration and continuous A/D conversions.
DD
72/105
1
ST6215C ST6225C
11.5 CLOCK AND TIMING CHARACTERISTICS
Subject to general operating conditions for V , f
, and T .
DD OSC
A
11.5.1 General Timings
1)
Symbol
Parameter
Conditions
Min
2
Typ
4
Max
5
Unit
tCPU
μs
t
Instruction cycle time
c(INST)
f
f
=8 MHz
3.25
6
6.5
8.125
11
CPU
2)
tCPU
μs
Interrupt reaction time
t
v(IT)
t
= Δt
+ 6
=8 MHz
9.75
17.875
v(IT)
c(INST)
CPU
11.5.2 External Clock Source
Symbol
Parameter
OSC input pin high level voltage
Conditions
See Figure 49
≤V ≤V
Min
Typ
Max
Unit
V
V
0.7xV
V
DD
OSCINH
IN
DD
SS
V
OSC input pin low level voltage
V
0.3xV
2
OSCINL
IN
DD
I
OSCx Input leakage current
V
μA
L
SS
IN
DD
Notes:
1. Data based on typical application software.
2. Time measured between interrupt event and interrupt vector fetch. Δtc(INST) is the number of tCPU cycles needed to finish
the current instruction execution.
Figure 49. Typical Application with an External Clock Source
90%
V
V
OSCINH
OSCINL
10%
OSC
OUT
Not connected
f
OSC
EXTERNAL
CLOCK SOURCE
I
L
OSC
IN
ST62XX
73/105
1
ST6215C ST6225C
CLOCK AND TIMING CHARACTERISTICS (Cont’d)
11.5.3 Crystal and Ceramic Resonator Oscillators
The ST6 internal clock can be supplied with sever-
al different Crystal/Ceramic resonator oscillators.
Only parallel resonant crystals can be used. All the
information given in this paragraph are based on
characterization results with specified typical ex-
ternal components. Refer to the crystal/ceramic
resonator manufacturer for more details (frequen-
cy, package, accuracy...).
Symbol
Parameter
Conditions
Typ
Unit
R
Feedback resistor
3
MΩ
F
120
47
33
33
22
f
f
f
f
f
=32 kHz,
OSC
OSC
OSC
OSC
OSC
=1 MHz
=2 MHz
=4 MHz
=8 MHz
C
C
Recommended load capacitances versus equiva-
lent crystal or ceramic resonator frequency
L1
L2
pF
Typical Crystal or Ceramic Resonators
C
C
L2
t
L1
SU(osc)
1)
Oscillator
1)
[ms]
[pF] [pF]
220 220
100 100
47 47
47 47
15 15
Reference
CSB455E
Freq.
455KHz
1MHz
2MHz
4MHz
8MHz
Characteristic
Δf
Δf
Δf
Δf
Δf
=[ 0.5KHz
=[ 0.5KHz
, 0.3% , 0.5%
]
]
OSC
OSC
OSC
OSC
OSC
tolerance
tolerance
ΔTa
aging
aging
CSB1000J
, 0.3% , 0.5%
ΔTa
CSTCC2.00MG0H6
CSTCC4.00MG0H6
CSTCC8.00MG
=[ 0.5%
=[ 0.5%
=[ 0.5%
, 0.5% , 0.3%
]
]
]
tolerance
tolerance
tolerance
ΔTa
aging
aging
aging
, 0.3% , 0.3%
ΔTa
, 0.3% , 0.3%
ΔTa
Notes:
1. Resonator characteristics given by the crystal/ceramic resonator manufacturer.
2. t is the typical oscillator start-up time measured between V =2.8V and the fetch of the first instruction (with a
SU(OSC)
DD
quick V ramp-up from 0 to 5V (<50μs).
DD
3. The oscillator selection can be optimized in terms of supply current using an high quality resonator with small R value.
S
Refer to crystal/ceramic resonator manufacturer for more details.
Figure 50. Typical Application with a Crystal or Ceramic Resonator
V
DD
C
C
L1
OSC
IN
RESONATOR
R
F
F
OSC
OSC
OUT
L2
ST62XX
74/105
1
ST6215C ST6225C
CLOCK AND TIMING CHARACTERISTICS (Cont’d)
11.5.4 RC Oscillator
The ST6 internal clock can be supplied with an external RC oscillator. Depending on the RNET value, the
accuracy of the frequency is about 20%, so it may not be suitable for some applications.
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
MHz
kΩ
R
R
R
R
R
=22 kΩ
=47 kΩ
=100 kΩ
=220 kΩ
=470 kΩ
7.2
5.1
3.2
1.8
0.9
8.6
5.7
3.4
1.9
0.95
10
6.5
3.8
2
NET
NET
NET
NET
NET
1.1
1)
f
RC oscillator frequency
OSC
R
R
R
R
R
=22 kΩ
=47 kΩ
=100 kΩ
=220 kΩ
=470 kΩ
3.7
2.8
1.8
1
4.3
3
1.9
1.1
0.55
4.9
3.3
2
1.2
0.6
NET
NET
NET
NET
NET
0.5
2)
R
RC Oscillator external resistor
see Figure 52 & Figure 53
22
870
NET
Notes:
1. Data based on characterization results, not tested in production. These measurements were done with the OSCin pin
unconnected (only soldered on the PCB).
2. R
must have a positive temperature coefficient (ppm/°C), carbon resistors should therefore not be used.
NET
Figure 51. Typical Application with RC Oscillator
V
V
DD
DD
EXTERNAL RC
OSC
OUT
MIRROR
CURRENT
R
NET
V
DD
f
OSC
OSC
NC
IN
CEX~9pF DISCHARGE
ST62XX
75/105
1
ST6215C ST6225C
CLOCK AND TIMING CHARACTERISTICS (Cont’d)
Figure 52. Typical RC Oscillator frequency vs.
DD
Figure 53. Typical RC Oscillator frequency vs.
Temperature (V = 5V)
V
DD
Rnet=22KOhm
Rnet=22KOhm
Rnet=47KOhm
Rnet=100KOhm
Rnet=220KOhm
Rnet=470KOhm
fosc [MHz]
12
fosc [MHz]
Rnet=47KOhm
Rnet=100KOhm
Rnet=220KOhm
Rnet=470KOhm
10
8
10
8
6
6
4
4
2
2
0
3
0
4
5
6
-40
25
95
125
VDD [V]
Ta [°C]
11.5.5 Oscillator Safeguard (OSG) and Low Frequency Auxiliary Oscillator (LFAO)
Symbol
Parameter
Conditions
Min
200
86
4
Typ
350
150
Max
800
340
Unit
T =25° C, V =5.0 V
Low Frequency Auxiliary Oscillator
A
DD
f
f
kHz
1)
LFAO
Frequency
T =25° C, V =3.3 V
A
DD
T =25° C, V =4.5 V
Internal Frequency with OSG ena-
bled
A
DD
MHz
OSG
T =25° C, V =3.3 V
2
A
DD
Figure 54. Typical LFAO Frequencies
fosc [kHz]
600
Ta=-40°C
Ta=25°C
Ta=125°C
500
400
300
200
100
0
3
4
5
6
VDD [V]
Note:
1. Data based on characterization results.
76/105
1
ST6215C ST6225C
11.6 MEMORY CHARACTERISTICS
Subject to general operating conditions for V , f
, and T unless otherwise specified.
DD OSC
A
11.6.1 RAM and Hardware Registers
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
1)
V
Data retention
0.7
V
RM
11.6.2 EPROM Program Memory
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
2)
3)
t
Data retention
T =+55°C
10
years
ret
A
Figure 55. EPROM Retention Time vs. Temperature
Retention time [Years]
100000
10000
1000
100
10
1
0.1
-40 -30 -20 -10
0
10 20 30 40 50 60 70 80 90 100 110 120
Temperature [°C]
Notes:
1. Minimum V supply voltage without losing data stored in RAM (in STOP mode or under RESET) or in hardware reg-
DD
isters (only in STOP mode). Guaranteed by construction, not tested in production.
2. Data based on reliability test results and monitored in production. For OTP devices, data retention and programmability
must be guaranteed by a screening procedure. Refer to Application Note AN886.
3. The data retention time increases when the T decreases, see Figure 55.
A
77/105
1
ST6215C ST6225C
11.7 EMC CHARACTERISTICS
Susceptibility tests are performed on a sample ba-
sis during product characterization.
■ ESD: Electro-Static Discharge (positive and
negative) is applied on all pins of the device until
a functional disturbance occurs. This test
conforms with the IEC 1000-4-2 standard.
11.7.1 Functional EMS
(Electro Magnetic Susceptibility)
■ FTB: A Burst of Fast Transient voltage (positive
Based on a simple running application on the
product (toggling 2 LEDs through I/O ports), the
product is stressed by two electro magnetic events
until a failure occurs (indicated by the LEDs).
and negative) is applied to V and V through
DD
SS
a 100pF capacitor, until a functional disturbance
occurs. This test conforms with the IEC 1000-4-
4 standard.
A device reset allows normal operations to be re-
sumed.
1)
1)
Symbol
Parameter
Conditions
=5V, T =+25°C, f
conforms to IEC 1000-4-2
Neg
Pos
Unit
Voltage limits to be applied on any I/O pin
to induce a functional disturbance
V
=8MHz
OSC
DD
A
V
-2
2
FESD
kV
Fast transient voltage burst limits to be ap-
V
=5V, T =+25°C, f
=8MHz
OSC
DD
A
V
plied through 100pF on V and V pins
-2.5
3
FFTB
DD
DD
conforms to IEC 1000-4-4
to induce a functional disturbance
Notes:
1. Data based on characterization results, not tested in production.
2. The suggested 10 µF and 0.1 µF decoupling capacitors on the power supply lines are proposed as a good price vs.
EMC performance tradeoff. They have to be put as close as possible to the device power supply pins. Other EMC rec-
ommendations are given in other sections (I/Os, RESET, OSCx pin characteristics).
2)
Figure 56. EMC Recommended Star Network Power Supply Connection
ST62XX
V
DD
10 µF 0.1 µF
V
V
DD
SS
ST6
POWER
SUPPLY
SOURCE
DIGITAL NOISE
FILTERING
(close to the MCU)
78/105
1
ST6215C ST6225C
EMC CHARACTERISTICS (Cont’d)
11.7.2 Absolute Electrical Sensitivity
– S1 switches position from generator to R.
Based on three different tests (ESD, LU and DLU)
using specific measurement methods, the product
is stressed in order to determine its performance in
terms of electrical sensitivity. For more details, re-
fer to the AN1181 application note.
– A discharge from C through R (body resistance)
L
to the ST6 occurs.
– S2 must be closed 10 to 100ms after the pulse
delivery period to ensure the ST6 is not left in
charge state. S2 must be opened at least 10ms
prior to the delivery of the next pulse.
11.7.2.1 Electro-Static Discharge (ESD)
Electro-Static Discharges (3 positive then 3 nega-
tive pulses separated by 1 second) are applied to
the pins of each sample according to each pin
combination. The sample size depends of the
number of supply pins of the device (3 parts*(n+1)
supply pin). Two models are usually simulated:
Human Body Model and Machine Model. This test
conforms to the JESD22-A114A/A115A standard.
See Figure 57 and the following test sequences.
Machine Model Test Sequence
– C is loaded through S1 by the HV pulse gener-
L
ator.
– S1 switches position from generator to ST6.
– A discharge from C to the ST6 occurs.
L
– S2 must be closed 10 to 100ms after the pulse
delivery period to ensure the ST6 is not left in
charge state. S2 must be opened at least 10ms
prior to the delivery of the next pulse.
Human Body Model Test Sequence
– C is loaded through S1 by the HV pulse gener-
– R (machine resistance), in series with S2, en-
sures a slow discharge of the ST6.
L
ator.
Absolute Maximum Ratings
1)
Symbol
Ratings
Conditions
Maximum value
Unit
Electro-static discharge voltage
(Human Body Model)
T =+25°C
V
2000
A
ESD(HBM)
V
Electro-static discharge voltage
(Machine Model)
T =+25°C
V
200
A
ESD(MM)
Notes:
1. Data based on characterization results, not tested in production.
Figure 57. Typical Equivalent ESD Circuits
S1
R=1500Ω
S1
HIGH VOLTAGE
PULSE
GENERATOR
HIGH VOLTAGE
PULSE
GENERATOR
ST6
ST6
C =100pF
S2
L
S2
C =200pF
L
HUMAN BODY MODEL
MACHINE MODEL
79/105
1
ST6215C ST6225C
EMC CHARACTERISTICS (Cont’d)
11.7.2.2 Static and Dynamic Latch-Up
■ DLU: Electro-Static Discharges (one positive
then one negative test) are applied to each pin
of 3 samples when the micro is running to
assess the latch-up performance in dynamic
mode. Power supplies are set to the typical
values, the oscillator is connected as near as
possible to the pins of the micro and the
component is put in reset mode. This test
conforms to the IEC1000-4-2 and SAEJ1752/3
standards and is described in Figure 58. For
more details, refer to the AN1181 application
note.
■ LU: 3 complementary static tests are required
on 10 parts to assess the latch-up performance.
A supply overvoltage (applied to each power
supply pin), a current injection (applied to each
input, output and configurable I/O pin) and a
power supply switch sequence are performed
on each sample. This test conforms to the EIA/
JESD 78 IC latch-up standard. For more details,
refer to the AN1181 application note.
Electrical Sensitivities
1)
Symbol
LU
Parameter
Static latch-up class
Dynamic latch-up class
Conditions
Class
T =+25°C
A
A
A
T =+85°C
A
V
=5V, f
=4MHz, T =+25°C
DLU
A
DD
OSC A
Notes:
1. Class description: A Class is an STMicroelectronics internal specification. All its limits are higher than the JEDEC spec-
ifications, that means when a device belongs to Class A it exceeds the JEDEC standard. B Class strictly covers all the
JEDEC criteria (international standard).
2. Schaffner NSG435 with a pointed test finger.
Figure 58. Simplified Diagram of the ESD Generator for DLU
R
=50MΩ
R =330Ω
D
CH
DISCHARGE TIP
V
V
DD
SS
HV RELAY
C =150pF
S
ST6
ESD
GENERATOR
2)
DISCHARGE
RETURN CONNECTION
80/105
1
ST6215C ST6225C
EMC CHARACTERISTICS (Cont’d)
11.7.3 ESD Pin Protection Strategy
Standard Pin Protection
To protect an integrated circuit against Electro-
Static Discharge the stress must be controlled to
prevent degradation or destruction of the circuit el-
ements. The stress generally affects the circuit el-
ements which are connected to the pads but can
also affect the internal devices when the supply
pads receive the stress. The elements to be pro-
tected must not receive excessive current, voltage
or heating within their structure.
To protect the output structure the following ele-
ments are added:
– A diode to V (3a) and a diode from V (3b)
DD
SS
– A protection device between V and V (4)
DD
SS
To protect the input structure the following ele-
ments are added:
– A resistor in series with the pad (1)
– A diode to V (2a) and a diode from V (2b)
DD
SS
An ESD network combines the different input and
output ESD protections. This network works, by al-
lowing safe discharge paths for the pins subjected
to ESD stress. Two critical ESD stress cases are
presented in Figure 59 and Figure 60 for standard
pins.
– A protection device between V and V (4)
DD
SS
Figure 59. Positive Stress on a Standard Pad vs. V
SS
V
V
DD
DD
(3a)
(3b)
(2a)
(1)
(4)
OUT
IN
Main path
(2b)
Path to avoid
V
V
V
SS
SS
DD
Figure 60. Negative Stress on a Standard Pad vs. V
DD
V
DD
(3a)
(3b)
(2a)
(1)
(4)
OUT
IN
Main path
(2b)
V
V
SS
SS
81/105
1
ST6215C ST6225C
11.8 I/O PORT PIN CHARACTERISTICS
11.8.1 General Characteristics
Subject to general operating conditions for V , f
, and T unless otherwise specified.
DD OSC
A
1)
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
2)
V
Input low level voltage
Input high level voltage
0.3xVDD
IL
V
2)
V
0.7xVDD
200
IH
V
V
V
=5V
400
400
DD
DD
3)
V
Schmitt trigger voltage hysteresis
Input leakage current
mV
μA
kΩ
hys
=3.3V
200
SS≤V ≤V
IN
DD
I
0.1
1
L
(no pull-up configured)
V
V
=5V
40
80
110
230
5
350
700
10
DD
DD
4)
R
Weak pull-up equivalent resistor
V =V
IN SS
PU
=3.3V
C
I/O input pin capacitance
pF
pF
IN
C
I/O output pin capacitance
Output high to low level fall time
5
10
OUT
5)
5)
t
30
35
C =50pF
f(IO)out
r(IO)out
L
ns
Between 10% and 90%
t
Output low to high level rise time
6)
t
External interrupt pulse time
1
t
CPU
w(IT)in
Figure 61. Typical R vs. V with V = V
SS
PU
DD
IN
Rpu [Khom]
350
Ta=-40°C
Ta=25°C
Ta=95°C
Ta=125°C
300
250
200
150
100
50
3
4
5
6
VDD [V]
Notes:
1. Unless otherwise specified, typical data are based on T =25°C and V =5V.
A
DD
2. Data based on characterization results, not tested in production.
3. Hysteresis voltage between Schmitt trigger switching levels. Based on characterization results, not tested.
4. The R pull-up equivalent resistor is based on a resistive transistor. This data is based on characterization results,
PU
not tested in production.
5. Data based on characterization results, not tested in production.
6. To generate an external interrupt, a minimum pulse width has to be applied on an I/O port pin configured as an external
interrupt source.
Figure 62. Two typical Applications with unused I/O Pin
V
ST62XX
DD
UNUSED I/O PORT
10kΩ
10kΩ
UNUSED I/O PORT
ST62XX
82/105
1
ST6215C ST6225C
I/O PORT PIN CHARACTERISTICS (Cont’d)
11.8.2 Output Driving Current
Subject to general operating conditions for V , f
, and T unless otherwise specified.
DD OSC
A
Symbol
Parameter
Conditions
Min
Max
0.1
0.8
0.8
1.2
0.1
0.8
0.8
1.3
1.3
2
Unit
I =+10µA, T ≤125°C
IO
A
I =+3mA, T ≤125°C
Output low level voltage for a standard I/O pin
(see Figure 63 and Figure 66)
IO
A
I =+5mA, T ≤85°C
IO
A
I =+10mA, T ≤85°C
IO
A
I =+10µA, T ≤125°C
IO
A
1)
V
OL
I =+7mA, T ≤125°C
IO
A
V
I =+10mA, T ≤85°C
Output low level voltage for a high sink I/O pin
(see Figure 64 and Figure 67)
IO
A
I =+15mA, T ≤125°C
IO
A
I =+20mA, T ≤85°C
IO
A
I =+30mA, T ≤85°C
IO
A
I =-10μA, T ≤125°C
V
V
V
-0.1
IO
A
DD
DD
DD
Output high level voltage for an I/O pin
(see Figure 65 and Figure 68)
2)
V
I =-3mA, T ≤125°C
-1.5
-1.5
OH
IO
A
I =-5mA, T ≤85°C
IO
A
Notes:
1. The I current sunk must always respect the absolute maximum rating specified in Section 11.2.2 and the sum of I
IO
IO
(I/O ports and control pins) must not exceed I
.
VSS
2. The I current source must always respect the absolute maximum rating specified in Section 11.2.2 and the sum of
IO
I
(I/O ports and control pins) must not exceed I
. True open drain I/O pins does not have V
.
OH
IO
VDD
Figure 63. Typical V at V = 5V (standard)
Figure 64. Typical V at V = 5V (high-sink)
OL DD
OL
DD
Vol [V] at Vdd=5V
1
Vol [mV] at Vdd=5V
Ta=-40°C Ta=95°C
Ta=-40°C Ta=95°C
Ta=25°C Ta=125°C
1000
800
600
400
200
0
0.8
0.6
0.4
0.2
0
Ta=25°C
Ta=125°C
0
4
8
Iio [mA]
12
16
20
0
2
4
Iio [mA]
6
8
10
83/105
1
ST6215C ST6225C
I/O PORT PIN CHARACTERISTICS (Cont’d)
Figure 65. Typical V at V = 5V
OH
DD
Voh [V] at Vdd=5V
5
4.5
4
Ta=-40°C Ta=95°C
Ta=25°C
Ta=125°C
-2 0
3.5
-8
-6
-4
Iio [mA]
Figure 66. Typical V vs V (standard I/Os)
OL
DD
Vol [mV] at Iio=2mA
350
Ta=-40°C Ta=95°C
Vol [mV] at Iio=5mA
700
Ta=-40°C Ta=95°C
Ta=25°C Ta=125°C
Ta=25°C
Ta=125°C
300
250
200
600
500
400
150
3
300
3
4
5
6
4
5
6
VDD [V]
VDD [V]
Figure 67. Typical V vs V (high-sink I/Os)
OL
DD
Vol [V] at Iio=8mA
Vol [V] at Iio=20mA
Ta=-40°C Ta=95°C
Ta=25°C Ta=125°C
0.55
0.5
1.8
1.6
1.4
1.2
1
Ta=-40°C Ta=95°C
Ta=25°C Ta=125°C
0.45
0.4
0.35
0.3
0.8
0.6
0.25
0.2
3
0.4
3
4
5
6
4
5
6
VDD [V]
VDD [V]
84/105
1
ST6215C ST6225C
I/O PORT PIN CHARACTERISTICS (Cont’d)
Figure 68. Typical V vs V
OH
DD
Voh [V] at Iio=-2mA
6
Voh [V] at Iio=-5mA
6
5
4
3
2
5
4
3
2
Ta=-40°C Ta=95°C
Ta=-40°C Ta=95°C
Ta=25°C
Ta=125°C
6
Ta=25°C
Ta=125°C
6
1
3
3
4
5
4
5
VDD [V]
VDD [V]
85/105
1
ST6215C ST6225C
11.9 CONTROL PIN CHARACTERISTICS
11.9.1 Asynchronous RESET Pin
Subject to general operating conditions for V , f
, and T unless otherwise specified.
DD OSC
A
1)
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
V
2)
V
Input low level voltage
0.3xVDD
IL
2)
V
Input high level voltage
0.7xVDD
200
IH
3)
V
Schmitt trigger voltage hysteresis
400
350
730
2.8
mV
kΩ
hys
V
V
V
V
=5V
150
900
DD
DD
DD
DD
4)
R
Weak pull-up equivalent resistor
V =V
ON
IN
SS
SS
=3.3V
=5V
300
1900
R
ESD resistor protection
V =V
kΩ
ESD
IN
=3.3V
External pin or
internal reset sources
t
CPU
μs
t
Generated reset pulse duration
w(RSTL)out
5)
t
t
External reset pulse hold time
μs
h(RSTL)in
g(RSTL)in
6)
Filtered glitch duration
ns
Notes:
1. Unless otherwise specified, typical data are based on T =25°C and V =5V.
A
DD
2. Data based on characterization results, not tested in production.
3. Hysteresis voltage between Schmitt trigger switching levels. Based on characterization results, not tested.
4. The R
pull-up equivalent resistor is based on a resistive transistor. This data is based on characterization results,
ON
not tested in production.
5. All short pulse applied on RESET pin with a duration below t
can be ignored.
h(RSTL)in
6. The reset network protects the device against parasitic resets, especially in a noisy environment.
7. The output of the external reset circuit must have an open-drain output to drive the ST6 reset pad. Otherwise the device
can be damaged when the ST6 generates an internal reset (LVD or watchdog).
Figure 69. Typical R vs V with V =V
SS
ON
DD
IN
Ron [Kohm]
1000
900
800
700
600
500
400
300
Ta=-40°C
Ta=25°C
Ta=95°C
Ta=125°C
200
100
3
4
5
6
VDD [V]
86/105
1
ST6215C ST6225C
CONTROL PIN CHARACTERISTICS (Cont’d)
8)
Figure 70. Typical Application with RESET pin
V
V
DD
DD
INTERNAL
RESET
f
INT
VDD
RPU
STOP MODE
0.1μF
0.1μF
4.7kΩ
RESET
EXTERNAL
RESET
7)
1)
RESD
CIRCUIT
WATCHDOG RESET
LVD RESET
11.9.2 NMI Pin
Subject to general operating conditions for V , f
, and T unless otherwise specified.
DD OSC
A
1)
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
V
2)
V
Input low level voltage
0.3xVDD
IL
2)
V
Input high level voltage
0.7xVDD
200
IH
3)
V
Schmitt trigger voltage hysteresis
400
100
200
mV
kΩ
hys
V
V
=5V
40
350
700
DD
DD
4)
R
Weak pull-up equivalent resistor
V =V
IN SS
pull-up
=3.3V
80
Notes:
1. Unless otherwise specified, typical data are based on T =25°C and V =5V.
A
DD
2. Data based on characterization results, not tested in production.
3. Hysteresis voltage between Schmitt trigger switching levels. Based on characterization results, not tested.
4. The R
equivalent resistor is based on a resistive transistor. This data is based on characterization results, not
pull-up
tested in production.
Figure 71. Typical R
vs. V with V =V
DD IN SS
pull-up
Rpull-up [Kohm]
300
Ta=-40°C
Ta=25°C
Ta=95°C
250
200
150
100
Ta=125°C
50
3
4
5
6
VDD [V]
87/105
1
ST6215C ST6225C
CONTROL PIN CHARACTERISTICS (Cont’d)
11.10 TIMER PERIPHERAL CHARACTERISTICS
Subject to general operating conditions for V
,
Refer to I/O port characteristics for more details on
the input/output alternate function characteristics
(TIMER).
DD
f
, and T unless otherwise specified.
OSC
A
11.10.1 Watchdog Timer
Symbol
Parameter
Conditions
Min
Typ
Max
Unit
tINT
ms
3,072
0.768
0.384
196,608
49.152
24.576
t
Watchdog time-out duration
fCPU=4MHz
CPU=8MHz
w(WDG)
f
ms
11.10.2 8-Bit Timer
Symbol
Parameter
Conditions
Min
0
Typ
Max
Unit
MHz
ns
f
Timer external clock frequency
f
/4
INT
EXT
VDD>4.5V
VDD=3V
125
1
t
Pulse width at TIMER pin
w
µs
88/105
1
ST6215C ST6225C
11.11 8-BIT ADC CHARACTERISTICS
Subject to general operating conditions for V , f
, and T unless otherwise specified.
DD OSC
A
1)
Symbol
Parameter
Clock frequency
Conditions
Min
Typ
Max
Unit
MHz
V
f
1.2
f
OSC
OSC
2)
V
R
Conversion range voltage
External input resistor
V
V
AIN
SS
DD
3)
10
kΩ
AIN
f
f
=8MHz
=4MHz
70
140
OSC
OSC
t
Total convertion time
μs
ADC
2
4
t
CPU
4)
t
Stabilization time
STAB
f
=8MHz
3.25
6.5
1.0
5
µs
OSC
Analog input current during conver-
sion
AD
µA
pF
I
AC
Analog input capacitance
2
IN
Notes:
1. Unless otherwise specified, typical data are based on T =25°C and V =5V.
A
DD
2. The ADC refers to V and V
.
DD
SS
3. Any added external serial resistor will downgrade the ADC accuracy (especially for resistance greater than 10kΩ). Data
based on characterization results, not tested in production.
4. As a stabilization time for the AD converter is required, the first conversion after the enable can be wrong.
Figure 72. Typical Application with ADC
R
AIN
r≈150Ω
AINx
V
AIN
ADC
10pF
10MΩ
ST62XX
Note: ADC not present on some devices. See device summary on page 1.
89/105
1
ST6215C ST6225C
8-BIT ADC CHARACTERISTICS (Cont’d)
ADC Accuracy
Symbol
Parameter
Conditions
Min
Typ.
Max
Unit
±2, fosc>1.2MHz
±4, fosc>32KHz
1)
1.2
|E |
Total unadjusted error
T
1)
0.72
-0.31
0.54
E
Offset error
2)
O
V
=5V
DD
LSB
1)
E
Gain Error
f
=8MHz
G
OSC
1)
|E |
Differential linearity error
D
1)
|E |
Integral linearity error
L
Notes:
1. Negative injection disturbs the analog performance of the device. In particular, it induces leakage currents throughout
the device including the analog inputs. To avoid undesirable effects on the analog functions, care must be taken:
- Analog input pins must have a negative injection less than 1mA (assuming that the impedance of the analog voltage
is lower than the specified limits).
- Pure digital pins must have a negative injection less than 1mA. In addition, it is recommended to inject the current as
far as possible from the analog input pins.
2. Data based on characterization results over the whole temperature range, monitored in production.
Figure 73. ADC Accuracy Characteristics
Digital Result ADCDR
E
G
(1) Example of an actual transfer curve
(2) The ideal transfer curve
(3) End point correlation line
255
254
253
V
– V
DDA
SSA
1LSB
= ----------------------------------------
IDEAL
256
(2)
E =Total Unadjusted Error: maximum deviation
T
E
between the actual and the ideal transfer curves.
T
(3)
7
6
5
4
3
2
1
E =Offset Error: deviation between the first actual
O
transition and the first ideal one.
(1)
E =Gain Error: deviation between the last ideal
G
transition and the last actual one.
E
E
O
L
E =Differential Linearity Error: maximum deviation
D
between actual steps and the ideal one.
E =Integral Linearity Error: maximum deviation
L
E
between any actual transition and the end point
correlation line.
D
1 LSB
IDEAL
V
(LSB
)
in
IDEAL
0
1
2
3
4
5
6
7
253 254 255 256
V
V
DDA
SSA
Note: ADC not present on some devices. See device summary on page 1.
90/105
1
ST6215C ST6225C
12 GENERAL INFORMATION
12.1 PACKAGE MECHANICAL DATA
Figure 74. 28-Pin Plastic Dual In-Line Package, 600-mil Width
mm
inches
Dim.
Min Typ Max Min Typ Max
E
A
6.35
0.250
A2 A
A1 0.38
A2 3.18
0.015
4.95 0.125
0.56 0.014
1.78 0.030
0.38 0.008
39.75 1.380
0.005
0.195
0.022
0.070
0.015
1.565
A1
L
E1
eB
C
B
0.36
D1
B1
B
e
B1 0.76
D
C
D
0.20
35.05
D1 0.13
e
2.54
0.100
eB
17.78
0.700
0.625
0.580
0.200
E
15.24
15.88 0.600
14.73 0.485
5.08 0.115
E1 12.32
L
2.92
Number of Pins
N
28
Figure 75. 28-Pin Plastic Small Outline Package, 300-mil Width
mm
inches
Dim.
A
Min Typ Max Min Typ Max
D
h x 45×
2.35
2.65 0.093
0.30 0.004
0.51 0.013
0.32 0.009
18.10 0.697
7.60 0.291
0.104
0.012
0.020
0.013
0.713
0.299
L
A
A1 0.10
C
A1
B
C
D
E
e
0.33
0.23
a
e
B
17.70
7.40
1.27
0.050
H
h
α
L
10.00
0.25
0°
10.65 0.394
0.75 0.010
0.419
0.030
8°
E
H
8°
0°
0.40
1.27 0.016
0.050
Number of Pins
N
28
91/105
1
ST6215C ST6225C
PACKAGE MECHANICAL DATA (Cont’d)
Figure 76. 28-Pin Ceramic Side-Brazed Dual In-Line Package
mm
Min Typ Max Min Typ Max
4.17 0.164
inches
Dim.
A
A1 0.76
0.030
B 0.36 0.46 0.56 0.014 0.018 0.022
B1 0.76 1.27 1.78 0.030 0.050 0.070
C
D
0.20 0.25 0.38 0.008 0.010 0.015
34.95 35.56 36.17 1.376 1.400 1.424
D1
33.02
1.300
E1 14.61 15.11 15.62 0.575 0.595 0.615
e
2.54
0.100
G
12.70 12.95 13.21 0.500 0.510 0.520
G1 12.70 12.95 13.21 0.500 0.510 0.520
G2
L
1.14
0.045
2.92
5.08 0.115
0.200
CDIP28W
S
1.27
8.89
0.050
0.350
Ø
Number of Pins
N
28
Figure 77. 28-Pin Plastic Shrink Small Outline Package
mm
Min Typ Max Min Typ Max
2.00 0.079
inches
Dim.
D
L
A
A2
A
c
A1
A1 0.05
0.002
b
A2 1.65 1.75 1.85 0.065 0.069 0.073
h
e
b
c
0.22
0.09
0.38 0.009
0.25 0.004
0.015
0.010
D
E
9.90 10.20 10.50 0.390 0.402 0.413
7.40 7.80 8.20 0.291 0.307 0.323
E1 5.00 5.30 5.60 0.197 0.209 0.220
E1
E
e
θ
L
0.65
4°
0.026
4°
0°
8°
0°
8°
0.55 0.75 0.95 0.022 0.030 0.037
Number of Pins
N
28
92/105
1
ST6215C ST6225C
12.2 THERMAL CHARACTERISTICS
Symbol
Ratings
Value
Unit
Package thermal resistance (junction to ambient)
DIP28
SO28
55
75
R
°C/W
thJA
SSOP28
110
1)
P
Power dissipation
500
150
mW
°C
D
2)
T
Maximum junction temperature
Jmax
Notes:
1. The power dissipation is obtained from the formula P = P + P
where P
is the chip internal power (I xV
)
D
INT
PORT
INT
DD DD
and P
is the port power dissipation determined by the user.
PORT
2. The average chip-junction temperature can be obtained from the formula T = T + P x RthJA.
J
A
D
93/105
1
ST6215C ST6225C
12.3 ECOPACK INFORMATION
In order to meet environmental requirements, ST
offers these devices in different grades of ECO-
®
PACK packages, depending on their level of en-
®
vironmental compliance. ECOPACK specifica-
tions, grade definitions and product status are
®
available at: www.st.com. ECOPACK is an ST
trademark.
94/105
1
ST6215C ST6225C
12.4 PACKAGE/SOCKET FOOTPRINT PROPOSAL
Table 22. Suggested List of DIP28 Socket Types
Same
Footprint
Package / Probe
Adaptor / Socket Reference
228-60-23
Socket Type
Textool
DIP28
TEXTOOL
X
Table 23. Suggested List of SO28 Socket Types
Same
Footprint
Package / Probe
SO28
Adaptor / Socket Reference
Socket Type
ENPLAS
OTS-28-1.27-04
IC51-0282-334-1
Open Top
Clamshell
YAMAICHI
Adapter from SO28 to DIP28 footprint
(delivered with emulator)
EMU PROBE
X
X
SMD to DIP
Open Top
Programming
Adapter
Logical Systems
PA28SO1-08-6
Table 24. Suggested List of SSOP28 Socket Types
Same
Footprint
Package / Probe
SSOP28
Adaptor / Socket Reference
OTS-28-0.65-01
Socket Type
Open Top
ENPLAS
Adapter from SSOP28 to DIP28 footprint
(sales type: ST626X-P/SSOP28)
EMU PROBE
X
X
DIP to SMD
Programming
Adapter
Logical Systems
PA28SS-OT-6
Open Top
95/105
1
ST6215C ST6225C
12.5 ORDERING INFORMATION
The following section deals with the procedure for
transfer of customer codes to STMicroelectronics
and also details the ST6 factory coded device
type.
Figure 78. ST6 Factory Coded Device Types
ST62T25CB6/CCC
ROM code
Temperature code:
1: Standard 0 to +70 °C
3: Automotive -40 to +125 °C
6: Industrial -40 to +85 °C
Package type:
B: Plastic DIP
D: Ceramic DIP (EPROM devices only)
M: Plastic SOP
N: Plastic SSOP
T: Plastic TQFP
Revision index:
B,C: Product Definition change
L: Low Voltage Device
ST6 Sub family
Version Code:
No char: ROM
E: EPROM
P: FASTROM
T: OTP
Family
96/105
1
ST6215C ST6225C
12.6 TRANSFER OF CUSTOMER CODE
Customer code is made up of the ROM contents
and the list of the selected FASTROM options.
The ROM contents are to be sent on diskette, or
by electronic means, with the hexadecimal file
generated by the development tool. All unused
bytes must be set to FFh.
They offer the same functionality as OTP devices,
but they do not have to be programmed by the
customer. The customer code must be sent to
STMicroelectronics in the same way as for ROM
devices. The FASTROM option list has the same
options as defined in the programmable option
byte of the OTP version. It also offers an identifier
option. If this option is enabled, each FASTROM
device is programmed with a unique 5-byte
number which is mapped at addresses 0F9Bh-
0F9Fh. The user must therefore leave these bytes
blanked.
The selected options are communicated to
STMicroelectronics using the correctly filled OP-
TION LIST appended.
The STMicroelectronics Sales Organization will be
pleased to provide detailed information on con-
tractual points.
The identification number is structured as follows:
Listing Generation and Verification. When
STMicroelectronics receives the user’s ROM con-
tents, a computer listing is generated from it. This
listing refers exactly to the ROM contents and op-
tions which will be used to produce the specified
MCU. The listing is then returned to the customer
who must thoroughly check, complete, sign and
return it to STMicroelectronics. The signed listing
forms a part of the contractual agreement for the
production of the specific customer MCU.
0F9Bh
0F9Ch
0F9Dh
0F9Eh
0F9Fh
T0
T1
T2
T3
Test ID
with T0, T1, T2, T3 = time in seconds since 01/01/
1970 and Test ID = Tester Identifier.
12.6.1 FASTROM Version
The ST62P15C/P25C are the Factory Advanced
Service Technique ROM (FASTROM) versions of
ST62T15C,T25C OTP devices.
97/105
1
ST6215C ST6225C
TRANSFER OF CUSTOMER CODE (Cont’d)
12.6.2 ROM Version
ROM Readout Protection. If the ROM READOUT
PROTECTION option is selected, a protection
fuse can be blown to prevent any access to the
program memory content.
The ST6215C/25C are mask programmed ROM
version of ST62T15C,T25C OTP devices.
They offer the same functionality as OTP devices,
selecting as ROM options the options defined in
the programmable option byte of the OTP version.
In case the user wants to blow this fuse, high volt-
age must be applied on the V pin.
PP
Figure 80. Programming wave form
Figure 79. Programming Circuit
0.5s min
V
PP
5V
4.7µF
100 µs max
15
14V typ
10
100nF
5
V
V
DD
SS
V
PP
PROTECT
150 µs typ
14V
V
PP
400mA
max
100nF
ZPD15
15V
4mA typ
t
VR02003
VR02001
Note: ZPD15 is used for overvoltage protection
98/105
1
ST6215C ST6225C
ST6215C/25C/P15C/P25C MICROCONTROLLER OPTION LIST
Customer:
Address:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Contact:
Phone:
Reference: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
STMicroelectronics references:
Device:
[ ] ST6215C (2 KB)
[ ] ST62P15C (2 KB)
[ ] ST6225C (4 KB)
[ ] ST62P25C (4 KB)
Package:
[ ] Dual in Line Plastic
[ ] Small Outline Plastic with conditioning
[ ] Shrink Small Outline Plastic with conditioning
Conditioning option:
Temperature Range:
[ ] Standard (Tube)
[ ] 0°C to + 70°C
[ ] - 40°C to + 125°C
[ ] Tape & Reel
[ ] - 40°C to + 85°C
Marking:
[ ] Standard marking
[ ] Special marking (ROM only):
PDIP28 (10 char. max): _ _ _ _ _ _ _ _ _ _
PSO28 (8 char. max): _ _ _ _ _ _ _ _
SSOP28 (11 char. max): _ _ _ _ _ _ _ _ _ _ _
Authorized characters are letters, digits, '.', '-', '/' and spaces only.
Oscillator Safeguard:
Watchdog Selection:
Timer pull-up:
[ ] Enabled
[ ] Software Activation
[ ] Enabled
[ ] Disabled
[ ] Hardware Activation
[ ] Disabled
NMI pull-up:
[ ] Enabled
[ ] Disabled
Oscillator Selection:
[ ] Quartz crystal / Ceramic resonator
[ ] RC network
Readout Protection:
FASTROM:
[ ] Enabled
[ ] Disabled
ROM:
[ ] Enabled:
[ ] Fuse is blown by STMicroelectronics
[ ] Fuse can be blown by the customer
[ ] Disabled
Low Voltage Detector:
External STOP Mode Control:
Identifier (FASTROM only):
[ ] Enabled
[ ] Enabled
[ ] Enabled
[ ] Disabled
[ ] Disabled
[ ] Disabled
Comments:
Oscillator Frequency in the application:
Supply Operating Range in the application:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Notes:
Date:
Signature:
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
99/105
1
ST6215C ST6225C
13 DEVELOPMENT TOOLS
STMicroelectronics offers a range of hardware
and software development tools for the ST6 micro-
controller family. Full details of tools available for
the ST6 from third party manufacturers can be ob-
tain from the STMicroelectronics Internet site:
➟ http://www.st.com.
Table 25. Dedicated Third Parties Development Tools
1)
Third Party
Designation
ST Sales Type
Web site address
ST-REALIZER II: Graphical Schematic
based Development available from
STMicroelectronics.
ACTUM
STREALIZER-II
http://www.actum.com/
Low cost emulator available from CEI-
BO.
CEIBO
http://www.ceibo.com/
This tool includes in the same environ-
ment: an assembler, linker, C compiler,
debugger and simulator. The assembler
package (plus limited C compiler) is free ST6RAIS-SWC/
RAISONANCE
http://www.raisonance.com/
and can be downloaded from raisonance
web site. The full version is available
both from STMicroelectronics and Raiso-
nance.
PC
High end emulator available from
SOFTEC.
SOFTEC
http://www.softecmicro.com/
Gang programmer available from
SOFTEC.
ADVANCED EQUIPMENT
ADVANCED TRANSDATA
BP MICROSYSTEMS
DATA I/O
http://www.aec.com.tw/
http://www.adv-transdata.com/
http://www.bpmicro.com/
http://www.data-io.com/
DATAMAN
http://www.dataman.com/
http://www.eetools.com/
http://www.elnec.com/
EE TOOLS
ELNEC
HI-LO SYSTEMS
ICE TECHNOLOGY
LEAP
http://www.hilosystems.com.tw/
http://www.icetech.com/
http://www.leap.com.tw/
http://www.lloyd-research.com/
Single and gang programmers
LLOYD RESEARCH
http://www.chipprogram-
mers.com/
LOGICAL DEVICES
MQP ELECTRONICS
http://www.mqp.com/
NEEDHAMS
ELECTRONICS
http://www.needhams.com/
STAG PROGRAMMERS
SYSTEM GENERAL CORP
TRIBAL MICROSYSTEMS
XELTEK
http://www.stag.co.uk/
http://www.sg.com.tw
http://www.tribalmicro.com/
http://www.xeltek.com/
Note 1: For latest information on third party tools, please visit our Internet site: ➟ http://www.st.com.
100/105
1
ST6215C ST6225C
DEVELOPMENT TOOLS (Cont’d)
STMicroelectronics Tools
Four types of development tool are offered by ST, all of them connect to a PC via a parallel or serial port:
see Table 26 and Table 27 for more details.
Table 26. STMicroelectronics Tool Features
Emulation Type
Programming Capability
Software Included
MCU CD ROM with:
Device simulation (limited
ST6 Starter Kit
emulation as interrupts are Yes (DIP packages only)
not supported)
– Rkit-ST6 from Raisonance
– ST6 Assembly toolchain
In-circuit powerful emula-
tion features including
trace/ logic analyzer
– WGDB6 powerful Source Level
Debugger for Win 3.1, Win 95
and NT
– Various software demo ver-
sions.
ST6 HDS2 Emulator
No
ST6 EPROM
Programmer Board
Yes (All packages except
SSOP)
No
– Windows Programming Tools
for Win 3.1, Win 95 and NT
Table 27. Dedicated STMicroelectronics Development Tools
Supported Products
ST6 Starter Kit
ST6 HDS2 Emulator
ST6 Programming Board
Complete:
ST62GP-EMU2
ST6215C and ST6225C
ST622XC-KIT
ST62E2XC-EPB
Dedication board:
ST62GP-DBE
101/105
1
ST6215C ST6225C
14 ST6 APPLICATION NOTES
IDENTIFICATION
DESCRIPTION
MOTOR CONTROL
AN392
AN414
AN416
AN422
AN863
MICROCONTROLLER AND TRIACS ON THE 110/240V MAINS
CONTROLLING A BRUSH DC MOTOR WITH AN ST6265 MCU
SENSORLESS MOTOR DRIVE WITH THE ST62 MCU + TRIAC
IMPROVES UNIVERSAL MOTOR DRIVE
IMPROVED SENSORLESS CONTROL WITH THE ST62 MCU FOR UNIVERSAL MOTOR
BATTERY MANAGEMENT
AN417
FROM NICD TO NIMH FAST BATTERY CHARGING
AN433
ULTRA FAST BATTERY CHARGER USING ST6210 MICROCONTROLLER
AN859
AN INTELLIGENT ONE HOUR MULTICHARGER FOR Li-Ion, NiMH and NiCd BATTERIES
HOME APPLIANCE
AN674
MICROCONTROLLERS IN HOME APPLIANCES: A SOFT REVOLUTION
AN885
ST62 MICROCONTROLLERS DRIVE HOME APPLIANCE MOTOR TECHNOLOGY
GRAPHICAL DESIGN
AN676
BATTERY CHARGER USING THE ST6-REALIZER
AN677
PAINLESS MICROCONTROLLER CODE BY GRAPHICAL APPLICATION DESCRIPTION
ANALOG MULTIPLE KEY DECODING USING THE ST6-REALIZER
CODED LOCK USING THE ST6-REALIZER
AN839
AN840
AN841
A CLOCK DESIGN USING THE ST6-REALIZER
AN842
7 SEGMENT DISPLAY DRIVE USING THE ST6-REALIZER
COST REDUCTION
AN431
USING ST6 ANALOG INPUTS FOR MULTIPLE KEY DECODING
DIRECT SOFTWARE LCD DRIVE WITH ST621X AND ST626X
OPTIMIZING THE ST6 A/D CONVERTER ACCURACY
AN594
AN672
AN673
REDUCING CURRENT CONSUMPTION AT 32KHZ WITH ST62
DESIGN IMPROVEMENTS
AN420
AN432
AN434
AN435
AN669
AN670
AN671
AN911
AN975
AN1015
EXPANDING A/D RESOLUTION OF THE ST6 A/D CONVERTER
USING ST62XX I/O PORTS SAFELY
MOVEMENT DETECTOR CONCEPTS FOR NOISY ENVIRONMENTS
DESIGNING WITH MICROCONTROLLERS IN NOISY ENVIRONMENTS
SIMPLE RESET CIRCUITS FOR THE ST6
OSCILLATOR SELECTION FOR ST62
PREVENTION OF DATA CORRUPTION IN ST6 ON-CHIP EEPROM
ST6 MICRO IS EMC CHAMPION
UPGRADING FROM ST625X/6XB TO ST625X/6XC
SOFTWARE TECHNIQUES FOR IMPROVING ST6 EMC PERFORMANCE
PERIPHERAL OPERATIONS
AN590
AN591
AN592
AN593
AN678
PWM GENERATION WITH ST62 AUTO-RELOAD TIMER
INPUT CAPTURE WITH ST62 AUTO-RELOAD TIMER
PLL GENERATION USING THE ST62 AUTO-RELOAD TIMER
ST62 IN-CIRCUIT PROGRAMMING
LCD DRIVING WITH ST6240
102/105
1
ST6215C ST6225C
IDENTIFICATION
AN913
DESCRIPTION
PWM GENERATION WITH ST62 16-BIT AUTO-RELOAD TIMER
USING ST626X SPI AS UART
AN914
AN1016
ST6 USING THE ST623XB/ST628XB UART
AN1050
ST6 INPUT CAPTURE WITH ST62 16-BIT AUTO-RELOAD TIMER
USING THE ST62T6XC/5XC SPI IN MASTER MODE
AN1127
GENERAL
MCUS - 8/16-BIT MICROCONTROLLERS (MCUS) APPLICATION NOTES ABSTRACTS BY
TOPICS
AN683
AN886
AN887
AN898
AN899
AN900
AN901
AN902
AN912
AN1181
SELECTING BETWEEN ROM AND OTP FOR A MICROCONTROLLER
MAKING IT EASY WITH MICROCONTROLLERS
EMC GENERAL INFORMATION
SOLDERING RECOMMENDATIONS AND PACKAGING INFORMATION
INTRODUCTION TO SEMICONDUCTOR TECHNOLOGY
EMC GUIDE-LINES FOR MICROCONTROLLER - BASED APPLICATIONS
QUALITY AND RELIABILITY INFORMATION
A SIMPLE GUIDE TO DEVELOPMENT TOOLS
ELECTROSTATIC DISHARGE SENSITIVITY MEASUREMENT
103/105
1
ST6215C ST6225C
15 SUMMARY OF CHANGES
Description of the changes between the current release of the specification and the previous one.
Revision
Main Changes
Date
Removed references to 32768 clock cycle delay in Section 5 and in Section 7
3.3
Changed note 2 in Section 11.6.2 on page 77: added text on data retention and program- October 2003
mability.
Updated device summary on page 1
®
4
Replaced soldering information by ECOPACK information in Section 12.3 on page 94
Updated disclaimer on last page.
January 2009
16 TO GET MORE INFORMATION
To get the latest information on this product please use the STMicroelectronics web server.
➟ http://www.st.com/
104/105
1
ST6215C ST6225C
Please Read Carefully:
Information in this document is provided solely in connection with ST products. STMicroelectronics NV and its subsidiaries (“ST”) reserve the
right to make changes, corrections, modifications or improvements, to this document, and the products and services described herein at any
time, without notice.
All ST products are sold pursuant to ST’s terms and conditions of sale.
Purchasers are solely responsible for the choice, selection and use of the ST products and services described herein, and ST assumes no
liability whatsoever relating to the choice, selection or use of the ST products and services described herein.
No license, express or implied, by estoppel or otherwise, to any intellectual property rights is granted under this document. If any part of this
document refers to any third party products or services it shall not be deemed a license grant by ST for the use of such third party products
or services, or any intellectual property contained therein or considered as a warranty covering the use in any manner whatsoever of such
third party products or services or any intellectual property contained therein.
UNLESS OTHERWISE SET FORTH IN ST’S TERMS AND CONDITIONS OF SALE ST DISCLAIMS ANY EXPRESS OR IMPLIED
WARRANTY WITH RESPECT TO THE USE AND/OR SALE OF ST PRODUCTS INCLUDING WITHOUT LIMITATION IMPLIED
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE (AND THEIR EQUIVALENTS UNDER THE LAWS
OF ANY JURISDICTION), OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.
UNLESS EXPRESSLY APPROVED IN WRITING BY AN AUTHORIZED ST REPRESENTATIVE, ST PRODUCTS ARE NOT
RECOMMENDED, AUTHORIZED OR WARRANTED FOR USE IN MILITARY, AIR CRAFT, SPACE, LIFE SAVING, OR LIFE
SUSTAINING APPLICATIONS, NOR IN PRODUCTS OR SYSTEMS WHERE FAILURE OR MALFUNCTION MAY RESULT IN
PERSONAL INJURY, DEATH, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE. ST PRODUCTS WHICH ARE NOT
SPECIFIED AS "AUTOMOTIVE GRADE" MAY ONLY BE USED IN AUTOMOTIVE APPLICATIONS AT USER’S OWN RISK.
Resale of ST products with provisions different from the statements and/or technical features set forth in this document shall immediately void
any warranty granted by ST for the ST product or service described herein and shall not create or extend in any manner whatsoever, any
liability of ST.
ST and the ST logo are trademarks or registered trademarks of ST in various countries.
Information in this document supersedes and replaces all information previously supplied.
The ST logo is a registered trademark of STMicroelectronics. All other names are the property of their respective owners.
© 2009 STMicroelectronics - All rights reserved
STMicroelectronics group of companies
Australia - Belgium - Brazil - Canada - China - Czech Republic - Finland - France - Germany - Hong Kong - India - Israel - Italy - Japan -
Malaysia - Malta - Morocco - Singapore - Spain - Sweden - Switzerland - United Kingdom - United States of America
www.st.com
105/105
相关型号:
ST6215CM1
8-BIT OTP/EPROM MCUs WITH A/D CONVERTER, OSCILLATOR SAFEGUARD, SAFE RESET AND 28 PINS
STMICROELECTR
ST6215CM3
8-BIT OTP/EPROM MCUs WITH A/D CONVERTER, OSCILLATOR SAFEGUARD, SAFE RESET AND 28 PINS
STMICROELECTR
ST6215CM6
8-BIT OTP/EPROM MCUs WITH A/D CONVERTER, OSCILLATOR SAFEGUARD, SAFE RESET AND 28 PINS
STMICROELECTR
©2020 ICPDF网 联系我们和版权申明