ST7LITEUS2 ST7LITEUS5 8-bit MCU with single voltage Flash memory, ADC, timers Features Memories - 1 Kbytes single-voltage Flash Program memory with readout protection, ICP and IAP) 10 K write/erase cycles guaranteed data retention: 20 years at 55 C - 128 bytes RAM Clock, Reset and Supply management - 3-level low-voltage supervisor (LVD) and auxiliary voltage detector (AVD) for safe power-on/off - Clock sources: internal trimmable 8 MHz RC oscillator, internal low power, low frequency RC oscillator or external clock - Five power saving modes: Halt, Autowakeup from Halt, Active-halt, Wait, Slow Plastic DIP8 Interrupt management - 11 interrupt vectors plus TRAP and RESET - 5 external interrupt lines (on 5 vectors) I/O ports - 5 multifunctional bidirectional I/O lines - 1 additional Output line - 6 alternate function lines - 5 high sink outputs Table 1. o r P e c u d DFN8 Plastic DIP16 2 Timers - One 8-bit Lite timer (LT) with prescaler including: watchdog, one realtime base and one 8-bit input capture. - One 12-bit auto-reload timer (AT) with output compare function and PWM c u d ) s t( A/D Converter - 10-bit resolution for 0 to VDD - 5 input channels Instruction Set - 8-bit data manipulation - 63 basic instructions with illegal opcode detection - 17 main addressing modes - 8x8 unsigned multiply instruction e t le o r P o s b O - (t s) SO8 150" Development Tools - Full hardware/software development package - Debug module Device summary Features t e l o Program memory s b O ST7LITEUS2 ST7LITEUS5 1 Kbytes RAM (stack) 128 (64) bytes Peripherals LT Timer w/ Wdg, AT Timer w/ 1 PWM ADC Operating Supply - 10-bit 2.4 to 3.3 V @fCPU=4 MHz, 3.3 to 5.5 V @fCPU=8 MHz CPU Frequency Operating Temperature Packages up to 8 MHz RC -40 to +85 C / -40 to 125 C SO8 150", Pastic DIP8, DFN8, Pastic DIP16(1) 1. For development or tool prototyping purposes only. Not orderable in production quantities. February 2009 Rev 5 1/136 www.st.com 1 Contents ST7LITEUS2, ST7LITEUS5 Contents 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 2 Pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3 Register and memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 4 Flash program memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.3 Programming modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 In-circuit programming (ICP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 4.3.2 In application programming (IAP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 c u d 2 4.4 I C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 4.5 Memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 o r P 4.5.1 Readout protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 4.5.2 Flash Write/Erase protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 e t le o s b O - 4.6 Related documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 4.7 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 4.7.1 5 ) s t( 4.3.1 Flash Control/Status register (FCSR) . . . . . . . . . . . . . . . . . . . . . . . . . . 22 ) s ( ct Central processing unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 r P e 5.3 t e l o bs O 6 2/136 u d o CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3.1 Accumulator (A) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3.2 Index registers (X and Y) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3.3 Program counter (PC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 5.3.4 Condition Code register (CC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 5.3.5 Stack Pointer (SP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 Supply, reset and clock management . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.1 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 6.2 Internal RC oscillator adjustment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 ST7LITEUS2, ST7LITEUS5 6.3 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 6.4 6.3.1 Main Clock Control/Status register (MCCSR) . . . . . . . . . . . . . . . . . . . . 30 6.3.2 RC Control register (RCCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.3.3 System Integrity (SI) Control/status register (SICSR) . . . . . . . . . . . . . . 31 6.3.4 AVD Threshold Selection register (AVDTHCR) . . . . . . . . . . . . . . . . . . . 32 6.3.5 Clock Controller Control/Status register (CKCNTCSR) . . . . . . . . . . . . . 32 Reset sequence manager (RSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.5 7 Contents 6.4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 6.4.2 Asynchronous external RESET pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 6.4.3 External Power-on reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 6.4.4 Internal low voltage detector (LVD) reset . . . . . . . . . . . . . . . . . . . . . . . . 36 6.4.5 Internal watchdog reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 ) s t( Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 6.5.1 Multiplexed I/O Reset Control register 1 (MUXCR1) . . . . . . . . . . . . . . . 37 6.5.2 Multiplexed I/O Reset Control register 0 (MUXCR0) . . . . . . . . . . . . . . . 37 c u d o r P Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 7.1 Non maskable software interrupt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 7.2 External interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 7.3 Peripheral interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 7.4 e t le 7.3.1 External Interrupt Control register 1 (EICR1) . . . . . . . . . . . . . . . . . . . . . 41 7.3.2 External Interrupt Control register 2 (EICR2) . . . . . . . . . . . . . . . . . . . . . 42 ) s ( ct System integrity management (SI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 7.4.1 Low voltage detector (LVD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43 u d o 7.4.2 7.4.3 r P e 7.4.4 t e l o 8 o s b O - Auxiliary voltage detector (AVD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Power saving modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 O bs 8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 8.2 Slow mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 8.3 Wait mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 8.4 Active-halt and Halt modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 8.5 8.4.1 Active-halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 8.4.2 Halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Auto-wakeup from Halt mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 3/136 Contents ST7LITEUS2, ST7LITEUS5 8.5.1 9 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 I/O ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 10 9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 9.2 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 9.2.1 Input modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59 9.2.2 Output modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 9.2.3 Alternate functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 9.3 Unused I/O pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.4 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.6 I/O port implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 ) s t( On-chip peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 10.1 10.2 c u d Lite timer (LT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 o r P 10.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 10.1.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65 10.1.3 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 10.1.4 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 10.1.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 10.1.6 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69 e t le o s b O - 12-bit auto-reload timer (AT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 ) s ( ct 10.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 10.2.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 u d o 10.2.3 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 10.2.4 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 10.2.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 10.2.6 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 r P e t e l o 10.3 bs O 4/136 10-bit A/D converter (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 10.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 10.3.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 10.3.3 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79 10.3.4 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 10.3.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 10.3.6 Register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 ST7LITEUS2, ST7LITEUS5 11 Instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 11.1 11.2 ST7 addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 11.1.1 Inherent mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 11.1.2 Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 11.1.3 Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 11.1.4 Indexed mode (no offset, short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . 86 11.1.5 Indirect modes (short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 11.1.6 Indirect indexed modes (short, long) . . . . . . . . . . . . . . . . . . . . . . . . . . . 87 11.1.7 Relative modes (direct, indirect) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Instruction groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 11.2.1 12 Illegal opcode reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Electrical characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 12.1 c u d 12.1.1 Minimum and maximum values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 12.1.2 Typical values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 12.1.3 Typical curves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 12.1.4 Loading capacitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 12.1.5 Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 e t le o r P o s b O - 12.2 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 12.3 Operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 12.4 12.3.1 General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 12.3.2 Operating conditions with low voltage detector (LVD) . . . . . . . . . . . . . . 95 12.3.3 Auxiliary voltage detector (AVD) thresholds . . . . . . . . . . . . . . . . . . . . . . 96 t e l o ) s ( ct u d o Internal RC oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 Supply current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 r P e bs ) s t( Parameter conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 12.3.4 O Contents 12.4.1 Supply current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 12.4.2 Internal RC oscillator supply current characteristics . . . . . . . . . . . . . . 100 12.4.3 On-chip peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 12.5 Clock and timing characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 12.6 Memory characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 12.7 EMC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 12.8 12.7.1 Functional EMS (electromagnetic susceptibility) . . . . . . . . . . . . . . . . . 105 12.7.2 Electromagnetic Interference (EMI) . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 12.7.3 Absolute maximum ratings (electrical sensitivity) . . . . . . . . . . . . . . . . 106 I/O port pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 5/136 Contents ST7LITEUS2, ST7LITEUS5 12.9 12.8.1 General characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 12.8.2 Output driving current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . 109 Control pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 12.10 ADC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 13 14 Package characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 13.1 Package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118 13.2 Thermal characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Device configuration and ordering information . . . . . . . . . . . . . . . . . 123 14.1 Option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 14.1.1 OPTION BYTE 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 14.1.2 OPTION BYTE 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 ) s t( 14.2 Ordering information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 14.3 Development tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 14.4 c u d o r P 14.3.1 Starter kits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 14.3.2 Development and debugging tools . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 14.3.3 Programming tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128 14.3.4 Order codes for development and programming tools . . . . . . . . . . . . . 128 e t le o s b O - ST7 application notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 15 Known limitations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 16 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 ) s ( ct u d o r P e t e l o s b O 6/136 ST7LITEUS2, ST7LITEUS5 List of tables List of tables Table 1. Table 2. Table 3. Table 4. Table 5. Table 6. Table 7. Table 8. Table 9. Table 10. Table 11. Table 12. Table 13. Table 14. Table 15. Table 16. Table 17. Table 18. Table 19. Table 20. Table 21. Table 22. Table 23. Table 24. Table 25. Table 26. Table 27. Table 28. Table 29. Table 30. Table 31. Table 32. Table 33. Table 34. Table 35. Table 36. Table 37. Table 38. Table 39. Table 40. Table 41. Table 42. Table 43. Table 44. Table 45. Table 46. Table 47. Table 48. Device summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Device pin description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 Hardware register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 FLASH register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 Predefined RC oscillator calibration values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 Internal RC prescaler selection bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32 Clock register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Multiplexed IO register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Interrupt mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Interrupt sensitivity bits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 Description of low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 Description of interrupt events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46 System integrity register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 Enabling/disabling Active-halt and Halt modes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Configuring the dividing factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 AWU register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 DR register value and output pin status . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60 I/O port mode options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 I/O port configurations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62 Effect of low power modes on I/O ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Description of interrupt events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63 Port configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 I/O port register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Description of low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Interrupt events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Lite timer register map and reset values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70 Description of low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 Interrupt events . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74 Counter clock selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 Register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77 Effect of low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 Channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82 Configuring the ADC clock speed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 ADC register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 Description of addressing modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 ST7 addressing mode overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84 Instructions supporting inherent addressing mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 Instructions supporting inherent immediate addressing mode . . . . . . . . . . . . . . . . . . . . . . 86 Instructions supporting direct, indexed, indirect and indirect indexed addressing modes . 87 Instructions supporting relative modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 ST7 instruction set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88 Illegal opcode detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89 Voltage characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 Current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 General operating conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94 Operating characteristics with LVD. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95 Operating characteristics with AVD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96 c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e s b O t e l o 7/136 List of tables Table 49. Table 50. Table 51. Table 52. Table 53. Table 54. Table 55. Table 56. Table 57. Table 58. Table 59. Table 60. Table 61. Table 62. Table 63. Table 64. Table 65. Table 66. Table 67. Table 68. Table 69. Table 70. Table 71. Table 72. Table 73. Table 74. Table 75. Table 76. Table 77. Table 79. Table 80. Table 81. Table 82. ST7LITEUS2, ST7LITEUS5 Voltage drop between AVD flag set and LVD reset generation . . . . . . . . . . . . . . . . . . . . . 96 Internal RC oscillator characteristics (5.0 V calibration) . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Internal RC oscillator characteristics (3.3 V calibration) . . . . . . . . . . . . . . . . . . . . . . . . . . . 97 Supply current characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 Internal RC oscillator supply current . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 On-chip peripheral characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 General timings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 Auto-wakeup RC oscillator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103 RAM and Hardware registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 Flash Program memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 EMC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105 EMI characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Absolute maximum ratings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106 Electrical sensitivities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107 General characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Output driving current characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Asynchronous RESET pin characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 10-bit ADC characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 ADC accuracy with VDD = 3.3 to 5.5 V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 ADC accuracy with VDD = 2.7 to 3.3 V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 ADC accuracy with VDD = 2.4V to 2.7V . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 8-lead very thin fine pitch dual flat no-lead package mechanical data . . . . . . . . . . . . . . . 118 8-pin plastic small outline package, 150-mil width, package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 8-pin plastic dual in-line package, 300-mil width package mechanical data. . . . . . . . . . . 120 16-pin plastic dual in-line package, 300-mil width, package mechanical data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121 Thermal characteristics. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122 Startup clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 LVD threshold configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Definition of sector 0 size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124 Supported order codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125 Development tool order codes for the ST7LITEUSx family . . . . . . . . . . . . . . . . . . . . . . . 129 ST7 application notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129 Document revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134 c u d e t le ) s ( ct r P e u d o t e l o s b O 8/136 o s b O - o r P ) s t( ST7LITEUS2, ST7LITEUS5 List of figures List of figures Figure 1. Figure 2. Figure 3. Figure 4. Figure 5. Figure 6. Figure 7. Figure 8. Figure 9. Figure 10. Figure 11. Figure 12. Figure 13. Figure 14. Figure 15. Figure 16. Figure 17. Figure 18. Figure 19. Figure 20. Figure 21. Figure 22. Figure 23. Figure 24. Figure 25. Figure 26. Figure 27. Figure 28. Figure 29. Figure 30. Figure 31. Figure 32. Figure 33. Figure 34. Figure 35. Figure 36. Figure 37. Figure 38. Figure 39. Figure 40. Figure 41. Figure 42. Figure 43. Figure 44. General block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 8-pin SO and Plastic DIP package pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 8-pin DFN package pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 16-pin package pinout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Typical I2C interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 CPU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Stack manipulation example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Clock switching . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 Clock management block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 Reset sequence phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 Reset block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Reset sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 Interrupt processing flowchart. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 Low voltage detector vs reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Reset and supply management block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44 Using the AVD to monitor VDD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 Power saving mode transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 Slow mode clock transition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49 Wait mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50 Active-halt timing overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 Active-halt mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52 Halt timing overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 Halt mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53 AWUFH mode block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 AWUF Halt timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55 AWUFH mode flowchart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 I/O port general block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61 Interrupt I/O port state transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 Lite timer block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 Watchdog timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67 Input capture timing diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71 PWM function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72 PWM signal example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73 ADC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80 Pin loading conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 Pin input voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93 fCPU maximum operating frequency versus VDD supply voltage . . . . . . . . . . . . . . . . . . . . 95 Typical accuracy with RCCR=RCCR0 vs VDD= 2.4-6.0 V and temperature . . . . . . . . . . . 98 Typical accuracy with RCCR=RCCR1 vs VDD= 2.4-6.0V and temperature. . . . . . . . . . . . 98 Typical IDD in run mode vs. internal clock frequency and VDD . . . . . . . . . . . . . . . . . . . 101 Typical IDD in WFI mode vs. internal clock frequency and VDD . . . . . . . . . . . . . . . . . . . 101 Typical IDD in Slow, Slow-wait and Active-halt mode vs VDD & int RC = 8 MHz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101 IDD vs temp @VDD 5 V & int RC = 8 MHz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 IDD vs temp @VDD 5 V & int RC = 4 MHz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 IDD vs temp @VDD 5 V & int RC = 2 MHz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102 c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O Figure 45. Figure 46. Figure 47. 9/136 List of figures Figure 48. Figure 49. Figure 50. Figure 51. Figure 52. Figure 53. Figure 54. Figure 55. Figure 56. Figure 57. Figure 58. Figure 59. Figure 60. Figure 61. Figure 62. Figure 63. Figure 64. Figure 65. Figure 66. Figure 67. Figure 68. Figure 69. ST7LITEUS2, ST7LITEUS5 Two typical applications with unused I/O pin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108 Typical IPU vs. VDD with VIN=VSSl. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 Typical VOL at VDD = 2.4 V (standard pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Typical VOL at VDD = 3 V (standard pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Typical VOL at VDD = 5 V (standard pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110 Typical VOL at VDD = 2.4 V (HS pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Typical VOL at VDD = 3 V (HS pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Typical VOL at VDD = 5 V (HS pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111 Typical VDD-VOH at VDD = 2.4 V (HS pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Typical VDD-VOH at VDD = 3 V (HS pins). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Typical VDD-VOH at VDD = 5 V (HS pins). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112 Typical VOL vs. VDD (HS pins) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 Typical VDD-VOH vs. VDD (HS pins). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113 RESET pin protection when LVD is enabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114 RESET pin protection when LVD is disabled . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115 Typical application with ADC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116 ADC accuracy characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117 8-lead very thin fine pitch dual flat no-lead package outline . . . . . . . . . . . . . . . . . . . . . . . 118 8-pin plastic small outline package, 150-mil width package outline . . . . . . . . . . . . . . . . . 119 8-pin plastic dual in-line package, 300-mil width package outline . . . . . . . . . . . . . . . . . . 120 16-pin plastic dual in-line package, 300-mil width, package outline . . . . . . . . . . . . . . . . . 121 Option list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127 c u d e t le ) s ( ct u d o r P e t e l o s b O 10/136 o s b O - o r P ) s t( ST7LITEUS2, ST7LITEUS5 1 Introduction Introduction The ST7LITEUS2 and ST7LITEUS5 are members of the ST7 microcontroller family. All ST7 devices are based on a common industry-standard 8-bit core, featuring an enhanced instruction set. The ST7LITEUS2 and ST7LITEUS5 feature FLASH memory with byte-by-byte In-Circuit Programming (ICP) and In-Application Programming (IAP) capability. Under software control, the ST7LITEUS2 and ST7LITEUS5 can be placed in Wait, Slow, or Halt mode, reducing power consumption when the application is in idle or standby state. The enhanced instruction set and addressing modes of the ST7 offer both power and flexibility to software developers, enabling the design of highly efficient and compact application code. In addition to standard 8-bit data management, all ST7 microcontrollers feature true bit manipulation, 8x8 unsigned multiplication and indirect addressing modes. For easy reference, all parametric data are located in Section 12 on page 92. ) s t( The devices feature an on-chip debug module (DM) to support in-circuit debugging (ICD). For a description of the DM registers, refer to the ST7 I2C protocol reference manual. Figure 1. c u d General block diagram AWU RC OSC Internal Clock External Clock LVD VDD POWER SUPPLY VSS o r P e t e l o du ct (s) CONTROL 8-BIT CORE ALU 1 KByte FLASH MEMORY ADDRESS AND DATA BUS PA3 / RESET e t le o s b O - 8-MHz RC OSC o r P LITE TIMER with WATCHDOG PORT A 12-BIT AUTORELOAD TIMER PA5:0 (6 bits) 10-BIT ADC RAM (128 Bytes) s b O 11/136 Pin description 2 ST7LITEUS2, ST7LITEUS5 Pin description Figure 2. 1. 8-pin SO and Plastic DIP package pinout VDD 1 PA5 (HS) / AIN4 / CLKIN 2 ei4 ei0 7 PA0 (HS) / AIN0 / ATPWM / ICCDATA PA4 (HS) / AIN3/MCO 3 ei3 ei1 6 PA1 (HS) / AIN1 / ICCCLK PA3 / RESET 4 ei2 5 PA2 (HS) / LTIC / AIN2 8 VSS HS: High sink capability. 2. eix : associated external interrupt vector Figure 3. 8-pin DFN package pinout VDD 1 PA5 (HS) / AIN4 / CLKIN 2 ei4 PA4 (HS) / AIN3/MCO 3 ei3 PA3 / RESET 4 ) s ( ct 1. HS: High sink capability. 2. eix : associated external interrupt vector u d o r P e t e l o s b O 12/136 8 VSS ei0 7 PA0 (HS) / AIN0 / ATPWM / ICCDATA ei1 6 e t le so b O - c u d ) s t( ei2 5 o r P PA1 (HS) / AIN1 / ICCCLK PA2 (HS) / LTIC / AIN2 ST7LITEUS2, ST7LITEUS5 Figure 4. Pin description 16-pin package pinout Reserved 1) 1 1 NC VDD 2 1 VSS RESET 3 ei0 1 PA0 (HS) / AIN0 / ATPWM ICCCLK 4 ei1 1 PA1 (HS) / AIN1 PA5 (HS) / AIN4 / CLKIN 5 ei4 12 NC PA4 (HS) / AIN3/MCO 6 ei3 11 ICCDATA PA3 7 ei210 NC 8 9 PA2 (HS) / LTIC / AIN2 NC c u d 1. Reserved pins must be tied to ground. ) s t( 2. The differences versus the 8-pin packages are listed below: The I2C signals (ICCCLK and ICCDATA) are mapped on dedicated pins. The RESET signal is mapped on a dedicated pin. It is not multiplexed with PA3. PA3 pin is always configured as output. Any change on multiplexed IO reset control registers (MUXCR1 and MUXCR2) will have no effect on PA3 functionality. Refer to Section 6.5: Register description on page 37. e t le ) s ( ct o r P o s b O - u d o r P e t e l o s b O 13/136 Pin description ST7LITEUS2, ST7LITEUS5 Legend/abbreviations for Table 2 Type: I = input, O = output, S = supply In/Output level: CT= CMOS 0.3 VDD /0.7 VDD with input trigger Output level: HS = High sink (on N-buffer only) Port and control configuration Input: float = floating, wpu = weak pull-up, int = interrupt, ana = analog Output: OD = open drain, PP = push-pull The RESET configuration of each pin is shown in bold which is valid as long as the device is in reset state. Device pin description Port/control PP OD Output ana float int Input Output Pin name Input Pin no. Type Level wpu Table 2. Main function (after reset) Alternate function c u d 1 VDD S 2 PA5/AIN4/CLKIN I/ CT HS O X ei4 X X X Port A5 Analog input 4 or External Clock Input 3 PA4/AIN3/MCO I/ CT HS O X ei3 X X X Port A4 Analog input 3 or main clock output 4 PA3/RESET (1) O X X Port A3 RESET(1) 5 PA2/AIN2/LTIC I/ CT HS O X X Port A2 Analog input 2 or Lite Timer Input Capture 6 PA1/AIN1/ ICCCLK Main power supply ) s t( X I/ CT HS O X ei2 so b O - X ei1 X X X Port A1 Analog input 1 or In Circuit Communication Clock Caution: During normal operation this pin must be pulled-up, internally or externally (external pull-up of 10k mandatory in noisy environment). This is to avoid entering I2C mode unexpectedly during a reset. In the application, even if the pin is configured as output, any reset will put it back in pull-up X ei0 X X X Port A0 Analog input 0 or Auto-Reload Timer PWM or In Circuit Communication Data ) s ( ct u d o X e t le r P e t e l o 7 PA0/AIN0/ATPW M/ICCDATA I/ CT HS O 8 VSS S s b O o r P Ground 1. After a reset, the multiplexed PA3/RESET pin will act as RESET. To configure this pin as output (Port A3), write 55h to MUXCR0 and AAh to MUXCR1. For further details, please refer to Section 6.5 on page 37. 14/136 ST7LITEUS2, ST7LITEUS5 3 Register and memory map Register and memory map As shown in Figure 5, the MCU is capable of addressing 64K bytes of memories and I/O registers. The available memory locations consist of 128 bytes of register locations, 128 bytes of RAM and 1 Kbyte of user program memory. The RAM space includes up to 64 bytes for the stack from 00C0h to 00FFh. The highest address bytes contain the user reset and interrupt vectors. The Flash memory contains two sectors (see Figure 5) mapped in the upper part of the ST7 addressing space so the reset and interrupt vectors are located in Sector 0 (FE00h-FFFFh). The size of Flash Sector 0 and other device options are configurable by option byte. Warning: Figure 5. Memory locations marked as "Reserved" must never be accessed. Accessing a reserved area can have unpredictable effects on the device. c u d Memory map 0000h HW registers(1) o s b O 00C0h 64-byte stack RAM (128 Bytes) b 00FFh 00FFh 0100h (s) r P e FBFFh FC00h s b O t e l o DEE2h 1Kbytes FLASH PROGRAM MEMORY FC00h FDFFh FE00h Flash Memory (1 Kbytes) DEE0h DEE1h ct u d o o r P Short addressing RAM (zero page) 007Fh 0080h Reserved e t le 0080h ) s t( FFFFh DEE3h RCCRH0 RCCRL0 RCCRH1 RCCRL1 0.5 Kbytes SECTOR 1 0.5 Kbytes SECTOR 0 FFDFh FFE0h Interrupt & Reset vectors(3) FFFFh 1. See Table 3. 2. See Section 6.2 on page 28 for the description of RCCRHx registers. 3. See Table 9. 15/136 Register and memory map Table 3. Address 0000h 0001h 0002h ST7LITEUS2, ST7LITEUS5 Hardware register map (1) Block Port A Register label PADR PADDR PAOR Register name 000Dh 000Eh 000Fh 0010h 0011h 0012h 0013h LITE TIMER LTCSR LTICR R/W R/W R/W ATCSR CNTRH AUTO- CNTRL RELOAD ATRH TIMER ATRL PWMCR PWM0CSR Lite Timer Control/Status register Lite Timer Input Capture register 0xh 00h R/W Read only Timer Control/Status register Counter register High Counter register Low Auto-Reload register High Auto-Reload register Low PWM Output Control register PWM 0 Control/Status register 00h 00h 00h 00h 00h 00h 00h R/W Read only Read only R/W R/W R/W R/W Reserved area (3 bytes) AUTODCR0H RELOAD DCR0L TIMER PWM 0 Duty Cycle register High PWM 0 Duty Cycle register Low 0019h to 002Eh 0002Fh Remarks Reserved area (8 bytes) 0014h to 0016h 0017h 0018h 00h(2) 08h 02h(3) Port A Data register Port A Data Direction register Port A Option register 0003h000Ah 000Bh 000Ch Reset status e t le Reserved area (22 bytes) FLASH FCSR Flash Control/Status register 0030h to 0033h o s b O - c u d ) s t( 00h 00h R/W R/W 00h R/W o r P Reserved area (4 bytes) 0034h 0035h 0036h ADC ADCCSR ADCDRH ADCDRL A/D Control Status register A/D Data register High A/D Data register Low 00h xxh 00h R/W Read only R/W 0037h ITC EICR1 External Interrupt Control register 1 00h R/W 0038h MCC MCCSR Main Clock Control/Status register 00h R/W FFh 0000 0x00b R/W R/W 0039h 003Ah 003Bh to 003Ch u d o r P e Clock and RCCR Reset SICSR t e l o ) s ( ct RC oscillator Control register System Integrity Control/Status register Reserved area (2 bytes) 003Dh ITC EICR2 External Interrupt Control register 2 00h R/W 003Eh AVD AVDTHCR AVD Threshold Selection register 03h R/W Clock Controller Control/Status register 09h R/W 00h 00h R/W R/W s b O 003Fh Clock CKCNTCSR controller 0040h to 0046h 0047h 0048h 16/136 Reserved area (7 bytes) MuxIOreset MUXCR0 MUXCR1 Mux IO-Reset Control register 0 Mux IO-Reset Control register 1 ST7LITEUS2, ST7LITEUS5 Table 3. Register and memory map Hardware register map (continued)(1) Register label Address Block 0049h 004Ah AWU AWUPR AWUCSR AWU Prescaler register AWU Control/Status register FFh 00h R/W R/W DM(4) DMCR DMSR DMBK1H DMBK1L DMBK2H DMBK2L DM Control register DM Status register DM Breakpoint register 1 High DM Breakpoint register 1 Low DM Breakpoint register 2 High DM Breakpoint register 2 Low 00h 00h 00h 00h 00h 00h R/W R/W R/W R/W R/W R/W 004Bh 004Ch 004Dh 004Eh 004Fh 0050h Register name 0051h to 007Fh Reset status Remarks Reserved area (47 bytes) 1. Legend: x=undefined, R/W=read/write 2. The contents of the I/O port DR registers are readable only in output configuration. In input configuration, the values of the I/O pins are returned instead of the DR register contents. 3. The bits associated with unavailable pins must always keep their reset value. 4. For a description of the DM registers, see the ST7 I2C Protocol Reference Manual. c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 17/136 Flash program memory ST7LITEUS2, ST7LITEUS5 4 Flash program memory 4.1 Introduction The ST7 single voltage extended Flash (XFlash) is a non-volatile memory that can be electrically erased and programmed either on a byte-by-byte basis or up to 32 bytes in parallel. The XFlash devices can be programmed off-board (plugged in a programming tool) or onboard using in-circuit programming or in-application programming. The array matrix organization allows each sector to be erased and reprogrammed without affecting other sectors. 4.2 4.3 Main features ICP (in-circuit programming) IAP (in-application programming) ICT (in-circuit testing) for downloading and executing user application test patterns in RAM Sector 0 size configurable by option byte Readout and write protection Programming modes c u d e t le ) s t( o r P o s b O - The ST7 can be programmed in three different ways: Insertion in a programming tool In this mode, FLASH sectors 0 and 1 and option byte row can be programmed or erased. ) s ( ct In-circuit programming In this mode, FLASH sectors 0 and 1 and option byte row can be programmed or erased without removing the device from the application board. bs O 18/136 r P e t e l o 4.3.1 u d o In-application programming In this mode, sector 1 can be programmed or erased without removing the device from the application board and while the application is running. In-circuit programming (ICP) ICP uses a protocol called I2C (in-circuit communication) which allows an ST7 plugged on a printed circuit board (PCB) to communicate with an external programming device connected via cable. ICP is performed in three steps: Switch the ST7 to I2C mode. This is done by driving a specific signal sequence on the ICCCLK/DATA pins while the RESET pin is pulled low. When the ST7 enters I2C mode, it fetches a specific RESET vector which points to the ST7 system memory containing ST7LITEUS2, ST7LITEUS5 Flash program memory the I2C protocol routine. This routine enables the ST7 to receive bytes from the I2C interface. Download ICP driver code in RAM from the ICCDATA pin Execute ICP driver code in RAM to program the FLASH memory Depending on the ICP driver code downloaded in RAM, FLASH memory programming can be fully customized (number of bytes to program, program locations, or selection of the serial communication interface for downloading). 4.3.2 In application programming (IAP) This mode uses an IAP driver program previously programmed in Sector 0 by the user (in ICP mode). This mode is fully controlled by user software. This allows it to be adapted to the user application, (user-defined strategy for entering programming mode, choice of communications protocol used to fetch the data to be stored etc). IAP mode can be used to program any memory areas except Sector 0, which is write/erase protected to allow recovery in case errors occur during the programming operation. c u d I2C interface 4.4 ) s t( o r P ICP needs a minimum of 4 and up to 6 pins to be connected to the programming tool. These pins are: RESET: device reset VSS: device power supply ground ICCCLK: I2C output serial clock pin ICCDATA: I2C input serial data pin CLKIN: main clock input for external source VDD: application board power supply ) s ( ct e t le o s b O - Refer to Figure 6 for a description of the I2C interface. If the ICCCLK or ICCDATA pins are only used as outputs in the application, no signal isolation is necessary. As soon as the programming tool is plugged to the board, even if an I2C session is not in progress, the ICCCLK and ICCDATA pins are not available for the application. If they are used as inputs by the application, isolation such as a serial resistor has to be implemented in case another device forces the signal. Refer to the programming tool documentation for recommended resistor values. u d o r P e s b O t e l o During the ICP session, the programming tool must control the RESET pin. This can lead to conflicts between the programming tool and the application reset circuit if it drives more than 5 mA at high level (push pull output or pull-up resistor<1 k). A schottky diode can be used to isolate the application RESET circuit in this case. When using a classical RC network with R>1 k or a reset management IC with open drain output and pull-up resistor>1 k, no additional components are needed. In all cases the user must ensure that no external reset is generated by the application during the I2C session. The use of Pin 7 of the I2C connector depends on the programming tool architecture. This pin must be connected when using most ST programming tools (it is used to monitor the application power supply). Please refer to the programming tool manual. 19/136 Flash program memory ST7LITEUS2, ST7LITEUS5 Pin 9 has to be connected to the CLKIN pin of the ST7 when I2C mode is selected with option bytes disabled (35-pulse I2C entry mode). When option bytes are enabled (38-pulse I2C entry mode), the internal RC clock (internal RC or AWU RC) is forced. If internal RC is selected in the option byte, the internal RC is provided. If AWU RC or external clock is selected, the AWU RC oscillator is provided. A serial resistor must be connected to I2C connector pin 6 in order to prevent contention on PA3/RESET pin. Contention may occur if a tool forces a state on RESET pin while PA3 pin forces the opposite state in output mode. The resistor value is defined to limit the current below 2 mA at 5 V. If PA3 is used as output push-pull, then the application must be switched off to allow the tool to take control of the RESET pin (PA3). To allow the programming tool to drive the RESET pin below VIL, special care must also be taken when a pull-up is placed on PA3 for application reasons. Caution: During normal operation, ICCCLK pin must be pulled- up, internally or externally (external pull-up of 10 k mandatory in noisy environment). This is to avoid entering I2C mode unexpectedly during a reset. In the application, even if the pin is configured as output, any reset will put it back in input pull-up. Figure 6. Typical I2C interface c u d PROGRAMMING TOOL I2C CONNECTOR I2C Cable I2C CONNECTOR HE10 CONNECTOR TYPE (See Note 3) OPTIONAL (See Note 4) 9 7 5 10 8 6 so 3.3k (See Note 5) s b O 20/136 2 APPLICATION BOARD APPLICATION RESET SOURCE See Note 2 See Note 1 and Caution See Note 1 APPLICATION I/O ICCDATA ST7 o r P r P Memory protection e t e ol 4.5 4.5.1 4 b O - RESET u d o CLKIN VDD ) s ( ct 1 ICCCLK APPLICATION POWER SUPPLY e t le 3 ) s t( There are two different types of memory protection: readout protection and Write/Erase Protection which can be applied individually. Readout protection Readout protection, when selected provides a protection against program memory content extraction and against write access to Flash memory. Even if no protection can be considered as totally unbreakable, the feature provides a very high level of protection for a general purpose microcontroller. Program memory is protected. ST7LITEUS2, ST7LITEUS5 Flash program memory In flash devices, this protection is removed by reprogramming the option. In this case, program memory is automatically erased, and the device can be reprogrammed. Readout protection selection depends on the device type: 4.5.2 In Flash devices it is enabled and removed through the FMP_R bit in the option byte. In ROM devices it is enabled by mask option specified in the option list. Flash Write/Erase protection Write/erase protection, when set, makes it impossible to both overwrite and erase program memory. Its purpose is to provide advanced security to applications and prevent any change being made to the memory content. Warning: Once set, Write/erase protection can never be removed. A write-protected flash device is no longer reprogrammable. Write/erase protection is enabled through the FMP_W bit in the option byte. 4.6 c u d Related documentation ) s t( o r P For details on Flash programming and I2C protocol, refer to the ST7 Flash programming reference manual and to the ST7 I2C protocol reference manual. e t le ) s ( ct o s b O - u d o r P e t e l o s b O 21/136 Flash program memory ST7LITEUS2, ST7LITEUS5 4.7 Register description 4.7.1 Flash Control/Status register (FCSR) This register controls the XFlash erasing and programming using ICP, IAP or other programming methods. 1st RASS Key: 0101 0110 (56h) 2nd RASS Key: 1010 1110 (AEh) When an EPB or another programming tool is used (in socket or ICP mode), the RASS keys are sent automatically. Reset value: 000 0000 (00h) 7 0 0 0 0 0 0 OPT LAT PGM Read/write Table 4. Address (Hex.) 002Fh FLASH register map and reset values Register Label FCSR Reset value 7 6 5 4 0 0 0 0 ) s ( ct u d o r P e t e l o s b O 22/136 3 o s b O - e t le 0 2 o r P c u d OPT 0 ) s t( 1 0 LAT 0 PGM 0 ST7LITEUS2, ST7LITEUS5 Central processing unit 5 Central processing unit 5.1 Introduction This CPU has a full 8-bit architecture and contains six internal registers allowing efficient 8bit data manipulation. 5.2 5.3 Main features 63 basic instructions Fast 8-bit by 8-bit multiply 17 main addressing modes Two 8-bit index registers 16-bit stack pointer Low power modes Maskable hardware interrupts Non-maskable software interrupt c u d CPU registers e t le ) s t( o r P The six CPU registers shown in Figure 7 are not present in the memory mapping and are accessed by specific instructions. 5.3.1 Accumulator (A) o s b O - The Accumulator is an 8-bit general purpose register used to hold operands and the results of the arithmetic and logic calculations and to manipulate data. ) s ( ct 5.3.2 Index registers (X and Y) u d o In indexed addressing modes, these 8-bit registers are used to create either effective addresses or temporary storage areas for data manipulation. (The cross-assembler generates a precede instruction (PRE) to indicate that the following instruction refers to the Y register.) r P e t e l o The Y register is not affected by the interrupt automatic procedures (not pushed to and popped from the stack). s b O 5.3.3 Program counter (PC) The program counter is a 16-bit register containing the address of the next instruction to be executed by the CPU. It is made of two 8-bit registers PCL (program counter low which is the LSB) and PCH (program counter high which is the MSB). 23/136 Central processing unit Figure 7. ST7LITEUS2, ST7LITEUS5 CPU registers 7 0 ACCUMULATOR RESET VALUE = XXh 7 0 X INDEX REGISTER RESET VALUE = XXh 7 0 Y INDEX REGISTER RESET VALUE = XXh PCH 15 PCL 8 7 0 PROGRAM COUNTER RESET VALUE = RESET VECTOR @ FFFEh-FFFFh 7 0 1 1 1 H I N Z C CONDITION CODE REGISTER RESET VALUE = 1 1 1 X 1 X X X 15 8 7 0 STACK POINTER RESET VALUE = STACK HIGHER ADDRESS c u d 1. X = Undefined value 5.3.4 Condition Code register (CC) ) s t( o r P The 8-bit Condition Code register contains the interrupt mask and four flags representative of the result of the instruction just executed. This register can also be handled by the PUSH and POP instructions. e t le o s b O - These bits can be individually tested and/or controlled by specific instructions. Reset value: 111x1xxx 7 1 (s) 1 1 ct u d o r P e t e l o s b O 24/136 H I Read/Write 0 N Z C ST7LITEUS2, ST7LITEUS5 Central processing unit Bit 7:5 Set to `1' Bit 4 H Half carry This bit is set by hardware when a carry occurs between bits 3 and 4 of the ALU during an ADD or ADC instruction. It is reset by hardware during the same instructions. 0: No half carry has occurred. 1: A half carry has occurred. This bit is tested using the JRH or JRNH instruction. The H bit is useful in BCD arithmetic subroutines. Bit 3 I Interrupt mask This bit is set by hardware when entering in interrupt or by software to disable all interrupts except the TRAP software interrupt. This bit is cleared by software. 0: Interrupts are enabled. 1: Interrupts are disabled. This bit is controlled by the RIM, SIM and IRET instructions and is tested by the JRM and JRNM instructions. Note: Interrupts requested while I is set are latched and can be processed when I is cleared. By default an interrupt routine is not interruptible because the I bit is set by hardware at the start of the routine and reset by the IRET instruction at the end of the routine. If the I bit is cleared by software in the interrupt routine, pending interrupts are serviced regardless of the priority level of the current interrupt routine. c u d ) s t( o r P Bit 2 N Negative This bit is set and cleared by hardware. It is representative of the result sign of the last arithmetic, logical or data manipulation. It is a copy of the 7th bit of the result. 0: The result of the last operation is positive or null. 1: The result of the last operation is negative (that is, the most significant bit is a logic 1). This bit is accessed by the JRMI and JRPL instructions. e t le ) s ( ct o s b O - Bit 1 Z Zero This bit is set and cleared by hardware. This bit indicates that the result of the last arithmetic, logical or data manipulation is zero. 0: The result of the last operation is different from zero. 1: The result of the last operation is zero. This bit is accessed by the JREQ and JRNE test instructions. u d o r P e s b O t e l o Bit 0 = C Carry/borrow This bit is set and cleared by hardware and software. It indicates an overflow or an underflow has occurred during the last arithmetic operation. 0: No overflow or underflow has occurred. 1: An overflow or underflow has occurred. This bit is driven by the SCF and RCF instructions and tested by the JRC and JRNC instructions. It is also affected by the "bit test and branch", shift and rotate instructions. 25/136 Central processing unit 5.3.5 ST7LITEUS2, ST7LITEUS5 Stack Pointer (SP) Reset value: 00 FFh 15 0 8 0 0 0 0 0 0 0 Read/write 7 1 0 1 SP5 SP4 SP3 SP2 SP1 SP0 Read/write The Stack Pointer is a 16-bit register which is always pointing to the next free location in the stack. It is then decremented after data has been pushed onto the stack and incremented before data is popped from the stack (see Figure 8). Since the stack is 64 bytes deep, the 10 most significant bits are forced by hardware. Following an MCU Reset, or after a Reset Stack Pointer instruction (RSP), the Stack Pointer contains its reset value (the SP5 to SP0 bits are set) which is the stack higher address. c u d ) s t( The least significant byte of the Stack Pointer (called S) can be directly accessed by a LD instruction. Note: o r P When the lower limit is exceeded, the Stack Pointer wraps around to the stack upper limit, without indicating the stack overflow. The previously stored information is then overwritten and therefore lost. The stack also wraps in case of an underflow. e t le The stack is used to save the return address during a subroutine call and the CPU context during an interrupt. The user may also directly manipulate the stack by means of the PUSH and POP instructions. In the case of an interrupt, the PCL is stored at the first location pointed to by the SP. Then the other registers are stored in the next locations as shown in Figure 8. ) s ( ct o s b O - When an interrupt is received, the SP is decremented and the context is pushed on the stack. On return from interrupt, the SP is incremented and the context is popped from the stack. u d o A subroutine call is located at two locations and an interrupt five locations in the stack area. r P e t e l o s b O 26/136 ST7LITEUS2, ST7LITEUS5 Figure 8. Central processing unit Stack manipulation example CALL subroutine PUSH Y Interrupt event POP Y RET or RSP IRET @ 00C0h SP SP CC A SP CC A X X X PCH PCH PCH PCL PCL PCL PCH PCH PCH PCH PCH PCL PCL PCL PCL PCL SP @ 00FFh Y CC A SP SP 1. Stack higher address = 00FFh. c u d 2. Stack lower address = 00C0h. e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 27/136 Supply, reset and clock management 6 ST7LITEUS2, ST7LITEUS5 Supply, reset and clock management The device includes a range of utility features for securing the application in critical situations (for example in case of a power brown-out), and reducing the number of external components. 6.1 Main features 6.2 Clock management - 8 MHz internal RC oscillator (enabled by option byte) - External clock Input (enabled by option byte) Reset sequence manager (RSM) System integrity management (SI) - Main supply low voltage detection (LVD) with reset generation (enabled by option byte) - Auxiliary voltage detector (AVD) with interrupt capability for monitoring the main supply c u d Internal RC oscillator adjustment e t le ) s t( o r P The ST7 contains an internal RC oscillator with a specific accuracy for a given device, temperature and voltage. It can be selected as the start up clock through the CKSEL[1:0] option bits (see Section 14.1 on page 123). It must be calibrated to obtain the frequency required in the application. This is done by software writing a 10-bit calibration value in the RCCR (RC Control register) and in the bits [6:5] in the SICSR (SI Control Status register). o s b O - Whenever the microcontroller is reset, the RCCR returns to its default value (FFh), i.e. each time the device is reset, the calibration value must be loaded in the RCCR. Predefined calibration values are stored in Flash memory for 3.3 and 5 V VDD supply voltages at 25C, as shown in the following table. Table 5. u d o Predefined RC oscillator calibration values r P e RCCR RCCRH0 t e l o RCCRL0 s b O 28/136 RCCRH1 RCCRL1 ) s ( ct Conditions ST7LITEUS2/ST7LITEUS5 address VDD=5 V TA=25 C fRC=8 MHz DEE0h(1) (CR[9:2] bits) VDD=3.3 V TA=25 C fRC=8 MHz DEE2h 1) (CR[9:2] bits) DEE1h 1) (CR[1:0] bits) DEE3h 1) (CR[1:0] bits) 1. DEE0h, DEE1h, DEE2h and DEE3h are located in a reserved area butare special bytes containing also the RC calibration values which are read-accessible only in user mode. If all the Flash space (including the RC calibration value locations) has been erased (after the readout protection removal), then the RC calibration values can still be obtained through these two addresses. ST7LITEUS2, ST7LITEUS5 Supply, reset and clock management 1 In I2C mode, the internal RC oscillator is forced as a clock source, regardless of the selection in the option byte. Refer to note 5 in Section 4.4 on page 19 for further details. 2 See Section 12: Electrical characteristics for more information on the frequency and accuracy of the RC oscillator. 3 To improve clock stability and frequency accuracy, it is recommended to place a decoupling capacitor, typically 100nF, between the VDD and VSS pins as close as possible to the ST7 device. Caution: If the voltage or temperature conditions change in the application, the frequency may need to be recalibrated. Note: Refer to application note AN2326 for information on how to calibrate the RC frequency using an external reference signal. The ST7LITEUS2 and ST7LITEUS5 also contain an Auto-wakeup RC oscillator. This RC oscillator should be enabled to enter Auto-wakeup from Halt mode. The Auto-wakeup RC oscillator can also be configured as the startup clock through the CKSEL[1:0] option bits (see Section 14.1 on page 123). ) s t( This is recommended for applications where very low power consumption is required. c u d Switching from one startup clock to another can be done in run mode as follows (see Figure 9): Case 1 Switching from internal RC to AWU: e t le o r P 1. Set the RC/AWU bit in the CKCNTCSR register to enable the AWU RC oscillator 2. The RC_FLAG is cleared and the clock output is at 1. 3. Wait 3 AWU RC cycles till the AWU_FLAG is set 4. The switch to the AWU clock is made at the positive edge of the AWU clock signal 5. Once the switch is made, the internal RC is stopped ) s ( ct Case 2 o s b O - Switching from AWU RC to internal RC: Reset the RC/AWU bit to enable the internal RC oscillator 2. Using a 4-bit counter, wait until 8 internal RC cycles have elapsed. The counter is running on internal RC clock. 3. r P e t e l o s b O Note: u d o 1. 4. 5. Wait till the AWU_FLAG is cleared (1AWU RC cycle) and the RC_FLAG is set (2 RC cycles) The switch to the internal RC clock is made at the positive edge of the internal RC clock signal Once the switch is made, the AWU RC is stopped 1 When the internal RC is not selected, it is stopped so as to save power consumption. 2 When the internal RC is selected, the AWU RC is turned on by hardware when entering Auto-wakeup from Halt mode. 3 When the external clock is selected, the AWU RC oscillator is always on. 29/136 Supply, reset and clock management Figure 9. ST7LITEUS2, ST7LITEUS5 Clock switching Internal RC Set RC/AWU Poll AWU_FLAG until set AWU RC Reset RC/AWU Poll RC_FLAG until set 6.3 Register description 6.3.1 Main Clock Control/Status register (MCCSR) AWU RC Internal RC Reset value: 0000 0000 (00h) 7 0 0 0 0 0 0 0 MCO c u d Read / Write Bits 7:2 Reserved, must be kept cleared. ) s t( SMS o r P Bit 1 MCO Main Clock Out enable bit This bit is read/write by software and cleared by hardware after a reset. This bit allows to enable the MCO output clock. 0: MCO clock disabled, I/O port free for general purpose I/O. 1: MCO clock enabled. e t le o s b O - Bit 0 SMS Slow Mode select This bit is read/write by software and cleared by hardware after a reset. This bit selects the input clock fOSC or fOSC/32. 0: Normal mode (fCPU = fOSC ) 1: Slow mode (fCPU = fOSC/32) ) s ( ct u d o r P e t e l o s b O 30/136 ST7LITEUS2, ST7LITEUS5 6.3.2 Supply, reset and clock management RC Control register (RCCR) Reset value: 1111 1111 (FFh) 7 0 CR9 CR8 CR7 CR6 CR5 CR4 CR3 CR2 Read / Write Bits 7:0 CR[9:2] RC Oscillator Frequency Adjustment Bits These bits, as well as CR[1:0] bits in the SICSR register must be written immediately after reset to adjust the RC oscillator frequency and to obtain the required accuracy. The application can store the correct value for each voltage range in Flash memory and write it to this register at startup. 00h = maximum available frequency FFh = lowest available frequency Note: To tune the oscillator, write a series of different values in the register until the correct frequency is reached. The fastest method is to use a dichotomy starting with 80h. 6.3.3 c u d System Integrity (SI) Control/status register (SICSR) Reset value: 0000 0x00 (0xh) e t le 7 0 CR1 CR0 0 0 o r P LVDRF ) s t( 0 AVDF AVDIE o s b O Read / Write Bit 7 Reserved, must be kept cleared. ) s ( ct Bits 6:5 CR[1:0] RC Oscillator Frequency Adjustment bits These bits, as well as CR[9:2] bits in the RCCR register must be written immediately after reset to adjust the RC oscillator frequency and to obtain the required accuracy. Refer to Section 6.2 on page 28. u d o Bits 4:3 Reserved, must be kept cleared. r P e Bits 2:0 System Integrity bits. Refer to Section 7.4 on page 43. t e l o s b O 31/136 Supply, reset and clock management 6.3.4 ST7LITEUS2, ST7LITEUS5 AVD Threshold Selection register (AVDTHCR) Reset value: 0000 0011 (03h) 7 0 CK2 CK1 CK0 0 0 0 AVD1 AVD0 Read / Write Bits 7:5 CK[2:0] Internal RC Prescaler Selection These bits are set by software and cleared by hardware after a reset. These bits select the prescaler of the internal RC oscillator. See Figure 10 on page 34 and Table 6. Bits 4:2 Reserved, must be kept cleared. Bits 1:0 AVD Threshold Selection bits. Refer to Section 7.4: System integrity management (SI). Internal RC prescaler selection bits(1) Table 6. CK2 CK1 CK0 fOSC 0 0 0 fRC 0 0 1 fRC/2 0 1 0 fRC/4 0 1 1 1 0 0 e t le c u d ) s t( o r P fRC/8 o s b O - fRC/16 1. If the internal RC is used with a supply operating range below 3.3 V, a division ratio of at least 2 must be enabled in the RC prescaler. 6.3.5 Clock Controller Control/Status register (CKCNTCSR) ) s ( ct Read/Write Reset value: 0000 1001 (09h) 7 u d o r P e 0 t e l o s b O 32/136 0 0 0 0 AWU_FLAG RC_ FLAG Read / Write Bits 7:4 Reserved, must be kept cleared. Bit 3 AWU_FLAG AWU Selection This bit is set and cleared by hardware 0: No switch from AWU to RC requested 1: AWU clock activated and temporization completed 0 RC/AWU ST7LITEUS2, ST7LITEUS5 Supply, reset and clock management Bit 2 RC_FLAG RC Selection This bit is set and cleared by hardware 0: No switch from RC to AWU requested 1: RC clock activated and temporization completed Bit 1 = Reserved, must be kept cleared. Bit 0 = RC/AWU RC/AWU Selection 0: RC enabled 1: AWU enabled (default value) Table 7. Address (Hex.) Clock register map and reset values Register label 7 6 5 4 3 2 1 0 SMS 0 0038h MCCSR Reset value 0 0 0 0 0 0 MCO 0 0039h RCCR reset value CR9 1 CR8 1 CR7 1 CR6 1 CR5 1 CR4 1 CR3 1 003Ah SICSR reset value 0 CR1 CR0 0 0 LVDRF x 003Eh AVDTHCR reset value CK2 0 CK1 0 CK0 0 uc 0 0 0 AVD1 1 AVD2 1 003Fh CKCNTCSR reset value 0 0 0 0 AWU_FLAG 1 RC_FLAG 0 0 RC/AWU 1 ) s ( ct d o r P e let AVDF 0 ) s t( CR2 1 AVDIE 0 o s b O - u d o r P e t e l o s b O 33/136 Supply, reset and clock management ST7LITEUS2, ST7LITEUS5 Figure 10. Clock management block diagram CR9 CR8 CR7 CR6 CR5 CR1 CR4 CR3 CR2 RCCR SICSR CR0 Tunable internal RC Oscillator RC/AWU CKCNTCSR Clock Controller 8MHz(fRC) Prescaler 8 MHz RC OSC 4 MHz 2 MHz fOSC AWU CK Ext Clock 1 MHz 500 kHz 33kHz AWU RC CLKIN CKSEL[1:0] Option bits /2 DIVIDER fCLKIN c u d fLTIMER 13-BIT LITE TIMER COUNTER fOSC fOSC (s) t c u d o r P e t e l o s b O 34/136 e t le o s b O - fOSC/32 /32 DIVIDER 0 1 ) s t( o r P (1ms timebase @ 8 MHz fOSC) fCPU TO CPU AND PERIPHERALS MCO SMS MCCSR MCO ST7LITEUS2, ST7LITEUS5 Supply, reset and clock management 6.4 Reset sequence manager (RSM) 6.4.1 Introduction The reset sequence manager includes three reset sources as shown in Figure 12: Note: External RESET source pulse Internal LVD reset (low voltage detection) Internal WATCHDOG reset A reset can also be triggered following the detection of an illegal opcode or prebyte code. Refer to Figure 12. These sources act on the RESET pin and it is always kept low during the delay phase. The RESET service routine vector is fixed at addresses FFFEh-FFFFh in the ST7 memory map. The basic reset sequence consists of 3 phases as shown in Figure 11: Caution: Active phase depending on the reset source 64 CPU clock cycle delay RESET vector fetch c u d ) s t( When the ST7 is unprogrammed or fully erased, the Flash is blank and the RESET vector is not programmed. For this reason, it is recommended to keep the RESET pin in low state until programming mode is entered, in order to avoid unwanted behavior. e t le o r P The 64 CPU clock cycle delay allows the oscillator to stabilise and ensures that recovery has taken place from the Reset state. o s b O - The RESET vector fetch phase duration is 2 clock cycles. Figure 11. Reset sequence phases (s) t c u Active phase RESET INTERNAL RESET 64 CLOCK CYCLES FETCH VECTOR d o r P e t e l o s b O 35/136 Supply, reset and clock management ST7LITEUS2, ST7LITEUS5 Figure 12. Reset block diagram VDD RON RESET INTERNAL RESET FILTER WATCHDOG RESET PULSE GENERATOR ILLEGAL OPCODE RESET 1) LVD RESET 1. Section 11.2.1: Illegal opcode reset for more details on illegal opcode reset conditions 6.4.2 Asynchronous external RESET pin c u d ) s t( The RESET pin is both an input and an open-drain output with integrated RON weak pull-up resistor. This pull-up has no fixed value but varies in accordance with the input voltage. It can be pulled low by external circuitry to reset the device. See Electrical Characteristic section for more details. o r P A RESET signal originating from an external source must have a duration of at least th(RSTL)in in order to be recognized (see Figure 13). This detection is asynchronous and therefore the MCU can enter reset state even in Halt mode. e t le o s b O - The RESET pin is an asynchronous signal which plays a major role in EMS performance. In a noisy environment, it is recommended to follow the guidelines mentioned in the electrical characteristics section. ) s ( ct 6.4.3 External Power-on reset If the LVD is disabled by option byte, to start up the microcontroller correctly, the user must ensure by means of an external reset circuit that the reset signal is held low until VDD is over the minimum level specified for the selected fCLKIN frequency. u d o r P e A proper reset signal for a slow rising VDD supply can generally be provided by an external RC network connected to the RESET pin. t e l o 6.4.4 bs O Internal low voltage detector (LVD) reset Two different reset sequences caused by the internal LVD circuitry can be distinguished: Power-on reset Voltage Drop reset The device RESET pin acts as an output that is pulled low when VDD - - - - - - - JRULE Jump if (C + Z = 1) Unsigned - - - - - - - LD Load dst src reg, M M, reg - - N Z - MUL Multiply X,A = X * A A, X, Y X, Y, A 0 - - - 0 JRC s b O JRNC 90/136 H=1? ) s ( ct r P e H=0? e t le - u d o t e l o JRNE jrf * b O - Pr - od uc - N ST7LITEUS2, ST7LITEUS5 Table 42. Instruction set Illegal opcode detection (continued) Mnemo Description Function/example Dst Src H I N Z C NEG Negate (2's compl) neg $10 reg, M - - - N Z C NOP No operation - - - - - - - OR OR operation A=A+M A M - - N Z - POP Pop from the stack pop reg reg M - - - - - pop CC CC M H I N Z C PUSH Push onto the stack push Y M reg, CC - - - - - RCF Reset carry flag C=0 - - - - - - 0 RET Subroutine return - - - - - - - RIM Enable Interrupts I=0 - - - 0 - - - RLC Rotate left true C C Dst C reg, M - - - N Z C RRC Rotate right true C C Dst C reg, M - - - N RSP Reset Stack Pointer S = Max allowed - - - - - SBC Subtract with carry A=A-M-C A M - - SCF Set carry flag C=1 - - - SIM Disable interrupts I=1 - - SLA Shift left arithmetic C Dst 0 reg, M - SLL Shift left logic C Dst 0 reg, M SRL Shift right logic 0 Dst C reg, M SRA Shift right arithmetic Dst7 Dst C SUB Subtraction SWAP ) s t( Z C - - Z C - - 1 1 - - - - - N Z C - - - N Z C - - - 0 Z C reg, M - - - N Z C A=A-M A M - - N Z C SWAP nibbles Dst[7..4] Dst[3..0] reg, M - - - N Z - TNZ Test for Neg & Zero tnz lbl1 - - - - N Z - TRAP S/W trap S/W interrupt - - - 1 - - WFI Wait for interrupt - - - 0 - - - XOR Exclusive OR A M - - N Z - r P e u d o ) s ( ct so b O - A = A XOR M e t le Pr - od uc - N t e l o s b O 91/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 12 Electrical characteristics 12.1 Parameter conditions Unless otherwise specified, all voltages are referred to VSS. 12.1.1 Minimum and maximum values Unless otherwise specified the minimum and maximum values are guaranteed in the worst conditions of ambient temperature, supply voltage and frequencies by tests in production on 100% of the devices with an ambient temperature at TA=25 C and TA=TAmax (given by the selected temperature 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 minimum and maximum values refer to sample tests and represent the mean value plus or minus three times the standard deviation (mean3). 12.1.2 Typical values c u d ) s t( Unless otherwise specified, typical data are based on TA=25 C, VDD=5 V (for the 4.5 VVDD5.5 V voltage range), VDD=3.75 V (for the 3 VVDD4.5 V voltage range) and VDD=2.7 V (for the 2.4 VVDD3 V voltage range). They are given only as design guidelines and are not tested. 12.1.3 e t le Typical curves o s b O - o r P Unless otherwise specified, all typical curves are given only as design guidelines and are not tested. 12.1.4 Loading capacitor ) s ( ct The loading conditions used for pin parameter measurement are shown in Figure 37. u d o Figure 37. Pin loading conditions r P e t e l o s b O 92/136 ST7 PIN CL ST7LITEUS2, ST7LITEUS5 12.1.5 Electrical characteristics Pin input voltage The input voltage measurement on a pin of the device is described in Figure 38. Figure 38. Pin input voltage ST7 PIN VIN 12.2 Absolute maximum ratings Stresses above those listed as "absolute maximum ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device under these conditions is not implied. Exposure to maximum rating conditions for extended periods may affect device reliability. c u d ) s t( 1. Directly connecting the I/O pins to VDD or VSS could damage the device if an unexpected change of the I/O configuration occurs (for example, due to a corrupted program counter). To guarantee safe operation, this connection has to be done through a pull-up or pull-down resistor (typical: 10 k for I/Os). Unused I/O pins must be tied in the same way to VDD or VSS according to their reset configuration. Table 43. Voltage characteristics Symbol o s b O Ratings VDD - VSS Supply voltage ) s ( ct Input voltage on any VIN VESD(HBM) r P e pin(1) Electrostatic discharge voltage (Human Body Model) u d o VESD(MM) e t le Electrostatic discharge voltage (Machine Model) o r P Maximum value Unit 7.0 V VSS-0.3 to VDD+0.3 see Section 12.7.2 see Section 12.7.2 1. IINJ(PIN) must never be exceeded. This is implicitly insured if VIN maximum is respected. If VIN maximum cannot be respected, the injection current must be limited externally to the IINJ(PIN) value. A positive injection is induced by VIN>VDD while a negative injection is induced by VINVDD while a negative injection is induced by VIN 1 AVDF flag toggle threshold (VDD fall) High threshold Med. threshold Low threshold 3.9 3.3 2.5 4.3 3.6 2.8 4.7 4.0 3.1 Vhys AVD voltage threshold hysteresis VIT+(AVD)-VIT-(AVD) Symbol Parameter Conditions VIT+(AVD) 1 => 0 AVDF flag toggle threshold (VDD rise) Unit V 150 mV 1. Refer to Section : Monitoring the VDD main supply. 2. Not tested in production, guaranteed by characterization. Table 49. Voltage drop between AVD flag set and LVD reset generation uc Parameter Min (1) Typ (1) AVD med. threshold - AVD low. threshold 800 850 AVD high. threshold - AVD low threshold 1400 1450 AVD high. threshold - AVD med. threshold 600 650 750 AVD low threshold - LVD low threshold 100 200 250 1050 1150 o s b O - e t le Pr Max (1) 950 1550 mV 950 AVD med. threshold - LVD med. threshold 250 300 400 AVD high. threshold - LVD low threshold 1600 1700 1800 900 1000 1050 ) s ( ct Unit od AVD med. threshold - LVD low threshold AVD high. threshold - LVD med. threshold ) s t( 1. Not tested in production, guaranteed by characterization. 12.3.4 u d o Internal RC oscillator r P e To improve clock stability and frequency accuracy, it is recommended to place a decoupling capacitor, typically 100 nF, between the VDD and VSS pins as close as possible to the ST7 device. t e l o Internal RC oscillator calibrated at 5.0 V bs O 96/136 The ST7 internal clock can be supplied by an internal RC oscillator (selectable by option byte). ST7LITEUS2, ST7LITEUS5 Table 50. Electrical characteristics Internal RC oscillator characteristics (5.0 V calibration) Symbol Parameter Conditions tsu(RC) RC oscillator setup time Max Unit 4.4 MHz RCCR = RCCR0(1), TA= 25 C, VDD =5V Accuracy of internal RC oscillator with RCCR=RCCR0(1) ACCRC Typ RCCR = FF (reset value), TA= 25 C, VDD= 5 V Internal RC oscillator frequency fRC Min 8 TA= 25 C, VDD = 4.5 to 5.5 V (2) -2.0 +2.0 % TA= 0 to +85 C, VDD = 4.5 to 5.5 V (2) -2.5 +4.0 % TA= 0 to +125 C, VDD= 4.5 to 5.5 V (2) -3.0 +5.0 % TA= -40 C to 0 C, VDD= 4.5 to 5.5 V (2) -4.0 +2.5 % s 4 (2) TA= 25C, VDD= 5 V 1. See Section 6.2: Internal RC oscillator adjustment 2. Tested in production at 5.0 V only c u d Internal RC oscillator calibrated at 3.3 V ) s t( o r P The ST7 internal clock can be supplied by an internal RC oscillator (selectable by option byte). Table 51. Symbol Parameter Conditions tsu(RC) t e l o r P e RC oscillator setup time Min Typ Max Unit 4.3 MHz RCCR = RCCR1(1) , TA=25 C,VDD= 3.3 V ) s ( ct u d o ACCRC Accuracy of internal RC oscillator with RCCR=RCCR1(1) o s b O - RCCR = FF (reset value), TA=25 C,VDD= 3.3 V Internal RC oscillator frequency fRC e t le Internal RC oscillator characteristics (3.3 V calibration) 8 TA=25C, VDD = 3.0 to 3.6 V(2) -1.0 +1.0 % TA=0 to +85 C, VDD = 3.0 to 3.6 V (2) -2.5 +4.0 % TA=0 to +125 C, VDD = 3.0 to 3.6 V (2) -3.0 +5.0 % TA = -40 C to 0 C, VDD = 3.0 to 3.6 V (2) -4.0 +2.5 % TA= 25 C, VDD = 3.3 V 4 (2) s 1. See Section 6.2: Internal RC oscillator adjustment s b O 2. Tested in production at 3.3 V only 97/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 Accuracy (%) Figure 40. Typical accuracy with RCCR=RCCR0 vs VDD= 2.4-6.0 V and temperature 2.2 2.0 1.8 1.6 1.4 1.2 1.0 0.8 0.6 0.4 0.2 0.0 -0.2 -0.4 -0.6 -0.8 -1.0 -1.2 -1.4 -1.6 -1.8 -2.0 -2.2 RC5V@-45C RC5V@25C RC5V@90C RC5V@130C RC5V@0C 6.0 5.6 5.2 4.8 4.4 4.0 3.6 3.2 2.8 2.4 c u d ) s t( Accuracy (%) Figure 41. Typical accuracy with RCCR=RCCR1 vs VDD= 2.4-6.0V and temperature 3.0 2.8 2.6 2.4 2.2 2.0 1.8 1.6 1.4 1.2 1.0 0.8 0.6 0.4 0.2 0.0 -0.2 -0.4 -0.6 -0.8 -1.0 -1.2 -1.4 e t le RC3.3V@-45C RC3.3V@25C RC3.3V@90C RC3.3V@130C RC3.3V@0C 6.0 5.6 5.2 4.8 4.4 98/136 4.0 s b O o s b O 3.6 t e l o 3.2 r P e 2.8 2.4 u d o ) s ( ct o r P ST7LITEUS2, ST7LITEUS5 12.4 Electrical characteristics Supply current characteristics The following current consumption specified for the ST7 functional operating modes over temperature range does not take into account the clock source current consumption. To get the total device consumption, the two current values must be added (except for Halt mode for which the clock is stopped). Refer to Section 12.4.2: Internal RC oscillator supply current characteristics. TA = -40 to +125 C unless otherwise specified. 12.4.1 Supply current Table 52. Supply current characteristics Symbol Parameter Conditions Supply current in Run mode (1) Supply current in Wait mode(4) Supply current in Slow-Wait mode Supply current in AWUFH mode (5) VDD=5 V Supply current in Wait mode(3) Typ Max fCPU = 4 MHz 2.5 4.5(2) fCPU = 8 MHz 5.0 7.5 fCPU = 4 MHz 0.85 2.0(2) fCPU = 8 MHz 1.2 3.5 fCPU/32 = 250 kHz 600 950 fCPU/32 = 250 kHz IDD Supply current in Halt mode Supply current in Run mode (1) 750 45 100(2) 100 250 0.5 3.0 0.5 5.0 fCPU = 4 MHz 1.30 2.0 (2) fCPU = 4 MHz 0.36 0.5 (2) fCPU/32 = 250 kHz 300 400(2) fCPU/32 = 250 kHz 250 350(2) 20 50 (2) 90 150(2) TA = 85 C 0.25 2.5 (2) TA = 125 C 0.25 4.5 (2) TA = 85 C e t le so TA = 125 C Supply current in Wait mode(3) ct Supply current in Slow-wait mode (5) u d o Supply current in AWUFH mode(6)(7) b O - VDD=3 V (s) Supply current in Slow mode(4) Supply current in Active-halt mode r P e Supply current in Halt mode(8) t e l o o r P mA ) s t( 450 (6)(7) Supply current in Active-halt mode (8) c u d Unit A mA A 1. CPU running with memory access, all I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; clock input (CLKIN) driven by external square wave, LVD disabled. s b O 2. Data based on characterization, not tested in production. 3. All I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; clock input (CLKIN) driven by external square wave, LVD disabled. 4. All I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; clock input (CLKIN) driven by external square wave, LVD disabled. 5. Slow-Wait mode selected with fCPU based on fOSC divided by 32. All I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; clock input (CLKIN) driven by external square wave, LVD disabled. 6. All I/O pins in input mode with a static value at VDD or VSS (no load). Data tested in production at VDD max. and fCPU max. 7. This consumption refers to the Halt period only and not the associated run period which is software dependent. 8. All I/O pins in output mode with a static value at VSS (no load), LVD disabled. Data based on characterization results, tested in production at VDD max and fCPU max. 99/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 12.4.2 Internal RC oscillator supply current characteristics Table 53. Internal RC oscillator supply current Typ Max (1) TA=25 C, int RC = 4 MHz 3.2 5.5 TA=25 C, int RC = 8 MHz 5.7 8.5 TA=25 C, AWU RC 0.13 0.2 TA=25 C, int RC = 4 MHz 1.5 3.0 TA=25 C, int RC = 8 MHz 1.9 4.5 TA=25 C, int RC/32 = 250 kHz 1.3 2.0 TA=25 C, int RC/32 = 250 kHz 1.1 1.8 0.8 1.25 TA=25 C, int RC = 4 MHz 2.0 3.0 TA=25 C, int RC = 2 MHz 1.3 Conditions Supply current in Run mode (2) Supply current in Wait mode (3) IDD Supply current in Slow mode (4) Supply current in Slow-Wait mode (5) Supply current in Active-halt mode Supply current in Run mode (2) Supply current in Wait mode (3) IDD Supply current in Slow mode Supply current in Slow-Wait mode (5) Supply current in Active-halt mode (4) RC oscillator calibrated at 5.0V Parameter RC oscillator calibrated at 3.3 V Symbol Min TA=25 C, AWU RC TA=25 C, int RC = 2 MHz e t le TA=25 C, int RC/32 = 250 kHz so TA=25 C, int RC/32 = 250 kHz ) s ( ct b O - od 0.1 TA=25 C, int RC = 4 MHz Pr uc Unit mA ) s t( 2.0 0.18 1.0 1.6 0.9 1.5 0.95 1.5 0.85 1.4 0.8 1.3 mA 1. Data based on characterization results, not tested in production. 2. CPU running with memory access, all I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; CPU clock provided by the internal RC, LVD disabled. u d o 3. All I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; CPU clock provided by the internal RC, LVD disabled. 4. Slow mode selected with fCPU based on fOSC divided by 32. All I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; CPU clock provided by the internal RC, LVD disabled. r P e 5. Slow-Wait mode selected with fCPU based on fOSC divided by 32. All I/O pins in input mode with a static value at VDD or VSS (no load), all peripherals in reset state; CPU clock provided by the internal RC, LVD disabled. t e l o s b O 100/136 ST7LITEUS2, ST7LITEUS5 Electrical characteristics Figure 42. Typical IDD in run mode vs. internal clock frequency and VDD Idd RUN mode @amb vs int clock freq RC8 MHz RC4 MHz RC2 MHz AWU Idd RUN [mA] 6.00 5.00 4.00 3.00 2.00 1.00 5.6 5.4 5 5.2 4.8 4.6 4.4 4 4.2 3.8 3.6 3.4 3 3.2 2.8 2.6 2.4 0.00 VDD [V] Figure 43. Typical IDD in WFI mode vs. internal clock frequency and VDD Idd WFI mode @amb vs int RC freq 2.200 c u d 8 MHz 2 MHz 1.200 4.4 4 3.6 3.2 2.8 2.4 o s b O VDD [V] ) s ( ct 5.2 e t le 0.700 o r P 5.6 1.700 4.8 Idd RUN [mA] 4 MHz ) s t( Figure 44. Typical IDD in Slow, Slow-wait and Active-halt mode vs VDD & int RC = 8 MHz slowwait acthlt 1.300 1.100 0.900 5.6 5.2 4.8 4.4 4 3.6 3.2 0.700 2.8 O bs Slow 1.500 2.4 t e l o Idd slow, slowwait & acthalt mode, int Rc 8Mhz@amb Idd RUN [mA] o r P e du VDD [V] 101/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 Figure 45. IDD vs temp @VDD 5 V & int RC = 8 MHz 6.0 run wfi slow slowwait Idd [mA] 5.0 4.0 3.0 2.0 acthlt 1.0 130 90 25 -45 0.0 Temp [C] 4.0 3.5 3.0 2.5 2.0 1.5 1.0 0.5 0.0 c u d ro 90 run wfi 30 P e let o s b O 25 45 Idd [mA] Figure 46. IDD vs temp @VDD 5 V & int RC = 4 MHz Figure 47. IDD vs temp @VDD 5 V & int RC = 2 MHz ) s ( ct 3.0 2.5 102/136 1.0 0.5 Temp [C] 130 0.0 90 s b O run wfi 1.5 25 t e l o 2.0 -45 r P e Idd [mA] u d o ) s t( ST7LITEUS2, ST7LITEUS5 Electrical characteristics 12.4.3 On-chip peripherals Table 54. On-chip peripheral characteristics Symbol IDD(AT) IDD(ADC) Parameter Typ (1) Conditions 12-bit auto-reload timer supply current (2) ADC supply current when converting (3) fCPU = 4 MHz VDD= 3.0 V 15 fCPU = 8 MHz VDD= 5.0 V 30 fADC = 2 MHz VDD= 3.0 V 450 fADC = 4 MHz VDD= 5.0 V 750 Unit A 1. Not tested in production, guaranteed by characterization. 2. Data based on a differential IDD measurement between reset configuration (timer stopped) and the timer running in PWM mode at fcpu = 8 MHz. 3. Data based on a differential IDD measurement between reset configuration and continuous A/D conversions with amplifier off. 12.5 Clock and timing characteristics c u d Subject to general operating conditions for VDD, fOSC, and TA. Table 55. General timings Symbol Parameter(1) tc(INST) Instruction cycle time tv(IT) Interrupt reaction time(3) tv(IT) = tc(INST) + 10 Conditions e t le fCPU=8 MHz o s b O fCPU=8 MHz o r P ) s t( Min Typ(2) Max Unit 2 3 12 tCPU 250 375 1500 ns 10 22 tCPU 1.25 2.75 s 1. Data based on characterization. Not tested in production. ) s ( ct 2. Data based on typical application software. 3. Time measured between interrupt event and interrupt vector fetch. tc(INST) is the number of tCPU cycles needed to finish the current instruction execution. Table 56. u d o Auto-wakeup RC oscillator r P e Min Typ Max Unit Supply Voltage Range 2.4 5.0 5.5 V Operating Temperature Range -40 25 125 C 2.0 8.0 14.0 A s b O t e l o Parameter Current Consumption(1) Consumption (1) Conditions Without prescaler AWU RC switched off (1) Output Frequency 0 20 33 A 60 kHz 1. Data guaranteed by design. 103/136 Electrical characteristics 12.6 ST7LITEUS2, ST7LITEUS5 Memory characteristics TA = -40 to 125 C, unless otherwise specified; Table 57. RAM and Hardware registers Symbol VRM Parameter Conditions Data retention mode 1) Halt mode (or Reset) Table 58. Flash Program memory Symbol Parameter VDD tprog tRET NRW Min Conditions Programming time for 1~32 bytes(2) TA=-40 to +125C Programming time for 1 kByte TA=+25C TA=+55C(4) retention(3) TA=+25C Write erase cycles Supply current(6) Min Typ Max Unit 5.5 V 5 10 ms 0.16 0.32 s 20 e t le Power down mode / Halt o s b O - ) s t( years 10k(5) No Read/No Write Mode c u d 2.6 o r P 0 ) s ( ct 3. Data based on reliability test results and monitored in production. 4. The data retention time increases when the TA decreases. 5. Design target value pending full product characterization. u d o 6. Guaranteed by Design. Not tested in production. r P e t e l o s b O 104/136 cycles mA 100 A 0.1 A 1. Minimum VDD supply voltage without losing data stored in RAM (in Halt mode or under reset) or in hardware registers (only in Halt mode). Guaranteed by construction, not tested in production. 2. Up to 32 bytes can be programmed at a time. Unit V 2.4(1) Read / Write / Erase modes, fCPU = 8 MHz, VDD = 5.5 V IDD Max 1.6 Operating voltage for Flash write/erase Data Typ ST7LITEUS2, ST7LITEUS5 12.7 Electrical characteristics EMC characteristics Susceptibility tests are performed on a sample basis during product characterization. 12.7.1 Functional EMS (electromagnetic susceptibility) Based on a simple running application on the product (toggling 2 LEDs through I/O ports), the product is stressed by two electromagnetic events until a failure occurs (indicated by the LEDs). ESD: Electrostatic 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. FTB: A Burst of Fast Transient voltage (positive and negative) is applied to VDD and VSS through a 100 pF capacitor, until a functional disturbance occurs. This test conforms with the IEC 1000-4-4 standard. A device reset allows normal operations to be resumed. The test results are given in the table below based on the EMS levels and classes defined in application note AN1709. Designing hardened software to avoid noise problems c u d ) s t( EMC characterization and optimization are performed at component level with a typical application environment and simplified MCU software. It should be noted that good EMC performance is highly dependent on the user application and the software in particular. o r P Therefore it is recommended that the user applies EMC software optimization and prequalification tests in relation with the EMC level requested for his application. Software recommendations e t le o s b O - The software flowchart must include the management of runaway conditions such as: Corrupted program counter Unexpected reset Critical Data corruption (control registers...) ) s ( ct Pre-qualification trials u d o Most of the common failures (unexpected reset and program counter corruption) can be reproduced by manually forcing a low state on the RESET pin or the Oscillator pins for 1 second. r P e To complete these trials, ESD stress can be applied directly on the device, over the range of specification values. When unexpected behavior is detected, the software can be hardened to prevent unrecoverable errors occurring (see application note AN1015). t e l o O bs Table 59. Symbol EMC characteristics Parameter Conditions Level/ class VFESD VDD=5 V, TA=+25 C, fOSC=8 MHz, Voltage limits to be applied on any I/O pin to SO8 package, induce a functional disturbance conforms to IEC 1000-4-2 3B VFFTB Fast transient voltage burst limits to be applied through 100 pF on VDD and VDD pins to induce a functional disturbance VDD=5 V, TA=+25 C, fOSC=8 MHz, SO8 package, conforms to IEC 1000-4-4 4B 105/136 Electrical characteristics 12.7.2 ST7LITEUS2, ST7LITEUS5 Electromagnetic Interference (EMI) Based on a simple application running on the product (toggling 2 LEDs through the I/O ports), the product is monitored in terms of emission. This emission test is in line with the norm SAE J 1752/3 which specifies the board and the loading of each pin. EMI characteristics(1) Table 60. Symbol Parameter Monitored frequency band Conditions Max vs. [fOSC/fCPU] Unit -/8 MHz SEMI Peak level VDD=5 V, TA=+25 C, SO8 package, conforming to SAE J 1752/3 0.1 MHz to 30 MHz 21 30 MHz to 130 MHz 23 130 MHz to 1 GHz 10 SAE EMI Level 3 c u d 1. Data based on characterization results, not tested in production. 12.7.3 dBV ) s t( - o r P Absolute maximum ratings (electrical sensitivity) 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, refer to the application note AN1181. Electrostatic discharge (ESD) e t le o s b O - Electrostatic discharges (a positive then a negative pulse separated by 1 second) are applied to the pins of each sample according to each pin combination. The sample size depends on the number of supply pins in the device (3 parts*(n+1) supply pin). One model can be simulated: Human Body Model. This test conforms to the JESD22-A114A/A115A standard. Table 61. ) s ( ct u d o Absolute maximum ratings r P e Symbol t e l o VESD(HBM) s b O 106/136 Ratings Electrostatic discharge voltage (human body model) Conditions TA=+25C Maximum value(1) Unit > 4000 V 1. Data based on characterization results, not tested in production. Static and dynamic latchup LU: 3 complementary static tests are required on 10 parts to assess the latchup performance. A supply overvoltage (applied to each power supply pin) and a current injection (applied to each input, output and configurable I/O pin) are performed on each sample. This test conforms to the EIA/JESD 78 IC latchup standard. For more details, refer to the application note AN1181. DLU: Electrostatic discharges (one positive then one negative test) are applied to each pin of 3 samples when the micro is running to assess the latchup performance in ST7LITEUS2, ST7LITEUS5 Electrical characteristics 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. For more details, refer to the application note AN1181. Table 62. Electrical sensitivities Symbol LU DLU Parameter Class(1) Conditions Static latchup class TA=+125 C A Dynamic latchup class VDD=5.5 V, fOSC=4 MHz, TA=+25 C A 1. Class description: A Class is an STMicroelectronics internal specification. All its limits are higher than the JEDEC specifications, that means when a device belongs to Class A it exceeds the JEDEC standard. B Class strictly covers all the JEDEC criteria (international standard). c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 107/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 12.8 I/O port pin characteristics 12.8.1 General characteristics Subject to general operating conditions for VDD, fOSC, and TA unless otherwise specified. Table 63. General characteristics Symbol Parameter Conditions VIL Input low level voltage VIH Input high level voltage Vhys Schmitt trigger voltage hysteresis(1) IL Input leakage current VSSVINVDD IS Static current consumption induced by each floating input pin(2) Floating input mode RPU CIO Min Typ -40C to 125C S 400 VDD=5 V 80 120 200(1) VDD=3 V External interrupt pulse time(5) P e let uc k pF 25 CL=50 pF Between 10% and 90% o s b O - ) s t( 170 d o r 5 tw(IT)in mV 1 I/O pin capacitance Output low to high level rise time 1) V A (4) tr(IO)out 0.3VDD 400 VIN=VS Output high to low level fall time 1) Unit 0.7VDD Weak pull-up equivalent resistor(3) tf(IO)out Max ns 25 1 tCPU 1. Data based on characterization results, not tested in production. ) s ( ct 2. Configuration not recommended, all unused pins must be kept at a fixed voltage: using the output mode of the I/O for example or an external pull-up or pull-down resistor (see Figure 48). Static peak current value taken at a fixed VIN value, based on design simulation and technology characteristics, not tested in production. This value depends on VDD and temperature values. u d o 3. The RPU pull-up equivalent resistor is based on a resistive transistor (corresponding IPU current characteristics described in Figure 49). r P e 4. RPU not applicable on PA3 because it is multiplexed on RESET pin 5. 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. t e l o Figure 48. Two typical applications with unused I/O pin s b O VDD ST7XXX 10k 10k UNUSED I/O PORT UNUSED I/O PORT ST7XXX 1. Caution: During normal operation the ICCCLK pin must be pulled- up, internally or externally (external pullup of 10k mandatory in noisy environment). This is to avoid entering I2C mode unexpectedly during a reset. 2. I/O can be left unconnected if it is configured as output (0 or 1) by the software. This has the advantage of greater EMC robustness and lower cost. 108/136 ST7LITEUS2, ST7LITEUS5 Electrical characteristics Figure 49. Typical IPU vs. VDD with VIN=VSSl 90 80 -45C 25C 90C 70 IPU [uA] 60 50 40 30 20 10 0 VDD [V] 12.8.2 Output driving current characteristics ) s t( Subject to general operating conditions for VDD, fCPU, and TA unless otherwise specified. Table 64. Output driving current characteristics Symbol Parameter Output low level voltage for a high sink I/O pin when 4 pins are sunk at same time (see Figure 55) VDD=5 V VOL (1) VOH (2) b O - VOH (2)(3) o r P e 1200 IIO = +2 mA,TA 125 C 400 IIO=+20 mA,TA 125 C 1300 IIO = +8 mA,TA 125 C 750 IIO= -5 mA,TA 125 C VDD-1500 IIO = -2 mA,TA 125 C VDD-800 IIO = +2 mA,TA 125 C 500 IIO = +2 mA,TA 125 C 180 IIO = +8 mA,TA 125 C 600 IIO = -2 mA,TA 125 C Output low level voltage for PA3/RESET standard I/O pin (see Figure 53) IIO = +2 mA,TA 125 C 700 IIO = +2 mA,TA 125 C 200 IIO=+8 mA,TA 125 C 800 t e l o Output low level voltage for a high sink I/O pin when 4 pins are sunk at same time (see Figure 53) VOH (2)(3) Output high level voltage for an I/O pin when 4 pins are sourced at same time (see Figure 56) O Max Output high level voltage for an I/O pin when 4 pins are sourced at same time (see Figure 57) bs VOL 1. du Output low level voltage for a high sink I/O pin when 4 pins are sunk at same time (see Figure 54) (1)(3) VDD=2.4 V VOL VDD=3 V Output low level voltage for PA3/RESET standard I/O pin (see Figure 51) (1)(3) P e let Min IIO= +5 mA,TA 125 C so Output high level voltage for an I/O pin when 4 pins are sourced at same time (see Figure 58) ) s ( ct ro Conditions Output low level voltage for PA3/RESET standard I/O pin (see Figure 52) c u d IIO=-2 mA,TA 125 C Unit mV VDD-800 VDD-900 The IIO current sunk must always respect the absolute maximum rating specified in Table 52 and the sum of IIO (I/O ports and control pins) must not exceed IVSS. 2. The IIO current sourced must always respect the absolute maximum rating specified in Table 52 and the sum of IIO (I/O ports and control pins) must not exceed IVDD. True open drain I/O pins do not have VOH. 3. Not tested in production, based on characterization results. 109/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 Figure 50. Typical VOL at VDD = 2.4 V (standard pins) 1400 -45C 1200 25C 1000 VOL [mV] 90C 800 130C 600 400 200 0 0 2 Iol [mA] 4 Figure 51. Typical VOL at VDD = 3 V (standard pins) 1400 1200 VOL [mV] c u d -45C 25C 90C 130C 1000 e t le 800 600 400 200 0 ) s ( ct 0 o s b O 2 4 6 o r P 8 Iol [mA] u d o Figure 52. Typical VOL at VDD = 5 V (standard pins) r P e s b O 25C 1200 90C 1000 VOL [mV] t e l o -45C 130C 800 600 400 200 0 0 2 4 Iol [mA] 110/136 6 8 ) s t( ST7LITEUS2, ST7LITEUS5 Electrical characteristics Figure 53. Typical VOL at VDD = 2.4 V (HS pins) 1200 -45C 25C 90C 130C 1000 VOL [mV] 800 600 400 200 0 0 2 4 6 8 Iol [mA] 10 12 14 16 Figure 54. Typical VOL at VDD = 3 V (HS pins) c u d 1400 -45C 1200 25C VOL [mV] 1000 e t le 90C 800 130C o s b O - 600 400 200 0 (s) 0 2 4 6 8 t c u 10 Iol [mA] 12 14 ) s t( o r P 16 18 20 Figure 55. Typical VOL at VDD = 5 V (HS pins) d o r P e 800 O bs -45C 25C 90C 130C 600 500 VOL [mV] t e l o 700 400 300 200 100 0 0 2 4 6 8 10 Iol [mA] 12 14 16 18 20 111/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 Figure 56. Typical VDD-VOH at VDD = 2.4 V (HS pins) 1800 -45C 25C 90C 130C 1600 VDD-VOH [mV] 1400 1200 1000 800 600 400 200 0 0 2 4 6 Iol [mA] 8 10 12 Figure 57. Typical VDD-VOH at VDD = 3 V (HS pins) c u d 1800 -45C 25C 90C 130C 1600 VDD-VOH [mV] 1400 1200 1000 800 600 400 ) s ( ct 200 0 0 2 e t le o r P o s b O 4 6 8 10 Iol [mA] u d o 12 14 16 18 18 20 Figure 58. Typical VDD-VOH at VDD = 5 V (HS pins) r P e bs O 1000 -45C 25C 90C 130C 900 800 700 VDD-VOH [mV] t e l o 600 500 400 300 200 100 0 0 112/136 2 4 6 8 10 Iol [mA] 12 14 16 ) s t( ST7LITEUS2, ST7LITEUS5 Electrical characteristics Figure 59. Typical VOL vs. VDD (HS pins) 500 90 -45C 25C 80 90C 130C 70 450 VOL [mV] vs VDD at ILOAD=8mA VOL [mV] vs VDD at ILOAD=2mA 100 60 50 -45C 400 25C 90C 350 130C 300 250 200 150 100 40 2.4 2.6 2.8 3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8 Vdd [V] 5 5.2 5.4 5.6 5.8 2.4 6 2.6 2.8 3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 Vdd [V] 4.8 5 5.2 5.4 5.6 5.8 6 VOL [mV] vs VDD at ILOAD=12mA 900 800 -45C 700 25C 90C 130C 600 500 400 300 c u d 200 2.4 2.6 2.8 3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8 Vdd [V] 5 5.2 5.4 5.6 5.8 Figure 60. Typical VDD-VOH vs. VDD (HS pins) e t le 700 180 -45C 160 25C 140 130C 100 80 60 (s) 40 2.4 2.6 2.8 3 3.2 3.4 3.6 3.8 4 4.2 4.4 4.6 4.8 Vdd [V] 5 b O - 5.2 5.4 5.6 5.8 600 6 500 400 -45C 25C 90C 130C 300 200 100 2.4 2.6 2.8 3 3.2 3.4 t c u 12.9 o r P so 90C 120 VDD-VOH [mV] vs VDD @ ILOAD=6 mA VDD-VOH [mV] vs VDD @ ILOAD=2 mA 200 6 ) s t( 3.6 3.8 4 4.2 4.4 4.6 4.8 Vdd [V] 5 5.2 5.4 5.6 5.8 6 d o r P e Control pin characteristics The reset network protects the device against parasitic resets. s b O t e l o The output of the external reset circuit must have an open-drain output to drive the ST7 reset pad. Otherwise the device can be damaged when the ST7 generates an internal reset (LVD or watchdog). Whatever the reset source is (internal or external), the user must ensure that the level on the RESET pin can go below the VIL max. level specified in Table 65. Otherwise the reset will not be taken into account internally. Because the reset circuit is designed to allow the internal reset to be output in the RESET pin, the user must ensure that the current sunk on the RESET pin is less than the absolute maximum value specified for IINJ(RESET) in Table 44. Refer to Figure 61 and Figure 62 for a description of the RESET pin protection circuit with LVD enabled and disabled. 113/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 Refer also to Section 11.2.1: Illegal opcode reset for more details on illegal opcode reset conditions. Table 65. Asynchronous RESET pin characteristics (1) Symbol VIL Parameter Conditions Input low level voltage Min Typ Max VSS 0.3 0.3VDD 0.7VDD VDD + 0.3 Unit V VIH Input high level voltage Vhys Schmitt trigger voltage hysteresis(2) VOL Output low level voltage(3) VDD=5 V IIO=+2 mA RON Pull-up equivalent resistor(4) VIN=VSS 2 tw(RSTL)out Generated reset pulse duration th(RSTL)in External reset pulse hold tg(RSTL)in Filtered glitch duration V VDD=5 V 400 30 50 70 k 90(2) VDD=3 V s 90(2) Internal reset sources time(5) ) s t( s 20 uc 200 ns d o r 1. TA = -40C to 125C, unless otherwise specified. 2. Data based on characterization results, not tested in production. mV P e let 3. The IIO current sunk must always respect the absolute maximum rating specified in Table 44 and the sum of IIO (I/O ports and control pins) must not exceed IVSS. 4. The RON pull-up equivalent resistor is based on a resistive transistor. Specified for voltages on RESET pin between VILmax and VDD. o s b O - 5. To guarantee the reset of the device, a minimum pulse has to be applied to the RESET pin. All short pulses applied on RESET pin with a duration below th(RSTL)in can be ignored. Figure 61. RESET pin protection when LVD is enabled t c u Required d o r P e EXTERNAL RESET 0.01F t e l o bs O (s) Optional (note 3) 1M VDD ST7XXX RON INTERNAL RESET Filter PULSE GENERATOR WATCHDOG ILLEGAL OPCODE 5) LVD RESET 1. When the LVD is enabled, it is recommended not to connect a pull-up resistor or capacitor. A 10nF pulldown capacitor is required to filter noise on the reset line. 2. When using the LVD: - Check that all recommendations related to ICCCLK and reset circuit have been applied (see caution in Table 2 and text above) - Check that the power supply is properly decoupled (100nF + 10F close to the MCU). Refer to AN1709 and AN2017. If this cannot be done, it is recommended to put a 100nF + 1M pull-down on the RESET pin. - The capacitors connected on the RESET pin and also the power supply are key to avoid any startup marginality. In most cases, steps 1 and 2 above are sufficient for a robust solution. Otherwise: replace 10nF pull-down on the RESET pin with a 5F to 20F capacitor." 3. In case a capacitive power supply is used, it is recommended to connect a 1M pull-down resistor to the RESET pin to discharge any residual voltage induced by the capacitive effect of the power supply (this will add 5A to the power consumption of the MCU). 114/136 ST7LITEUS2, ST7LITEUS5 Electrical characteristics Figure 62. RESET pin protection when LVD is disabled VDD ST7XXX RON USER EXTERNAL RESET CIRCUIT INTERNAL RESET Filter 0.01F Required 12.10 WATCHDOG PULSE GENERATOR ILLEGAL OPCODE 5) ADC characteristics ) s t( Subject to general operating condition for VDD, fOSC, and TA unless otherwise specified. Table 66. Symbol fADC VAIN 10-bit ADC characteristics Parameter Conditions ADC clock frequency(2) Conversion voltage range(3) VDD = 3.3 V, fADC=4 MHz CADC External input resistor (s) t c u e t le t e l o tADC s b O - Sample capacitor loading time - Hold conversion time Max Unit 4 MHz VDDA V 8(4) 7(4) b O - 2.7 V VDD 5.5 V, fADC=2 MHz 10(4) 2.4 V VDD 2.7 V, fADC=1 MHz TBD(4) 3 Stabilization time after ADC enable Conversion time (Sample+Hold) o r P so Internal sample and hold capacitor d o r P e tSTAB c u d Typ(1) VSSA VDD = 5 V, fADC=4 MHz RAIN Min k pF 0(5) s fCPU=8 MHz, fADC=4 MHz 3.5 4 10 1/fADC 1. Unless otherwise specified, typical data are based on TA=25C and VDD-VSS=5 V. They are given only as design guidelines and are not tested. 2. The maximum ADC clock frequency allowed within VDD = 2.4 to 2.7 V operating range is 1 MHz. 3. When VDDA and VSSA pins are not available on the pinout, the ADC refers to VDD and VSS. 4. 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. 5. The stabilization time of the A/D converter is masked by the first tLOAD. The first conversion after the enable is then always valid. 115/136 Electrical characteristics ST7LITEUS2, ST7LITEUS5 Figure 63. Typical application with ADC VDD VT 0.6V RAIN AINx 10-Bit A/D Conversion VAIN VT 0.6V IL 1A CADC ST7LITEUSx Table 67. ADC accuracy with VDD = 3.3 to 5.5 V Symbol Parameter (1) |ET| Total unadjusted error |EO| Offset error Conditions fCPU=8 MHz, fADC=4 MHz(1) Typ Max 2.1 5.0 0.2 2.5 0.3 1.5 |EG| Gain Error |ED| Differential linearity error 1.9 |EL| Integral linearity error 1.9 1. Data based on characterization results over the whole temperature range. Table 68. ADC accuracy with VDD = 2.7 to 3.3 V Symbol Parameter (1) |ET| Total unadjusted error |EO| Offset error |EG| Gain Error |ED| Differential linearity error |EL| Integral linearity error ) s ( ct e t le Conditions o s b O - fCPU=4 MHz, fADC=2 MHz(1) u d o o r P c u d 3.5 Unit ) s t( LSB 4.5 Typ Max 2.0 3.0 0.1 1.5 0.4 1.4 1.8 2.5 1.7 2.5 Typ Max 2.2 3.5 0.5 1.5 0.5 1.5 Unit LSB 1. Data based on characterization results over the whole temperature range. r P e Table 69. ADC accuracy with VDD = 2.4V to 2.7V Symbol t e l o bs O (1) Parameter |ET| Total unadjusted error |EO| Offset error Conditions fCPU=2 MHz, fADC=1 MHz(1) |EG| Gain Error |ED| Differential linearity error 1.8 2.5 |EL| Integral linearity error 1.8 2.5 1. Data based on characterization results at a temperature 25C. 116/136 Unit LSB ST7LITEUS2, ST7LITEUS5 Electrical characteristics Figure 64. ADC accuracy characteristics Digital Result ADCDR EG 1023 1022 1LSB 1021 IDEAL V -V DD SS = -------------------------------- 1024 (2) ET 7 (3) (1) 6 5 EO 4 EL 3 ED 2 1 LSBIDEAL 1 Vin (LSBIDEAL) 0 1 VSS 2 3 4 5 6 7 1021 1022 1023 1024 VDD 1. Example of an actual transfer curve 2. The ideal transfer curve 3. End point correlation line c u d ) s t( 4. ET=Total Unadjusted Error: maximum deviation between the actual and the ideal transfer curves. 5. EO=Offset Error: deviation between the first actual transition and the first ideal one. o r P 6. EG=Gain Error: deviation between the last ideal transition and the last actual one. 7. ED=Differential Linearity Error: maximum deviation between actual steps and the ideal one. 8. EL=Integral Linearity Error: maximum deviation between any actual transition and the end point correlation line. e t le ) s ( ct o s b O - u d o r P e t e l o s b O 117/136 Package characteristics 13 ST7LITEUS2, ST7LITEUS5 Package characteristics In order to meet environmental requirements, ST offers these devices in different grades of ECOPACK(R) packages, depending on their level of environmental compliance. ECOPACK(R) specifications, grade definitions and product status are available at: www.st.com. ECOPACK(R) is an ST trademark. 13.1 Package mechanical data Figure 65. 8-lead very thin fine pitch dual flat no-lead package outline D INDEX AREA (D/2 x E/2) e E b c u d E2 TOP VIEW A3 INDEX AREA (D/2 x E/2) A o r P D2 Table 70. BOTTOM VIEW A1 SIDE VIEW e t le Dim. Min Typ A 0.80 0.90 A1 0.00 ct o r P e D2 t e l o bs O du 0.25 3.50 E E2 1.96 e L (s) 0.02 A3 D so b O Max Typ Max 1.00 0.0310 0.0350 0.0390 0.05 0.0000 0.0010 0.0020 0.20 0.30 0.0080 0.35 0.0100 4.50 3.65 3.75 0.1380 0.40 2.21 0.0770 0.1440 0.1480 0.0830 0.0870 0.0310 0.50 0.0120 8 1. Values in inches are converted from mm and rounded to 4 decimal digits. 118/136 0.0140 0.1380 0.80 0.30 0.0120 0.1770 3.50 2.11 inches(1) Min Number of pins N L 8-lead very thin fine pitch dual flat no-lead package mechanical data mm b ) s t( 0.0160 0.0200 ST7LITEUS2, ST7LITEUS5 Package characteristics Figure 66. 8-pin plastic small outline package, 150-mil width package outline D h x 45 A2 A A1 C B E L H e Table 71. c u d inches(1) mm Dim. Min 1.75 A1 0.10 0.25 A2 1.10 B 0.33 C 0.19 D 4.80 e o r P e O bs Max 1.35 E t e l o Typ A H ) s t( 8-pin plastic small outline package, 150-mil width, package mechanical data c u d 3.80 e t le 0.0530 o r P Typ Max 0.0690 0.0040 0.0100 0.0430 0.0650 0.51 0.0130 0.0200 0.25 0.0070 0.0100 5.00 0.1890 0.1970 4.00 0.1500 0.1580 o s b O 1.65 (t s) Min 1.27 0.0500 5.80 6.20 0.2280 0.2440 h 0.25 0.50 0.0100 0.0200 0d 8d L 0.40 1.27 0.0160 0.0500 Number of pins N 8 1. Values in inches are converted from mm and rounded to 4 decimal digits. 119/136 Package characteristics ST7LITEUS2, ST7LITEUS5 Figure 67. 8-pin plastic dual in-line package, 300-mil width package outline E A2 A A1 L b2 c b3 b eB e D1 D D 8 5 1 4 E1 Table 72. Min Typ A 0.38 A2 2.92 3.30 b 0.36 0.46 b2 1.14 1.52 b3 0.76 c 0.20 D 9.02 r P e s b O Min 0.13 e t le 0.0150 ) s ( ct u d o D1 t e l o Max 5.33 A1 0.99 0.25 9.27 so 4.95 Typ Max 0.2100 0.1300 0.1950 0.56 0.0140 0.0180 0.0220 1.78 0.0450 0.0600 0.0700 1.14 0.0300 0.0390 0.0450 0.36 0.0080 0.0100 0.0140 10.16 0.3550 0.3650 0.4000 b O - 0.0050 0.1000 10.92 0.4300 E 7.62 7.87 8.26 0.3000 0.3100 0.3250 E1 6.10 6.35 7.11 0.2400 0.2500 0.2800 L 2.92 3.30 3.81 0.1150 0.1300 0.1500 Number of pins N 8 1. Values in inches are converted from mm and rounded to 4 decimal digits. 120/136 o r P 0.1150 2.54 eB c u d inches(1) mm Dim. e ) s t( 8-pin plastic dual in-line package, 300-mil width package mechanical data ST7LITEUS2, ST7LITEUS5 Package characteristics Figure 68. 16-pin plastic dual in-line package, 300-mil width, package outline E b2 A2 A1 e e1 A L c b eA eB D 8 E1 1 Table 73. 17_ME c u d inches(1) mm Dim. Min Typ A 0.38 A2 2.92 3.30 b 0.36 0.46 b2 1.14 1.52 c 0.20 D E o r P e t e l o O bs Max Min e t le 5.33 A1 E1 c u d 18.67 7.62 6.10 o s b O - Typ 0.2100 0.0150 0.1300 0.1950 0.56 0.0140 0.0180 0.0220 1.78 0.0450 0.0600 0.0700 0.36 0.0080 0.0100 0.0140 19.18 19.69 0.7350 0.7550 0.7750 7.87 8.26 0.3000 0.3100 0.3250 6.35 7.11 0.2400 0.2500 0.2800 0.25 2.54 0.1000 e1 17.78 0.7 eA 7.62 eB 0.3000 10.92 2.92 Max 0.1150 (t s) 4.95 o r P e L ) s t( 16-pin plastic dual in-line package, 300-mil width, package mechanical data 3.30 0.4300 3.81 0.1150 0.1300 0.1500 Number of pins N 16 1. Values in inches are converted from mm and rounded to 4 decimal digits. 121/136 Package characteristics 13.2 ST7LITEUS2, ST7LITEUS5 Thermal characteristics Table 74. Thermal characteristics Symbol Ratings Value RthJA Package thermal resistance (junction to ambient) Plastic DIP8 82 SO8 130 DFN8 (on 4-layer PCB) DFN8 (on 2-layer PCB) 50 106 C/W Maximum junction temperature(1) TJmax Power dissipation(2) PDmax Unit 150 Plastic DIP8 300 SO8 180 DFN8 (on 4-layer PCB) 500 DFN8 (on 2-layer PCB) 250 o r P c u d 1. The maximum chip-junction temperature is based on technology characteristics. C ) s t( mW 2. The maximum power dissipation is obtained from the formula PD = (TJ -TA) / RthJA. The power dissipation of an application can be defined by the user with the formula: PD=PINT+PPORT where PINT is the chip internal power (IDD x VDD) and PPORT is the port power dissipation depending on the ports used in the application. e t le ) s ( ct u d o r P e t e l o s b O 122/136 o s b O - ST7LITEUS2, ST7LITEUS5 14 Device configuration and ordering information Device configuration and ordering information Each device is available for production in user programmable versions (FLASH) as well as in factory coded versions (FASTROM). Refer to Table 79 for the full list of supported part numbers: ST7FLITEUSA2xx and ST7FLITEUSA5xx XFlash devices are shipped to customers with a default program memory content (FFh). Factory Advanced Service Technique ROM (FASTROM) versions are also available: they are factory-programmed XFlash devices. The FASTROM factory coded parts contain the code supplied by the customer. This implies that FLASH devices have to be configured by the customer using the Option Bytes while the FASTROM devices are factory-configured. 14.1 Option bytes ) s t( The two option bytes allow the hardware configuration of the microcontroller to be selected. c u d The option bytes can be accessed only in programming mode (for example using a standard ST7 programming tool). 14.1.1 OPTION BYTE 1 e t le o r P Bit 7:6 CKSEL[1:0] Startup clock selection. This bit is used to select the startup frequency. By default, the internal RC is selected (see Table 75: Startup clock selection). o s b O - Bit 5 Reserved, must always be 1. Bit 4 Reserved, must always be 0. ) s ( ct Bits 3:2 LVD[1:0] Low Voltage Detection selection These option bits enable the LVD block with a selected threshold as shown in Table 76: LVD threshold configuration. u d o Bit 1 WDG SW Hardware or software watchdog This option bit selects the watchdog type. 0: Hardware (watchdog always enabled) 1: Software (watchdog to be enabled by software) r P e s b O t e l o Bit 0 WDG HALT Watchdog Reset on Halt This option bit determines if a reset is generated when entering Halt mode while the watchdog is active. 0: No Reset generation when entering Halt mode 1: Reset generation when entering Halt mode 123/136 Device configuration and ordering information Table 75. ST7LITEUS2, ST7LITEUS5 Startup clock selection Configuration CKSEL1 CKSEL0 Internal RC as Startup Clock 0 0 Reserved 0 0 AWU RC as a Startup Clock 0 1 Reserved 1 0 External Clock on pin PA5 1 1 Table 76. LVD threshold configuration Configuration 14.1.2 LVD1 LVD0 LVD Off 1 1 Highest voltage threshold 1 0 Medium voltage threshold 0 1 Lowest voltage threshold 0 c u d OPTION BYTE 0 Bits 7:4 Reserved, must always be 1. Bit 3 Reserved, must always be 0. e t le ) s t( 0 o r P Bit 2 SEC0 Sector 0 size definition This option bit indicates the size of sector 0 according to the following table (see Table 77: Definition of sector 0 size). o s b O - Bit 1 FMP_R Readout protection Readout protection, when selected provides a protection against program memory content extraction and against write access to Flash memory. Erasing the option bytes when the FMP_R option is selected will cause the whole memory to be erased first, and the device can be reprogrammed. Refer to Section 4.5 and the ST7 Flash Programming Reference Manual for more details. 0: Readout protection off 1: Readout protection on ) s ( ct u d o r P e t e l o s b O 124/136 Table 77. Bit 0 FMP_W FLASH write protection This option indicates if the FLASH program memory is write protected. Warning: When this option is selected, the program memory (and the option bit itself) can never be erased or programmed again. 0: Write protection off 1: Write protection on Definition of sector 0 size Sector 0 Size SEC0 0.5k 0 1k 1 ST7LITEUS2, ST7LITEUS5 Device configuration and ordering information Table 78: OPTION BYTE 0 OPTION BYTE 1 7 0 Reserved Default value 1 14.2 1 1 SEC0 FMPR FMPW 1 0 0 0 0 7 0 CKSEL CKSEL 1 0 0 0 Res Res 1 0 LVD1 LVD0 1 WDG WDG SW HALT 1 1 1 Ordering information Customer code is made up of the FASTROM contents and the list of the selected options (if any). The FASTROM contents are to be sent on diskette, or by electronic means, with the S19 hexadecimal file generated by the development tool. All unused bytes must be set to FFh. The selected options are communicated to STMicroelectronics using the correctly completed option list appended. ) s t( Refer to application note AN1635 for information on the counter listing returned by ST after code has been transferred. c u d The STMicroelectronics Sales Organization will be pleased to provide detailed information on contractual points. Table 79. Supported order codes (1) Order code Program memory (bytes) RAM (bytes) ST7FLITEUSA2B6 ST7FLITEUSA2M6 ST7FLITEUSA2M6TR - 128 (s) ct ST7FLITEUSA5B6 ST7FLITEUSA5M6 du 1 Kbyte FLASH o r P e 128 e t le Temperature range so Package Conditioning DIP8 Tube SO8 Tube b O - SO8 Tape & Reel - DFN8 Tape & Reel 10-bit DIP8 Tube 10-bit SO8 Tube SO8 Tape & Reel - 1 Kbyte FLASH ST7FLITEUSA2U6TR ST7FLITEUSA5M6TR ADC o r P -40C +85C 10-bit -40C +85C ST7FLITEUSA5U6 10-bit DFN8 Tray t e l o 10-bit DFN8 Tape & Reel DIP16(2) Tube DIP8 Tube SO8 Tube - SO8 Tape & Reel - DFN8 Tape & Reel ST7FLITEUSA5U6TR ST7FLITEUSICD s b O 1 Kbyte FLASH 128 ST7PLUSA2B6 ST7PLUSA2M6 ST7PLUSA2M6TR ST7PLUSA2U6TR - -40C +125C 1 Kbyte FASTROM 128 -40C +85C 125/136 Device configuration and ordering information Table 79. ST7LITEUS2, ST7LITEUS5 Supported order codes (1) (continued) Order code Program memory (bytes) RAM (bytes) ST7PLUSA5B6 ST7PLUSA5M6 ST7PLUSA5M6TR 1 Kbyte FASTROM 128 ADC Temperature range Package Conditioning 10-bit DIP8 Tube 10-bit SO8 Tube SO8 Tape & Reel 10-bit -40C +85C ST7PLUSA5U6 10-bit DFN8 Tray ST7PLUSA5U6TR 10-bit DFN8 Tape & Reel ST7PLUSA2B3 - DIP8 Tube SO8 Tube - SO8 Tape & Reel ST7PLUSA2U3TR - DFN8 Tape & Reel ST7PLUSA5B3 10-bit DIP8 Tube ST7PLUSA5M3 10-bit SO8 Tube ST7PLUSA2M3 ST7PLUSA2M3TR ST7PLUSA5M3TR - 1 Kbyte FLASH 1 Kbyte FLASH 128 128 -40C +125C 10-bit -40C +125C o r P ST7PLUSA5U3 10-bit DFN8 ST7PLUSA5U3TR 10-bit DFN8 ST7PLUSA2B3 - ST7PLUSA2M3 ST7PLUSA2M3TR (s) ST7PLUSA5M3TR ST7PLUSA5U3 o r P e ST7PLUSA5U3TR du ct 128 SO8 Tube SO8 Tape & Reel DFN8 Tape & Reel 10-bit DIP8 Tube 10-bit SO8 Tube SO8 Tape & Reel 10-bit DFN8 Tray 10-bit DFN8 Tape & Reel so b O - 10-bit -40C +125C 1. Contact ST sales office for product availability. 2. For development or tool prototyping purposes only, not orderable in production quantities. t e l o s b O 126/136 Tape & Reel -40C +125C - ST7PLUSA5M3 Tray Tube - ST7PLUSA5B3 Tape & Reel DIP8 128 ST7PLUSA2U3TR 1 Kbyte FASTROM e t le - 1 Kbyte FASTROM c u d SO8 ) s t( ST7LITEUS2, ST7LITEUS5 Device configuration and ordering information Figure 69. Option list ST7LITEUS FASTROM MICROCONTROLLER OPTION LIST (Last update: February 2009) Customer: . . . . . . . . . . . . Address: . . . . . . . . . . . . . . . . . . . . . . . . Contact: . . . . . . . . . . . . Phone No: . . . . . . . . . . . . Reference/FASTROM Code*:. . . . . *FASTROM code name is assigned by FASTROM code must be sent in .S19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . STMicroelectronics. format. .Hex extension cannot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . be processed. Device Type/Memory Size/Package (check only one option): ------------------|-----------------------| FASTROM DEVICE: | 1K FASTROM | ------------------|-----------------------| PDIP8 | [ ] | SO8 | [ ] | DFN8 | [ ] | c u d ) s t( Conditioning (check only one option): --------------------------------------------------------------------------DIP package: [ ] Tube SO package: [ ] Tape & Reel [ ] Tube DFN package: [ ] Tape & Reel [ ] Tray (for ST7PLUSA5U6xxx and ST7PLUSA5U3xxx only) o r P e t le Special Marking: [ ] No [ ] Yes "_ _ _ _ _ _ _ _" Authorized characters are letters, digits, '.', '-', '/' and spaces only. Maximum character count: PDIP8/SO8/DFN8 (8 char. max) : _ _ _ _ _ _ _ _ Temperature range o s b O - [ ] -40C to +85C [ ] -40C to +125C Clock Source Selection: [ ] External Clock [ ] AWU RC oscillator [ ] Internal RC oscillator (s) Sector 0 size: Readout protection: FLASH Write Protection: LVD Reset [ [ [ [ [ [ Watchdog Selection: [ ] Software Activation [ Watchdog Reset on Halt: [ ] Disabled [ ] ] ] ] ] ] ] ] 1K Enabled Enabled Highest threshold Medium threshold Lowest threshold Hardware Activation Enabled Comments: . . . . . . . . Supply Operating Range in Notes:. . . . . . . . . . Date: . . . . . . . . . . Signature:. . . . . . . . . . . . . . . . . . t c u d o r P e s b O t e l o [ [ [ [ ] ] ] ] 0.5K Disabled Disabled Disabled . . the . . . . . . . . . . . . . application:. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Important note: Not all configurations are available. Refer to datasheet for authorized option byte combinations. Please download the latest version of this option list from: http://www.st.com/mcu > downloads > ST7 microcontrollers > Option list 127/136 Device configuration and ordering information 14.3 ST7LITEUS2, ST7LITEUS5 Development tools Development tools for the ST7 microcontrollers include a complete range of hardware systems and software tools from STMicroelectronics and third-party tool suppliers. The range of tools includes solutions to help you evaluate microcontroller peripherals, develop and debug your application, and program your microcontrollers. 14.3.1 Starter kits ST offers complete, affordable starter kits. Starter kits are complete, affordable hardware/software tool packages that include features and samples to help you quickly start developing your application. 14.3.2 Development and debugging tools Application development for ST7 is supported by fully optimizing C Compilers and the ST7 Assembler-Linker toolchain, which are all seamlessly integrated in the ST7 integrated development environments in order to facilitate the debugging and fine-tuning of your application. The Cosmic C Compiler is available in a free version that outputs up to 16 Kbytes of code. c u d ) s t( The range of hardware tools includes full-featured ST7-EMU3 series emulators, cost effective ST7-DVP3 series emulators and the low-cost RLink in-circuit debugger/programmer. These tools are supported by the ST7 Toolset from STMicroelectronics, which includes the STVD7 integrated development environment (IDE) with high-level language debugger, editor, project manager and integrated programming interface. 14.3.3 Programming tools e t le o r P o s b O - During the development cycle, the ST7-DVP3 and ST7-EMU3 series emulators and the RLink provide in-circuit programming capability for programming the Flash microcontroller on your application board. ) s ( ct ST also provides a low-cost dedicated in-circuit programmer, the ST7-STICK, as well as ST7 Socket Boards which provide all the sockets required for programming any of the devices in a specific ST7 sub-family on a platform that can be used with any tool with incircuit programming capability for ST7. u d o r P e For production programming of ST7 devices, ST's third-party tool partners also provide a complete range of gang and automated programming solutions, which are ready to integrate into your production environment. t e l o 14.3.4 s b O 128/136 Order codes for development and programming tools Table 80 below lists the ordering codes for the ST7LITEUSx development and programming tools. For additional ordering codes for spare parts and accessories, refer to the online product selector at www.st.com/mcu. ST7LITEUS2, ST7LITEUS5 Table 80. Device configuration and ordering information Development tool order codes for the ST7LITEUSx family In-circuit Debugger, RLink series(1) Supported products ST7FLITEUS2 ST7FLITEUS5 Emulator Programming tool Starter kit without demo board Starter kit with Demo Board DVP series EMU series In-circuit programmer ST socket boards and EPBs STX-RLINK(2) STFLITESK/RAIS(2) ST7MDT10DVP3(3) ST7MDT10EMU3 STX-RLINK ST7STICK(5)(4) ST7SB10SU0(5) 1. Available from ST or from Raisonance, www.raisonance.com. 2. USB connection to PC. 3. Includes connection kit for Plastic DIP16/SO16 only. See "How to order an EMU or DVP" in ST product and tool selection guide for connection kit ordering information. 4. Parallel port connection to PC. 5. Add suffix /EU, /UK or /US for the power supply for your region. 14.4 ST7 application notes Table 81. ST7 application notes Identification Description Application examples e t le c u d ) s t( o r P AN1658 Serial numbering implementation AN1720 Managing the readout protection in flash microcontrollers AN1755 A high resolution/precision thermometer using ST7 and NE555 AN1756 Choosing a DALI Implementation strategy with ST7DALI AN1812 A high precision, low cost, single supply ADC for positive and negative input voltages ) s ( ct Example drivers o s b O - u d o AN 969 SCI communication between ST7 and PC AN 970 SPI communication between ST7 and EEPROM r P e AN 971 IC communication between ST7 and M24Cxx EEPROM t e l o AN 972 AN 973 bs AN 974 ST7 software SPI master communication SCI software communication with a PC using ST72251 16-bit timer Real time clock with ST7 Timer Output Compare AN 976 Driving a buzzer through ST7 timer PWM function AN 979 Driving an analog keyboard with the ST7 ADC AN 980 ST7 keypad decoding techniques, implementing wakeup on keystroke AN1017 Using the ST7 universal serial bus microcontroller AN1041 Using ST7 PWM signal to generate analog output (sinusoid) AN1042 ST7 routine for IC slave mode management O 129/136 Device configuration and ordering information Table 81. ST7LITEUS2, ST7LITEUS5 ST7 application notes (continued) Identification Description AN1044 Multiple interrupt sources management for ST7 MCUs AN1045 ST7 S/W implementation of IC bus master AN1046 UART emulation software AN1047 Managing reception errors with the ST7 SCI peripherals AN1048 ST7 software LCD driver AN1078 PWM duty cycle switch implementing true 0% & 100% duty cycle AN1082 Description of the ST72141 motor control peripherals registers AN1083 ST72141 BLDC motor control software and flowchart example AN1105 ST7 pCAN peripheral driver AN1129 PWM management for BLDC motor drives using the ST72141 AN1130 An introduction to sensorless brushless DC motor drive applications with the ST72141 AN1148 Using the ST7263 for designing a USB mouse AN1149 Handling Suspend mode on a USB mouse AN1180 Using the ST7263 Kit to implement a USB game pad AN1276 BLDC motor start routine for the ST72141 microcontroller AN1321 Using the ST72141 motor control MCU in sensor mode AN1325 Using the ST7 USB low-speed firmware V4.x AN1445 Emulated 16-bit slave SPI AN1475 Developing an ST7265X mass storage application AN1504 Starting a PWM signal directly at high level using the ST7 16-bit timer AN1602 16-bit timing operations using ST7262 or ST7263B ST7 USB MCUs AN1633 Device firmware upgrade (DFU) implementation in ST7 non-USB applications AN1712 Generating a high resolution sinewave using ST7 PWMART AN1713 SMBus slave driver for ST7 I2C peripherals ) s ( ct AN1947 t e l o u d o Software UART using 12-bit ART ST7MC PMAC sine wave motor control software library General purpose s b O AN1476 Low cost power supply for home appliances AN1526 ST7FLITE0 quick reference note AN1709 EMC design for ST Microcontrollers AN1752 ST72324 quick reference note Product evaluation AN 910 Performance benchmarking AN 990 ST7 benefits vs industry standard 130/136 o r P o s b O - r P e AN1753 e t le c u d ) s t( ST7LITEUS2, ST7LITEUS5 Table 81. Device configuration and ordering information ST7 application notes (continued) Identification Description AN1077 Overview of enhanced CAN controllers for ST7 and ST9 MCUs AN1086 U435 can-do solutions for car multiplexing AN1103 Improved B-EMF detection for low speed, low voltage with ST72141 AN1150 Benchmark ST72 vs PC16 AN1151 Performance comparison between ST72254 & PC16F876 AN1278 LIN (local interconnect network) solutions Product migration AN1131 Migrating applications from ST72511/311/214/124 to ST72521/321/324 AN1322 Migrating an application from ST7263 Rev.B to ST7263B AN1365 Guidelines for migrating ST72C254 applications to ST72F264 AN1604 How to use ST7MDT1-TRAIN with ST72F264 AN2200 Guidelines for migrating ST7LITE1x applications to ST7FLITE1xB c u d Product optimization o r P AN 982 Using ST7 with ceramic resonator AN1014 How to Minimize the ST7 power consumption AN1015 Software techniques for improving microcontroller EMC performance AN1040 Monitoring the Vbus signal for USB Self-powered devices AN1070 ST7 checksum self-checking capability AN1181 Electrostatic Discharge sensitive measurement AN1324 Calibrating the RC oscillator of the ST7FLITE0 MCU using the mains AN1502 Emulated data EEPROM with ST7 HDFLASH memory AN1529 Extending the current & voltage capability on the ST7265 VDDF supply AN1530 Accurate timebase for low-cost ST7 applications with internal RC oscillator AN1605 Using an active RC to wakeup the ST7LITE0 from power saving mode ) s ( ct t e l o AN1946 bs o s b O - u d o r P e AN1636 AN1828 Understanding and minimizing ADC conversion errors PIR (passive Infrared) detector using the ST7FLITE05/09/SUPERLITE Sensorless BLDC motor control and BEMF sampling methods with ST7MC AN1953 PFC for ST7MC starter kit AN1971 ST7LITE0 microcontrolled ballast O e t le ) s t( Programming and tools AN 978 ST7 Visual Develop software key debugging features AN 983 Key features of the Cosmic ST7 C-compiler package AN 985 Executing code In ST7 RAM AN 986 Using the indirect addressing mode with ST7 131/136 Device configuration and ordering information Table 81. ST7LITEUS2, ST7LITEUS5 ST7 application notes (continued) Identification Description AN 987 ST7 serial test controller programming AN 988 Starting with ST7 assembly tool chain AN1039 ST7 math utility routines AN1071 Half duplex USB-to-serial bridge using the ST72611 USB microcontroller AN1106 Translating assembly code from HC05 to ST7 AN1179 Programming ST7 Flash microcontrollers in remote ISP mode (In-situ programming) AN1446 Using the ST72521 emulator to debug an ST72324 target application AN1477 Emulated data EEPROM with Xflash memory AN1527 Developing a USB smartcard reader with ST7SCR AN1575 On-board programming methods for XFLASH and HDFLASH ST7 MCUs AN1576 In-application programming (IAP) drivers for ST7 HDFLASH or XFLASH MCUs AN1577 Device firmware upgrade (DFU) implementation for ST7 USB applications AN1601 Software implementation for ST7DALI-EVAL AN1603 Using the ST7 USB device firmware upgrade development kit (DFU-DK) AN1635 ST7 customer ROM code release information AN1754 Data logging program for testing ST7 applications via I2C AN1796 Field updates for FLASH based ST7 applications using a PC comm port AN1900 Hardware implementation for ST7DALI-EVAL AN1904 ST7MC three-phase AC induction motor control software library AN1905 ST7MC three-phase BLDC motor control software library ) s ( ct System optimization e t le o r P o s b O - AN1711 Software techniques for compensating ST7 ADC errors AN1827 Implementation of SIGMA-DELTA ADC with ST7FLITE05/09 AN2009 PWM Management for 3-phase BLDC motor drives using the ST7FMC AN2030 r P e t e l o s b O 132/136 u d o Back EMF detection during PWM on time by ST7MC c u d ) s t( ST7LITEUS2, ST7LITEUS5 15 Known limitations Known limitations External interrupt 2 (ei2) Whatever the external interrupt sensitivity configured through EICR1 register, ei2 cannot exit the MCU from Halt, Active-halt and AWUFH modes when a falling edge occurs. Workaround None c u d e t le ) s ( ct ) s t( o r P o s b O - u d o r P e t e l o s b O 133/136 Revision history ST7LITEUS2, ST7LITEUS5 16 Revision history Table 82. Document revision history Date Revision Changes 06-Feb-06 1 Initial release 2 Removed references to 3% RC Added note below Figure 4 Modified presentation of Section 4.3.1 Added notes to Section 6.2 (above Figure 9), replaced 8-bit calibration value to 10-bit calibration value and changed application note reference (AN2326 instead of AN1324) Modifed Table 7: Clock register map and reset values and added bit 1 in the description of CKCNTCSR register Modified Figure 13 (added CKCNTCSR register) Added note 2 to EICRx description Modified caution in section 7.2 on page 25 Replaced VIT+(LVD) by VIT+(LVD) in Section : Monitoring the VDD main supply Modified LVDRF bit description in Section 7.4.4: Register description Replaced "oscillator" by "main oscillator" in the second paragraph of Section 8.4.2: Halt mode Added note 1 to Figure 23 and added note 5 to Figure 24 Modified Section 8.5: Auto-wakeup from Halt mode Replaced bit 1 by bit 2 for AWUF bit in Section 8.5.1: Register description Modified Section 9.1: Introduction. Modified Section : External interrupt function.Updated Section 9.5: Interrupts. Modified Section Table 47.: Operating conditions with low voltage detector (LVD). Modified Table 48: Auxiliary Voltage Detector (AVD) Thresholds. Modified Table 49: Voltage drop between AVD flag set and LVD reset generation. Modified Table 50: Internal RC oscillator calibrated at 5 V. Modified Table 53: Supply current. Modified Table 54: On-chip peripherals. Modified Table 63: General characteristics. Modified Table 64: Output driving current. Modified Table 65: Asynchronous RESET pin characteristics. Modified Section 12.10: ADC characteristics. Added Figure 49. Modified Figure 61. Removed EMC protection circuitry in Figure 62 (device works correctly without these components). Added ECOPACK text in Section 13: Package characteristics. Modified first paragraph in Section 14: Device configuration and ordering information. Modified Table 79. Modified conditioning option in option list. Modified Section 14.3: Development tools. Added Section 14.4: ST7 application notes. Added Section : . Added erratasheet at the end of the document. c u d 18-Apr-06 e t le ) s ( ct u d o r P e t e l o s b O 134/136 o s b O - o r P ) s t( ST7LITEUS2, ST7LITEUS5 Table 82. Revision history Document revision history (continued) Date 18-Sep-06 Revision Changes 3 Modified description of AVD[1:0] bits in the AVDTRH register in Section 7.4.4 Modified description of CNTR[11:0] bits in Section 10.2.6: Register description Modified values in Table 44 LVD and AVD tables updated, Table 47, Table 48 and Table 49 Internal RC oscillator data modified in Table 50 and new table added Table 51 Typical data in Table 54 (on chip peripherals) modified EMC characteristics updated, Section 12.7 RPU data corrected in Table 63 including additional notes Output driving current table updated, Table 64 RON data corrected in Table 65. Modified ADC accuracy tables in Section 12.10 Section : updated Errata sheet removed from document Notes modified for low voltage detector Section 7.4.1 Notes updated in Section 4.4 (I2C Interface) Thermal characteristics table updated, Table 74 Modified option list on Section 14.2: Ordering information Modified Section 14.3: Development tools Modified text in Section : c u d 26-Jan-07 ) s t( Added -40C to 125C temperature range Modified note on ei4 in Table 9: Interrupt mapping Added note 3 to Section 7.3.2: External Interrupt Control register 2 (EICR2) Added Figure 41 and Figure 40 Added a note to LVDRF in Section 7.4.4: Register description Section 6.4.1: Introduction Modified Table 47 and Table 48 Modified Table 50Updated Table 53 Updated Table 64 Modified RAIN and ADC accuracy tables in Section 12.10: ADC characteristics Modified Table 80 Modified Table 79 Modified option list on Figure 69: Option list e t le 4 ) s ( ct o r P o s b O - Document reformatted. Replaced ST7ULTRALITE by ST7LITEUS2 and ST7LITEUS5. Removed limitations in user and in I2C mode from Section 15: Known limitations, and added External interrupt 2 (ei2). Added MCO on pin 3. Updated Section 12.3.2: Operating conditions with low voltage detector (LVD), Section 12.3.3: Auxiliary voltage detector (AVD) thresholds, Section 12.3.4: Internal RC oscillator, Section 12.4: Supply current characteristics, and Section 12.8.2: Output driving current characteristics. Updated internal RC prescaler to add 500 KHz. Updated ECOPACK text in Section 13.1: Package mechanical data. Added PDIP16 silhouette on cover page, and updated Table 73: 16-pin plastic dual inline package, 300-mil width, package mechanical data and Figure 68: 16-pin plastic dual in-line package, 300-mil width, package outline. Changed order codes to die A version in Table 79: Supported order codes. Removed soldering information section. Updated option list. u d o r P e s b O t e l o 06-Feb-2009 5 135/136 ST7LITEUS2, ST7LITEUS5 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. c u d ) s t( 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. e t le o r P 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. o s b O - 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. ) s ( ct u d o 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. r P e t e l o s b O 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. (c) 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 136/136