ST7LITE20F2 ST7LITE25F2 ST7LITE29F2
8-bit microcontroller with single voltage Flash memory,
data EEPROM, ADC, Timers, SPI
Datasheet
−
production data
■
DIP20
SO20 300”
■
4 timers
– Configurable watchdog timer
– Two 8-bit Lite timers with prescaler
– 1 real-time base and 1 input capture
– One 12-bit auto-reload timer with 4 PWM
outputs, input capture and output compare
functions.
1 communication interface
– SPI synchronous serial interface.
Interrupt management
– 10 interrupt vectors plus TRAP and RESET
– 15 external interrupt lines (on 4 vectors).
A/D converter
– 7 input channels
– Fixed gain op-amp
– 13-bit resolution for 0 to 430 mV (@ 5 V
V
DD
)
– 10-bit resolution for 430 mV to 5 V (@ 5 V
V
DD
).
Instruction set
– 8-bit data manipulation
– 63 basic instructions with illegal opcode
detection
– 17 main addressing modes
– 8 x 8 unsigned multiply instructions.
Development tools
– Full hardware/software development
package
– DM (debug module)
Features
■
■
Memories
– 8 Kbytes single voltage Flash Program
memory with Read-out protection
– In-circuit programming and in-application
programming (ICP and IAP)
– 10K write/erase cycles guaranteed
– Data retention: 20 years at 55 °C
– Temperature range: -40°C to 105°C
– 384 bytes RAM.
Clock, reset and supply management
– Enhanced reset system
– Enhanced low voltage supervisor (LVD) for
main supply and an auxiliary voltage
detector (AVD) with interrupt capability for
implementing safe power-down procedures
– Clock sources: internal 1% RC oscillator,
crystal/ceramic resonator or external clock
– Internal 32-MHz input clock for auto-reload
timer
– Optional x4 or x8 PLL for 4 or 8 MHz
internal clock
– Five power saving modes: Halt, Active-halt,
Wait and Slow, Auto-wakeup from Halt.
I/O ports
– Up to 15 multifunctional bidirectional I/O
lines
– 7 high sink outputs.
■
■
■
■
■
June 2013
This is information on a product in full production.
Doc ID 8349 Rev 5
1/166
www.st.com
1
Contents
ST7LITE20F2 ST7LITE25F2 ST7LITE29F2
Contents
1
2
3
4
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Register & memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Flash program memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.1
4.2
4.3
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Programming modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.3.1
4.3.2
In-circuit programming (ICP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
In-application programming (IAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.4
4.5
ICC interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.5.1
4.5.2
Read-out protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Flash write/erase protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.6
4.7
Related documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
5
Data EEPROM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
5.1
5.2
5.3
5.4
5.5
5.6
5.7
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Memory access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Power saving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Access error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Data EEPROM Read-out protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
6
Central processing unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
6.1
6.2
6.3
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2/166
Doc ID 8349 Rev 5
ST7LITE20F2 ST7LITE25F2 ST7LITE29F2
Contents
7
Supply, reset and clock management . . . . . . . . . . . . . . . . . . . . . . . . . . 33
7.1
7.2
7.3
7.4
7.5
Internal RC oscillator adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Phase locked loop (PLL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Multi-oscillator (MO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Reset sequence manager (RSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
7.5.1
7.5.2
7.5.3
7.5.4
7.5.5
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Asynchronous external RESET pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
External power-on RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Internal low voltage detector (LVD) RESET . . . . . . . . . . . . . . . . . . . . . . 39
Internal watchdog RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.6
System integrity management (SI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
7.6.1
7.6.2
7.6.3
7.6.4
Low voltage detector (LVD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Auxiliary Voltage Detector (AVD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
8
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
8.1
8.2
8.3
Non maskable software interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
External interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Peripheral interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
9
Power saving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
9.1
9.2
9.3
9.4
9.5
9.6
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
SLOW mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
WAIT mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
HALT mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
9.4.1
HALT mode recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
ACTIVE-HALT mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Auto-wakeup from HALT mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
9.6.1
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
10
I/O ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
10.1
10.2
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
10.2.1
Input modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Doc ID 8349 Rev 5
3/166
Contents
10.2.2
10.2.3
ST7LITE20F2 ST7LITE25F2 ST7LITE29F2
Output modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
10.3
10.4
10.5
10.6
10.7
I/O port implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Unused I/O pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Device-specific I/O port configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
11
On-chip peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
11.1
Watchdog timer (WDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
11.1.1
11.1.2
11.1.3
11.1.4
11.1.5
11.1.6
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Hardware watchdog option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
11.2
12-bit autoreload timer 2 (AT2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
11.2.1
11.2.2
11.2.3
11.2.4
11.2.5
11.2.6
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
11.3
Lite timer 2 (LT2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
11.3.1
11.3.2
11.3.3
11.3.4
11.3.5
11.3.6
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
11.4
Serial peripheral interface (SPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
11.4.1
11.4.2
11.4.3
11.4.4
11.4.5
11.4.6
11.4.7
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
Clock phase and clock polarity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Error Flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Doc ID 8349 Rev 5
4/166
ST7LITE20F2 ST7LITE25F2 ST7LITE29F2
11.4.8
Contents
Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
11.5
10-bit A/D converter (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
11.5.1
11.5.2
11.5.3
11.5.4
11.5.5
11.5.6
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
12
Instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
12.1
ST7 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
12.1.1
12.1.2
12.1.3
12.1.4
12.1.5
12.1.6
12.1.7
Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Indexed (no offset, short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Indirect (short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Indirect indexed (short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Relative mode (direct, indirect) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
12.2
Instruction groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
12.2.1
Illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
13
Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
13.1
Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
13.1.1
13.1.2
13.1.3
13.1.4
13.1.5
Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
13.2
13.3
Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
13.3.1
13.3.2
13.3.3
13.3.4
General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Operating conditions with low voltage detector (LVD) . . . . . . . . . . . . . 121
Auxiliary voltage detector (AVD) thresholds . . . . . . . . . . . . . . . . . . . . . 122
Internal RC oscillator and PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
13.4
13.5
13.6
Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Clock and timing characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
13.5.1
Crystal and ceramic resonator oscillators . . . . . . . . . . . . . . . . . . . . . . 129
Memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Doc ID 8349 Rev 5
5/166