ST7FLITE29F2M6TR STMicroelectronics, ST7FLITE29F2M6TR Datasheet

IC MCU 8BIT 8K FLASH 20-SOIC

ST7FLITE29F2M6TR

Manufacturer Part Number
ST7FLITE29F2M6TR
Description
IC MCU 8BIT 8K FLASH 20-SOIC
Manufacturer
STMicroelectronics
Series
ST7r
Datasheets

Specifications of ST7FLITE29F2M6TR

Core Processor
ST7
Core Size
8-Bit
Speed
8MHz
Connectivity
SPI
Peripherals
LVD, POR, PWM, WDT
Number Of I /o
15
Program Memory Size
8KB (8K x 8)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
384 x 8
Voltage - Supply (vcc/vdd)
2.4 V ~ 5.5 V
Data Converters
A/D 7x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
20-SOIC (7.5mm Width)
Processor Series
ST7FLITE2x
Core
ST7
Data Bus Width
8 bit
Data Ram Size
384 B
Interface Type
SPI
Maximum Clock Frequency
8 MHz
Number Of Programmable I/os
15
Number Of Timers
3
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
Development Tools By Supplier
ST7FLIT2-COS/COM, ST7FLITE-SK/RAIS, ST7MDT10-DVP3, ST7MDT10-EMU3, STX-RLINK
Minimum Operating Temperature
- 40 C
On-chip Adc
10 bit, 7 Channel / 13 bit, 7 Channel
For Use With
497-5858 - EVAL BOARD PLAYBACK ST7FLITE497-5049 - KIT STARTER RAISONANCE ST7FLITE
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ST7FLITE29F2M6TR
Manufacturer:
ST
Quantity:
5 700
Part Number:
ST7FLITE29F2M6TR
Manufacturer:
ST
0
Part Number:
ST7FLITE29F2M6TR
Manufacturer:
ST
Quantity:
20 000
Part Number:
ST7FLITE29F2M6TR
Manufacturer:
ST
Quantity:
13 226
Part Number:
ST7FLITE29F2M6TR
Manufacturer:
ST
Quantity:
9 645
Part Number:
ST7FLITE29F2M6TR
Manufacturer:
ST
Quantity:
15 844
Part Number:
ST7FLITE29F2M6TR 11+
Manufacturer:
ST
0
Part Number:
ST7FLITE29F2M6TR.
Manufacturer:
ST
0
Device Summary
July 2006
Program memory - bytes
RAM (stack) - bytes
Data EEPROM - bytes
Peripherals
Operating Supply
CPU Frequency
Operating Temperature
Packages
8-BIT MICROCONTROLLER WITH SINGLE VOLTAGE FLASH
Memories
– 8 Kbytes single voltage Flash Program mem-
– 384 bytes RAM
Clock, Reset and Supply Management
– Enhanced reset system
– Enhanced low voltage supervisor (LVD) for
– Clock sources: Internal 1% RC oscillator,
– Internal 32-MHz input clock for Auto-reload
– Optional x4 or x8 PLL for 4 or 8 MHz internal
– Five Power Saving Modes: Halt, Active-Halt,
I/O Ports
– Up to 15 multifunctional bidirectional I/O lines
– 7 high sink outputs
4 Timers
– Configurable Watchdog Timer
– Two 8-bit Lite Timers with prescaler,
– One 12-bit Auto-reload Timer with 4 PWM
ory with read-out protection, In-Circuit Pro-
gramming and In-Application programming
(ICP and IAP). 10K write/erase cycles guar-
anteed, data retention: 20 years at 55°C.
main supply and an auxiliary voltage detector
(AVD) with interrupt capability for implement-
ing safe power-down procedures
crystal/ceramic resonator or external clock
timer
clock
Wait and Slow, Auto Wake Up From Halt
1 realtime base and 1 input capture
outputs, input capture and output compare
functions
Features
MEMORY, DATA EEPROM, ADC, TIMERS, SPI
(w/ ext OSC up to 16MHz)
Lite Timer with Watchdog,
10-bit ADC with Op-Amp
Autoreload Timer, SPI,
ST7LITE20
Up to 8Mhz
-
– SPI synchronous serial interface
– 10 interrupt vectors plus TRAP and RESET
– 15 external interrupt lines (on 4 vectors)
– 7 input channels
– Fixed gain Op-amp
– 13-bit resolution for 0 to 430 mV (@ 5V V
– 10-bit resolution for 430 mV to 5V (@ 5V V
– 8-bit data manipulation
– 63 basic instructions with illegal opcode de-
– 17 main addressing modes
– 8 x 8 unsigned multiply instructions
– Full hardware/software development package
– DM (Debug Module)
1 Communication Interface
Interrupt Management
A/D Converter
Instruction Set
Development Tools
tection
SO20 300”, DIP20
-40°C to +85°C
2.4V to 5.5V
ST7LITE25
384 (128)
Autoreload Timer with 32-MHz input clock,
DIP20
Up to 8Mhz (w/ ext OSC up to 16MHz
8K
and int 1MHz RC 1% PLLx8/4MHz)
-
SPI, 10-bit ADC with Op-Amp
Lite Timer with Watchdog,
ST7LITE2
ST7LITE29
SO20
300”
256
Rev. 4
1/133
DD
DD
1
)
)

Related parts for ST7FLITE29F2M6TR

ST7FLITE29F2M6TR Summary of contents

Page 1

MICROCONTROLLER WITH SINGLE VOLTAGE FLASH MEMORY, DATA EEPROM, ADC, TIMERS, SPI Memories ■ – 8 Kbytes single voltage Flash Program mem- ory with read-out protection, In-Circuit Pro- gramming and In-Application programming (ICP and IAP). 10K write/erase cycles guar- anteed, ...

Page 2

INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 3

INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ...

Page 4

CLEARING ACTIVE INTERRUPTS OUTSIDE INTERRUPT ROUTINE . . . . . . . . . . . . 130 16.6 USING PB4 AS EXTERNAL INTERRUPT . . . . . . . . . . . . . . ...

Page 5

INTRODUCTION The ST7LITE2 is a member of the ST7 microcon- troller family. All ST7 devices are based on a com- mon industry-standard 8-bit core, featuring an en- hanced instruction set. The ST7LITE2 features FLASH memory with byte-by-byte In-Circuit Programming ...

Page 6

ST7LITE2 2 PIN DESCRIPTION Figure 2. 20-Pin SO Package Pinout SCK/AIN1/PB1 MISO/AIN2/PB2 MOSI/AIN3/PB3 CLKIN/AIN4/PB4 Figure 3. 20-Pin DIP Package Pinout MISO/AIN2/PB2 MOSI/AIN3/PB3 CLKIN/AIN4/PB4 MCO/ICCCLK/BREAK/PA6 ATPWM3/ICCDATA/PA5(HS) ATPWM2/PA4(HS) ATPWM1/PA3(HS) 6/133 RESET 3 SS/AIN0/PB0 4 ei0 ...

Page 7

PIN DESCRIPTION (Cont’d) Legend / Abbreviations for Type input output supply In/Output level CMOS 0.3V T Output level 20mA high sink (on N-buffer only) Port and control configuration: – Input: ...

Page 8

ST7LITE2 Pin No. Pin Name PA6 /MCO I/O ICCCLK/BREAK PA5 /ATPWM3 I/O C ICCDATA 14 9 PA4/ATPWM2 I PA3/ATPWM1 I PA2/ATPWM0 I PA1/ATIC I ...

Page 9

REGISTER & MEMORY MAP As shown in Figure 4, the MCU is capable of ad- dressing 64K bytes of memories and I/O registers. The available memory locations consist of 128 bytes of register locations, 384 bytes of RAM, 256 ...

Page 10

ST7LITE2 Table 2. Hardware Register Map Address Block Register Label 0000h PADR 0001h Port A PADDR 0002h PAOR 0003h PBDR 0004h Port B PBDDR 0005h PBOR 0006h 0007h 0008h LTCSR2 0009h LTARR LITE 000Ah LTCNTR TIMER 2 000Bh LTCSR1 000Ch ...

Page 11

Address Block Register Label 0037h ITC EICR 0038h MCC MCCSR 0039h Clock and RCCR 003Ah Reset SICSR 003Bh 003Ch ITC EISR 003Dh to 0048h 0049h AWUPR AWU 004Ah AWUCSR 004Bh DMCR 004Ch DMSR 004Dh DMBK1H 3) DM 004Eh DMBK1L 004Fh ...

Page 12

ST7LITE2 4 FLASH PROGRAM MEMORY 4.1 Introduction The ST7 single voltage extended Flash (XFlash non-volatile memory that can be electrically erased and programmed either on a byte-by-byte basis bytes in parallel. The XFlash devices ...

Page 13

FLASH PROGRAM MEMORY (Cont’d) 4.4 ICC interface ICP needs a minimum of 4 and pins to be connected to the programming tool. These pins are: – RESET: device reset – device power supply ground SS ...

Page 14

ST7LITE2 FLASH PROGRAM MEMORY (Cont’d) 4.5 Memory Protection There are two different types of memory protec- tion: Read Out Protection and Write/Erase Protec- tion which can be applied individually. 4.5.1 Read-out Protection Read-out protection, when selected provides a protection against ...

Page 15

DATA EEPROM 5.1 INTRODUCTION The Electrically Erasable Programmable Read Only Memory can be used as a non volatile back- up for storing data. Using the EEPROM requires a basic access protocol described in this chapter. Figure 6. EEPROM Block ...

Page 16

ST7LITE2 DATA EEPROM (Cont’d) 5.3 MEMORY ACCESS The Data EEPROM memory read/write access modes are controlled by the E2LAT bit of the EEP- ROM Control/Status register (EECSR). The flow- chart in Figure 7 describes these different memory access modes. Read ...

Page 17

DATA EEPROM (Cont’d) 2 Figure 8. Data E PROM Write Operation ⇓ Row / Byte ⇒ ROW DEFINITION Byte 1 Byte 2 Writing data latches E2LAT bit Set by USER application E2PGM bit Note programming cycle is interrupted ...

Page 18

ST7LITE2 DATA EEPROM (Cont’d) 5.4 POWER SAVING MODES Wait mode The DATA EEPROM can enter WAIT mode on ex- ecution of the WFI instruction of the microcontrol- ler or when the microcontroller enters Active-HALT mode.The DATA EEPROM will immediately enter ...

Page 19

DATA EEPROM (Cont’d) 5.7 REGISTER DESCRIPTION EEPROM CONTROL/STATUS REGISTER (EEC- SR) Read/Write Reset Value: 0000 0000 (00h Bits 7:2 = Reserved, forced by hardware to 0. Bit 1 = E2LAT Latch Access Transfer This ...

Page 20

ST7LITE2 6 CENTRAL PROCESSING UNIT 6.1 INTRODUCTION This CPU has a full 8-bit architecture and contains six internal registers allowing efficient 8-bit data manipulation. 6.2 MAIN FEATURES 63 basic instructions ■ Fast 8-bit by 8-bit multiply ■ 17 main addressing ...

Page 21

CPU REGISTERS (Cont’d) CONDITION CODE REGISTER (CC) Read/Write Reset Value: 111x1xxx The 8-bit Condition Code register contains the in- terrupt mask and four flags representative of the result of the instruction just executed. This ...

Page 22

ST7LITE2 CPU REGISTERS (Cont’d) STACK POINTER (SP) Read/Write Reset Value: 01FFh SP6 SP5 SP4 SP3 The Stack Pointer is a 16-bit register which is al- ways pointing to the next free location ...

Page 23

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 re- ducing the number of external components. Main features Clock ...

Page 24

ST7LITE2 PHASE LOCKED LOOP (Cont’d) Figure 12. PLL Output Frequency Timing Diagram LOCKED bit set 4/8 x input freq. t LOCK t STARTUP When the PLL is started, after reset or wakeup from Halt mode or AWUFH mode, it outputs ...

Page 25

Figure 13. Clock Management Block Diagram CR7 CR6 CR5 Tunable 1% RC OSC,PLLOFF, OSCRANGE[2:0] Option bits CLKIN CLKIN CLKIN CLKIN OSC /OSC1 1-16 MHZ OSC2 or 32kHz f OSC /32 DIVIDER CR4 CR3 CR2 CR1 CR0 f CPU Oscillator PLL ...

Page 26

ST7LITE2 7.4 MULTI-OSCILLATOR (MO) The main clock of the ST7 can be generated by four different source types coming from the multi- oscillator block (1 to 16MHz or 32kHz): an external source ■ 5 crystal or ceramic resonator oscillators ■ ...

Page 27

RESET SEQUENCE MANAGER (RSM) 7.5.1 Introduction The reset sequence manager includes three RE- SET sources as shown in Figure External RESET source pulse ■ Internal LVD RESET (Low Voltage Detection) ■ Internal WATCHDOG RESET ■ Note: A reset can ...

Page 28

ST7LITE2 RESET SEQUENCE MANAGER (Cont’d) The RESET pin is an asynchronous signal which plays a major role in EMS performance noisy environment recommended to follow the guidelines mentioned in the electrical characteris- tics section. 7.5.3 External ...

Page 29

SYSTEM INTEGRITY MANAGEMENT (SI) The System Integrity Management block contains the Low voltage Detector (LVD) and Auxiliary Volt- age Detector (AVD) functions managed by the SICSR register. Note: A reset can also be triggered following the detection ...

Page 30

ST7LITE2 Figure 18. Reset and Supply Management Block Diagram RESET SEQUENCE RESET MANAGER (RSM 30/133 1 WATCHDOG TIMER (WDG) SYSTEM INTEGRITY MANAGEMENT SICSR WDGRF AUXILIARY VOLTAGE STATUS FLAG AVD Interrupt Request LOCKED LVDRF ...

Page 31

SYSTEM INTEGRITY MANAGEMENT (Cont’d) 7.6.2 Auxiliary Voltage Detector (AVD) The Voltage Detector function (AVD) is based on an analog comparison between reference value and the V IT+(AVD) ply voltage (V ). The V AVD IT-(AVD) for falling ...

Page 32

ST7LITE2 SYSTEM INTEGRITY MANAGEMENT (Cont’d) 7.6.3 Low Power Modes Mode Description No effect on SI. AVD interrupts cause the WAIT device to exit from Wait mode. The SICSR register is frozen. HALT The AVD remains active. 7.6.3.1 Interrupts The AVD ...

Page 33

SYSTEM INTEGRITY MANAGEMENT (Cont’d) 7.6.4 Register Description SYSTEM INTEGRITY (SI) CONTROL/STATUS REGISTER (SICSR) Read/Write Reset Value: 0000 0xx0 (0xh) 7 WDG LOCKED LVDRF AVDF AVDIE RF Bit 7:5 = Reserved, must be kept cleared. Bit 4 = ...

Page 34

ST7LITE2 8 INTERRUPTS The ST7 core may be interrupted by one of two dif- ferent methods: maskable hardware interrupts as listed in the Interrupt Mapping Table and a non- maskable software interrupt (TRAP). The Interrupt processing flowchart is shown in ...

Page 35

INTERRUPTS (Cont’d) Figure 20. Interrupt Processing Flowchart FROM RESET EXECUTE INSTRUCTION Table 5. Interrupt Mapping Source N° Block RESET Reset TRAP Software Interrupt 0 AWU Auto Wake Up Interrupt 1 ei0 External Interrupt 0 2 ei1 External Interrupt 1 3 ...

Page 36

ST7LITE2 INTERRUPTS (Cont’d) EXTERNAL INTERRUPT CONTROL REGISTER (EICR) Read/Write Reset Value: 0000 0000 (00h) 7 IS31 IS30 IS21 IS20 IS11 Bit 7:6 = IS3[1:0] ei3 sensitivity These bits define the interrupt sensitivity for ei3 (Port B0) according to Table Bit ...

Page 37

INTERRUPTS (Cont’d) Bit 3:2 = ei1[1:0] ei1 pin selection These bits are written by software. They select the Port A I/O pin used for the ei1 external interrupt ac- cording to the table below. External Interrupt I/O pin selection ei11 ...

Page 38

ST7LITE2 9 POWER SAVING MODES 9.1 INTRODUCTION To give a large measure of flexibility to the applica- tion in terms of power consumption, five main pow- er saving modes are implemented in the ST7 (see Figure 21): Slow ■ Wait ...

Page 39

POWER SAVING MODES (Cont’d) 9.3 WAIT MODE WAIT mode places the MCU in a low power con- sumption mode by stopping the CPU. This power saving mode is selected by calling the ‘WFI’ instruction. All peripherals remain active. During WAIT ...

Page 40

ST7LITE2 POWER SAVING MODES (Cont’d) 9.4 HALT MODE The HALT mode is the lowest power consumption mode of the MCU entered by executing the ‘HALT’ instruction when ACTIVE-HALT is disabled (see section 9.5 on page 41 when the ...

Page 41

POWER SAVING MODES (Cont’d) 9.4.1 Halt Mode Recommendations – Make sure that an external event is available to wake up the microcontroller from Halt mode. – When using an external interrupt to wake up the microcontroller, reinitialize the corresponding I/O ...

Page 42

ST7LITE2 POWER SAVING MODES (Cont’d) Figure 26. ACTIVE-HALT Timing Overview ACTIVE 256 OR 4096 CPU RUN HALT CYCLE DELAY RESET OR HALT INTERRUPT INSTRUCTION [Active Halt Enabled] Figure 27. ACTIVE-HALT Mode Flow-chart OSCILLATOR PERIPHERALS HALT INSTRUCTION CPU (Active Halt enabled) ...

Page 43

POWER SAVING MODES (Cont’d) Similarities with Halt mode The following AWUFH mode behaviour is the same as normal Halt mode: – The MCU can exit AWUFH mode by means of any interrupt with exit from Halt capability or a re- ...

Page 44

ST7LITE2 POWER SAVING MODES (Cont’d) Figure 30. AWUFH Mode Flow-chart HALT INSTRUCTION (Active-Halt disabled) (AWUCSR.AWUEN=1) ENABLE 0 1) WDGHALT 1 AWU RC OSC WATCHDOG MAIN OSC RESET PERIPHERALS CPU I[1:0] BITS INTERRUPT AWU RC OSC Y MAIN ...

Page 45

POWER SAVING MODES (Cont’d) 9.6.0.1 Register description AWUFH CONTROL/STATUS REGISTER (AWUCSR) Read/Write Reset Value: 0000 0000 (00h Bits 7:3 = Reserved. Bit 2 = AWUF Auto Wake Up Flag This bit is set by ...

Page 46

ST7LITE2 10 I/O PORTS 10.1 INTRODUCTION The I/O ports allow data transfer. An I/O port can contain pins. Each pin can be programmed independently either as a digital input or digital output. In addition, specific pins may ...

Page 47

OR register – select rising edge – reset the interrupt mask with the RIM instruc- tion (in cases where a pin level change could occur) 10.2.2 Output Modes Setting the DDRx bit selects ...

Page 48

ST7LITE2 I/O PORTS (Cont’d) Figure 31. I/O Port General Block Diagram ALTERNATE REGISTER OUTPUT ACCESS From on-chip periphera ALTERNATE ENABLE BIT DR DDR OR If implemented OR SEL DDR SEL DR SEL 1 0 EXTERNAL INTERRUPT REQUEST ( ...

Page 49

I/O PORTS (Cont’d) Table 9. I/O configurations PAD PAD PAD Notes: 1. When the I/O port is in input configuration and the associated alternate function is enabled as an output, reading the DR register will read the alternate function output ...

Page 50

ST7LITE2 I/O PORTS (Cont’d) Analog alternate function Configure the I/O as floating input to use an ADC input. The analog multiplexer (controlled by the ADC registers) switches the analog voltage present on the selected pin to the common analog rail, ...

Page 51

I/O PORTS (Cont’d) 10.7 DEVICE-SPECIFIC I/O PORT CONFIGURATION The I/O port register configurations are summa- rised as follows. Standard Ports PA7:0, PB6:0 MODE floating input pull-up input open drain output push-pull output Table 10. Port Configuration (Standard ports) Port Pin ...

Page 52

ST7LITE2 11 ON-CHIP PERIPHERALS 11.1 WATCHDOG TIMER (WDG) 11.1.1 Introduction The Watchdog timer is used to detect the occur- rence of a software fault, usually generated by ex- ternal interference or by unforeseen logical condi- tions, which causes the application ...

Page 53

WATCHDOG TIMER (Cont’d) The application program must write in the CR reg- ister at regular intervals during normal operation to prevent an MCU reset. This downcounter is free- running: it counts down even if the watchdog is disabled. The value ...

Page 54

ST7LITE2 WATCHDOG TIMER (Cont’d) 11.1.5 Interrupts None. 11.1.6 Register Description CONTROL REGISTER (CR) Read/Write Reset Value: 0111 1111 (7Fh) 7 WDGA Bit 7 = WDGA Activation bit. This bit is set by software and only cleared by ...

Page 55

AUTORELOAD TIMER 2 (AT2) 11.2.1 Introduction The 12-bit Autoreload Timer can be used for gen- eral-purpose timing functions based on a free- running 12-bit upcounter with an input capture reg- ister and four PWM output channels. ...

Page 56

ST7LITE2 12-BIT AUTORELOAD TIMER (Cont’d) 11.2.3 Functional Description PWM Mode This mode allows up to four Pulse Width Modulat- ed signals to be generated on the PWMx output pins. The PWMx output signals can be enabled or disabled using the ...

Page 57

AUTORELOAD TIMER (Cont’d) Figure 37. PWM Signal from 0% to 100% Duty Cycle f COUNTER COUNTER FFDh DCRx=000h DCRx=FFDh DCRx=FFEh DCRx=000h Output Compare Mode To use this function, load a 12-bit value in the DCRxH and DCRxL registers. When ...

Page 58

ST7LITE2 12-BIT AUTORELOAD TIMER (Cont’d) Figure 38. Block Diagram of Break Function BREAK pin (Active Low) BA PWM0 PWM1 PWM2 PWM3 Note: The BREAK pin value is latched by the BA bit. 11.2.3.1 Input Capture The 12-bit ATICR register is ...

Page 59

AUTORELOAD TIMER (Cont’d) 11.2.4 Low Power Modes Mode Description The input frequency is divided SLOW by 32 WAIT No effect on AT timer AT timer halted except if CK0=1, ACTIVE-HALT CK1=0 and OVFIE=1 HALT AT timer halted 11.2.5 Interrupts ...

Page 60

ST7LITE2 12-BIT AUTORELOAD TIMER (Cont’d) 11.2.6 Register Description TIMER CONTROL STATUS REGISTER (ATCSR) Read / Write Reset Value: 0x00 0000 (x0h ICF ICIE CK1 CK0 Bit 7 = Reserved. Bit 6 = ICF Input Capture Flag. This ...

Page 61

AUTORELOAD TIMER (Cont’d) AUTORELOAD REGISTER (ATRH) Read / Write Reset Value: 0000 0000 (00h ATR11 ATR10 ATR9 AUTORELOAD REGISTER (ATRL) Read / Write Reset Value: 0000 0000 (00h) 7 ATR7 ATR6 ATR5 ATR4 ATR3 ...

Page 62

ST7LITE2 12-BIT AUTORELOAD TIMER (Cont’d) Bit 4 = BPEN Break Pin Enable. This bit is read/write by software and cleared by hardware after Reset. 0: Break pin disabled 1: Break pin enabled Bits 3:0 = PWM[3:0] Break Pattern. These bits ...

Page 63

AUTORELOAD TIMER (Cont’d) Table 14. Register Map and Reset Values Address Register Label (Hex.) ATCSR 0D Reset Value CNTRH 0E Reset Value CNTRL CNTR7 0F Reset Value ATRH 10 Reset Value ATRL ATR7 11 Reset Value PWMCR 12 Reset ...

Page 64

ST7LITE2 Address Register Label (Hex.) TRANCR 21 Reset Value BREAKCR 22 Reset Value 64/133 BPEN PWM3 PWM2 PWM1 ...

Page 65

LITE TIMER 2 (LT2) 11.3.1 Introduction The Lite Timer can be used for general-purpose timing functions based on two free-running 8- bit upcounters, an 8-bit input capture register. 11.3.2 Main Features Realtime Clock ■ – One 8-bit ...

Page 66

ST7LITE2 LITE TIMER (Cont’d) 11.3.3 Functional Description 11.3.3.1 Timebase Counter 1 The 8-bit value of Counter 1 cannot be read or written by software. After an MCU reset, it starts incrementing from frequency of f overflow event ...

Page 67

LITE TIMER (Cont’d) 11.3.4 Low Power Modes Mode Description No effect on Lite timer SLOW (this peripheral is driven directly by f /32) OSC WAIT No effect on Lite timer ACTIVE-HALT No effect on Lite timer HALT Lite timer stops ...

Page 68

ST7LITE2 LITE TIMER (Cont’d) LITE TIMER COUNTER 2 (LTCNTR) Read only Reset Value: 0000 0000 (00h) 7 CNT7 CNT7 CNT7 CNT7 CNT3 Bits 7:0 = CNT[7:0] Counter 2 Reload Value. This register is read by software. The LTARR val- ue ...

Page 69

LITE TIMER (Cont’d) Table 15. Lite Timer Register Map and Reset Values Address Register Label (Hex.) LTCSR2 08 Reset Value LTARR AR7 09 Reset Value LTCNTR CNT7 0A Reset Value LTCSR1 ICIE 0B Reset Value LTICR ICR7 0C Reset Value ...

Page 70

ST7LITE2 11.4 SERIAL PERIPHERAL INTERFACE (SPI) 11.4.1 Introduction The Serial Peripheral Interface (SPI) allows full- duplex, synchronous, serial communication with external devices. An SPI system may consist of a master and one or more slaves or a system in which ...

Page 71

SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.3.1 Functional Description A basic example of interconnections between a single master and a single slave is illustrated in Figure 43. The MOSI pins are connected together and the MISO pins are connected together. In this ...

Page 72

ST7LITE2 SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.3.2 Slave Select Management As an alternative to using the SS pin to control the Slave Select signal, the application can choose to manage the Slave Select signal by software. This is configured by the ...

Page 73

SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.3.3 Master Mode Operation In master mode, the serial clock is output on the SCK pin. The clock frequency, polarity and phase are configured by software (refer to the description of the SPICSR register). Note: The ...

Page 74

ST7LITE2 SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.4 Clock Phase and Clock Polarity Four possible timing relationships may be chosen by software, using the CPOL and CPHA bits (See Figure 46). Note: The idle state of SCK must correspond to the polarity ...

Page 75

SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.5 Error Flags 11.4.5.1 Master Mode Fault (MODF) Master mode fault occurs when the master device has its SS pin pulled low. When a Master mode fault occurs: – The MODF bit is set and an ...

Page 76

ST7LITE2 SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.5.4 Single Master Configurations There are two types of SPI systems: – Single Master System – Multimaster System Single Master System A typical single master system may be configured, using a as the master and ...

Page 77

SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.6 Low Power Modes Mode Description No effect on SPI. WAIT SPI interrupt events cause the Device to exit from WAIT mode. SPI registers are frozen. In HALT mode, the SPI is inactive. SPI oper- ation ...

Page 78

ST7LITE2 SERIAL PERIPHERAL INTERFACE (Cont’d) 11.4.8 Register Description CONTROL REGISTER (SPICR) Read/Write Reset Value: 0000 xxxx (0xh) 7 SPIE SPE SPR2 MSTR CPOL Bit 7 = SPIE Serial Peripheral Interrupt Enable. This bit is set and cleared by software. 0: ...

Page 79

SERIAL PERIPHERAL INTERFACE (Cont’d) CONTROL/STATUS REGISTER (SPICSR) Read/Write (some bits Read Only) Reset Value: 0000 0000 (00h) 7 SPIF WCOL OVR MODF Bit 7 = SPIF Serial Peripheral Data Transfer Flag (Read only). This bit is set by hardware when ...

Page 80

ST7LITE2 Table 17. SPI Register Map and Reset Values Address Register Label (Hex.) SPIDR MSB 0031h Reset Value SPICR SPIE 0032h Reset Value SPICSR SPIF 0033h Reset Value 80/133 SPE SPR2 MSTR 0 ...

Page 81

A/D CONVERTER (ADC) 11.5.1 Introduction The on-chip Analog to Digital Converter (ADC) pe- ripheral is a 10-bit, successive approximation con- verter with internal sample and hold circuitry. This peripheral has multiplexed analog input channels (refer ...

Page 82

ST7LITE2 10-BIT A/D CONVERTER (ADC) (Cont’d) 11.5.3.2 Input Voltage Amplifier The input voltage can be amplified by a factor enabling the AMPSEL bit in the ADCDRL regis- ter. When the amplifier is enabled, the input range is ...

Page 83

A/D CONVERTER (ADC) (Cont’d) 11.5.6 Register Description CONTROL/STATUS REGISTER (ADCCSR) Read/Write (Except bit 7 read only) Reset Value: 0000 0000 (00h) 7 EOC SPEED ADON 0 CH3 Bit 7 = EOC End of Conversion This bit is set by ...

Page 84

ST7LITE2 Bit 2 = AMPSEL Amplifier Selection Bit 0: Amplifier is not selected 1: Amplifier is selected Bits 1:0 = D[1:0] LSB of Analog Converted Value Note: When AMPSEL mandatory that f be less than or equal to ...

Page 85

INSTRUCTION SET 12.1 ST7 ADDRESSING MODES The ST7 Core features 17 different addressing modes which can be classified in seven main groups: Addressing Mode Inherent nop Immediate ld A,#$55 Direct ld A,$55 Indexed ld A,($55,X) Indirect ld A,([$55],X) Relative ...

Page 86

ST7LITE2 ST7 ADDRESSING MODES (Cont’d) 12.1.1 Inherent All Inherent instructions consist of a single byte. The opcode fully specifies all the required informa- tion for the CPU to process the operation. Inherent Instruction NOP No operation TRAP S/W Interrupt Wait ...

Page 87

ST7 ADDRESSING MODES (Cont’d) 12.1.6 Indirect Indexed (Short, Long) This is a combination of indirect and short indexed addressing modes. The operand is referenced by its memory address, which is defined by the un- signed addition of an index register ...

Page 88

ST7LITE2 12.2 INSTRUCTION GROUPS The ST7 family devices use an Instruction Set consisting of 63 instructions. The instructions may Load and Transfer Stack operation Increment/Decrement Compare and Tests Logical operations Bit Operation Conditional Bit Test and Branch Arithmetic operations Shift ...

Page 89

INSTRUCTION GROUPS (Cont’d) Mnemo Description ADC Add with Carry ADD Addition AND Logical And BCP Bit compare A, Memory BRES Bit Reset BSET Bit Set BTJF Jump if bit is false (0) BTJT Jump if bit is true (1) CALL ...

Page 90

ST7LITE2 INSTRUCTION GROUPS (Cont’d) Mnemo Description JRULE Jump Load MUL Multiply NEG Negate (2's compl) NOP No Operation OR OR operation POP Pop from the Stack PUSH Push onto the Stack RCF Reset ...

Page 91

ELECTRICAL CHARACTERISTICS 13.1 PARAMETER CONDITIONS Unless otherwise specified, all voltages are re- ferred 13.1.1 Minimum and Maximum values Unless otherwise specified the minimum and max- imum values are guaranteed in the worst condi- tions of ...

Page 92

ST7LITE2 13.2 ABSOLUTE MAXIMUM RATINGS Stresses above those listed as “absolute maxi- mum ratings” may cause permanent damage to the device. This is a stress rating only and func- tional operation of the device under these condi- 13.2.1 Voltage Characteristics ...

Page 93

OPERATING CONDITIONS 13.3.1 General operating conditions T = -40 to +85°C unless otherwise specified. A Symbol Parameter V Supply voltage DD f CPU clock frequency CPU Figure 52. f Maximum operating frequency versus V CPU f [MHz] CPU 8 ...

Page 94

ST7LITE2 13.3.2 Operating conditions with Low Voltage Detector (LVD -40 to 85°C, unless otherwise specified A Symbol Parameter Reset release threshold V IT+ (LVD) (V rise) DD Reset generation threshold V (LVD) IT- (V fall LVD ...

Page 95

OPERATING CONDITIONS (Cont’d) The RC oscillator and PLL characteristics are temperature-dependent and are grouped in four tables. 13.3.4.1 RC oscillator and PLL characteristics (tested for T Symbol Parameter Internal RC oscillator fre quency Accuracy of Internal ...

Page 96

ST7LITE2 OPERATING CONDITIONS (Cont’d) 13.3.4.2 RC oscillator and PLL characteristics (tested for T Symbol Parameter Internal RC oscillator fre quency Accuracy of Internal RC ACC oscillator when calibrated RC with RCCR=RCCR1 RC oscillator current con- I ...

Page 97

OPERATING CONDITIONS (Cont’d) Figure 53. RC Osc Freq vs V (Calibrated with RCCR1 25°C) 1.00 0.90 0.80 0.70 0.60 0.50 2.4 2.6 2.8 3 3.2 VDD (V) Figure 55. Typical RC oscillator Accuracy vs temperature @ V =5V ...

Page 98

ST7LITE2 OPERATING CONDITIONS (Cont’d) Figure 57. PLL ∆f /f versus time CPU CPU ∆f /f CPU CPU Max 0 Min Figure 58. PLLx4 Output vs CLKIN frequency 7.00 6.00 5.00 4.00 3.00 2.00 1.00 1 1.5 2 External Input Clock ...

Page 99

SUPPLY CURRENT CHARACTERISTICS The following current consumption specified for the ST7 functional operating modes over tempera- ture range does not take into account the clock source current consumption. To get the total de- 13.4.1 Supply Current T = -40 ...

Page 100

ST7LITE2 SUPPLY CURRENT CHARACTERISITCS (Cont’d) Figure 62. Typical I in WAIT vs 4.5 4.0 8Mhz 3.5 4Mhz 3.0 2.5 1MHz 2.0 1.5 1.0 0.5 0.0 2.0 2.5 3.0 3.5 4.0 Vdd (V) Figure 63. Typical I in SLOW-WAIT ...

Page 101

CLOCK AND TIMING CHARACTERISTICS Subject to general operating conditions for V 13.5.1 General Timings Symbol Parameter t Instruction cycle time c(INST) Interrupt reaction time t = ∆t v(IT v(IT) c(INST) Notes: 1. Guaranteed by Design. Not ...

Page 102

ST7LITE2 CLOCK AND TIMING CHARACTERISTICS (Cont’d) 13.5.3 Crystal and Ceramic Resonator Oscillators The ST7 internal clock can be supplied with eight different Crystal/Ceramic resonator oscillators. All the information given in this paragraph are based on characterization results with specified typical ...

Page 103

MEMORY CHARACTERISTICS T = -40°C to 85°C, unless otherwise specified A 13.6.1 RAM and Hardware Registers Symbol Parameter V Data retention mode RM 13.6.2 FLASH Program Memory Symbol Parameter V Operating voltage for Flash write/erase DD Programming time for ...

Page 104

ST7LITE2 13.7 EMC CHARACTERISTICS Susceptibility tests are performed on a sample ba- sis during product characterization. 13.7.1 Functional EMS (Electro Magnetic Susceptibility) Based on a simple running application on the product (toggling 2 LEDs through I/O ports), the product is ...

Page 105

... Dynamic latch-up class Note: 1. Class description: A Class is an STMicroelectronics internal specification. All its limits are higher than the JEDEC spec- ifications, that means when a device belongs to Class A it exceeds the JEDEC standard. B Class strictly covers all the JEDEC criteria (international standard). ...

Page 106

ST7LITE2 13.8 I/O PORT PIN CHARACTERISTICS 13.8.1 General Characteristics Subject to general operating conditions for V Symbol Parameter V Input low level voltage IL V Input high level voltage IH Schmitt trigger voltage V 1) hys hysteresis I Input leakage ...

Page 107

I/O PORT PIN CHARACTERISTICS (Cont’d) 13.8.2 Output Driving Current Subject to general operating conditions for V Symbol Parameter Output low level voltage for a standard I/O pin when 8 pins are sunk at same time (see Figure 72 ...

Page 108

ST7LITE2 I/O PORT PIN CHARACTERISTICS (Cont’d) Figure 71. Typical 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 0. lio (mA) Figure 73. Typical 1.00 0.90 0.80 0.70 0.60 0.50 0.40 ...

Page 109

I/O PORT PIN CHARACTERISTICS (Cont’d) Figure 76. Typical 1.60 1.40 1.20 1.00 0.80 0.60 0.40 0.20 0.00 -0.01 -1 lio (mA) Figure 77. Typical 1.20 1.00 0.80 0.60 0.40 0.20 0.00 -0.01 ...

Page 110

ST7LITE2 I/O PORT PIN CHARACTERISTICS (Cont’d) Figure 81. Typical V vs 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 2.4 2.7 VDD (V) Figure 82. Typical V vs 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 ...

Page 111

CONTROL PIN CHARACTERISTICS 13.9.1 Asynchronous RESET Pin T = -40°C to 85°C, unless otherwise specified A Symbol Parameter V Input low level voltage IL V Input high level voltage IH V Schmitt trigger voltage hysteresis hys V Output low ...

Page 112

ST7LITE2 CONTROL PIN CHARACTERISTICS (Cont’d) Figure 84. RESET pin protection when LVD is enabled. Required EXTERNAL RESET 0.01µF Figure 85. RESET pin protection when LVD is disabled. USER EXTERNAL RESET CIRCUIT 0.01µF Required Note 1: – The reset network protects ...

Page 113

COMMUNICATION INTERFACE CHARACTERISTICS 13.10.1 SPI - Serial Peripheral Interface Subject to general operating conditions for and T unless otherwise specified. OSC A Symbol Parameter f SCK = SPI clock frequency 1/t c(SCK) t r(SCK) SPI clock ...

Page 114

ST7LITE2 COMMUNICATION INTERFACE CHARACTERISTICS (Cont’d) Figure 87. SPI Slave Timing Diagram with CPHA=1 SS INPUT t su(SS) CPHA=0 CPOL=0 CPHA=0 CPOL=1 t w(SCKH) t a(SO) t w(SCKL) see MISO OUTPUT HZ note 2 t MOSI INPUT Figure 88. SPI Master ...

Page 115

ADC CHARACTERISTICS Subject to general operating condition for V Symbol Parameter f ADC clock frequency ADC V Conversion voltage range AIN R External input resistor AIN C Internal sample and hold capacitor ADC t Stabilization time after ADC ...

Page 116

ST7LITE2 ADC CHARACTERISTICS (Cont’d) ADC Accuracy with V =5.0V DD Symbol Parameter |E | Total unadjusted error Offset error Gain Error Differential linearity error Integral linearity ...

Page 117

ADC CHARACTERISTICS (Cont’d) Figure 91. ADC Accuracy Characteristics with amplifier enabled Digital Result ADCDR 704 V V – DD 1LSB = ------------------------------- - IDEAL 1024 LSB 108 62.5mV Note: ...

Page 118

ST7LITE2 ADC CHARACTERISTICS (Cont’d) Symbol Parameter V Amplifier operating voltage DD(AMP) V Amplifier input voltage IN V Amplifier output offset voltage OFFSET V Step size for monotonicity STEP Output Voltage Response Linearity Gain factor Amplified Analog input Gain Vmax Output ...

Page 119

PACKAGE CHARACTERISTICS 14.1 PACKAGE MECHANICAL DATA Figure 92. 20-Pin Plastic Small Outline Package, 300-mil Width Figure 93. 20-Pin Plastic Dual In-Line Package, 300-mil Width ...

Page 120

ST7LITE2 PACKAGE CHARACTERISTICS (Cont’d) Table 21. THERMAL CHARACTERISTICS Symbol Package thermal resistance R thJA (junction to ambient) T Maximum junction temperature Jmax P Power dissipation Dmax Notes: 1. The maximum chip-junction temperature is based on technology characteristics. 2. The maximum ...

Page 121

... SOLDERING INFORMATION In accordance with the RoHS European directive, all STMicroelectronics packages have been con- verted to lead-free technology, named ECO- TM PACK . TM ECOPACK packages are qualified according ■ to the JEDEC STD-020C compliant soldering profile. Detailed information on the STMicroelectronics ■ TM ECOPACK transition program is available on www ...

Page 122

ST7LITE2 15 DEVICE CONFIGURATION Each device is available for production in user pro- grammable versions (FLASH) as well as in factory coded versions (FASTROM). ST7FLITE2 devices are ST7PLITE2 devices are Factory Advanced Serv- ice Technique ROM (FASTROM) versions: they are ...

Page 123

OPTION BYTES (Cont’d) OPTION BYTE 1 OPT7 = PLLx4x8 PLL Factor selection. 0: PLLx4 1: PLLx8 OPT6 = PLLOFF PLL disable. 0: PLL enabled 1: PLL disabled (by-passed) OPT5 = PLL32OFF 32MHz PLL disable. 0: PLL32 enabled 1: PLL32 disabled ...

Page 124

... OPTION LIST append page 125. Refer to application note AN1635 for information on the counter listing returned by ST after code has been transferred. The STMicroelectronics Sales Organization will be pleased to provide detailed information on con- tractual points. Data RAM EEPROM (Bytes) ...

Page 125

... Reference/FASTROM Code *FASTROM code name is assigned by STMicroelectronics. FASTROM code must be sent in .S19 format. .Hex extension cannot be processed. ...

Page 126

... ST7LITE2 15.3 DEVELOPMENT TOOLS STMicroelectronics offers a range of hardware and software development tools for the ST7 micro- controller family. Full details of tools available for the ST7 from third party manufacturers can be ob- tained from the STMicroelectronics Internet site: http//www.st.com. Tools from these manufacturers include C compli- ers, evaluation tools, emulators and programmers ...

Page 127

ST7 APPLICATION NOTES Table 27. ST7 Application Notes IDENTIFICATION DESCRIPTION APPLICATION EXAMPLES AN1658 SERIAL NUMBERING IMPLEMENTATION AN1720 MANAGING THE READ-OUT PROTECTION IN FLASH MICROCONTROLLERS AN1755 A HIGH RESOLUTION/PRECISION THERMOMETER USING ST7 AND NE555 AN1756 CHOOSING A DALI IMPLEMENTATION STRATEGY ...

Page 128

ST7LITE2 Table 27. ST7 Application Notes IDENTIFICATION DESCRIPTION AN1947 ST7MC PMAC SINE WAVE MOTOR CONTROL SOFTWARE LIBRARY GENERAL PURPOSE AN1476 LOW COST POWER SUPPLY FOR HOME APPLIANCES AN1526 ST7FLITE0 QUICK REFERENCE NOTE AN1709 EMC DESIGN FOR ST MICROCONTROLLERS AN1752 ST72324 ...

Page 129

Table 27. ST7 Application Notes IDENTIFICATION DESCRIPTION AN1039 ST7 MATH UTILITY ROUTINES AN1064 WRITING OPTIMIZED HIWARE C LANGUAGE FOR ST7 AN1071 HALF DUPLEX USB-TO-SERIAL BRIDGE USING THE ST72611 USB MICROCONTROLLER AN1106 TRANSLATING ASSEMBLY CODE FROM HC05 TO ST7 PROGRAMMING ST7 ...

Page 130

ST7LITE2 16 IMPORTANT NOTES 16.1 EXECUTION OF BTJX INSTRUCTION When testing the address $FF with the "BTJT" or "BTJF" instructions, the CPU may perform an in- correct operation when the relative jump is nega- tive and performs an address page ...

Page 131

REVISION HISTORY Table 28. Revision History Date Revision Updated Added data for Fcpu @ 1MHz into EnabledProgramming Capability for EMU3, Reset delay in Altered note 1 for Removed sentence relating to an effective change only after overflow for CK[1:0], ...

Page 132

ST7LITE2 Date Revision Added 300K read/write cycles for EEPROM on first page Updated Added note 2 in “EXTERNAL INTERRUPT CONTROL REGISTER (EICR)” on page 36 and changed “External Interrupt Function” on page 46 Modified read operation section in “MEMORY ACCESS” ...

Page 133

... 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. ...

Related keywords