put compares, external clock input on one timer, PWM and pulse generator modes
– 8-bit PWM Auto-reload timer with: 2 input cap-
tures, 4 PWM outputs, output compare and
time base interrupt, external clock with event
detector
■ 3 Communication interfaces
– SPI synchronous serial interface
– SCI asynchronous serial interface
2
C multimaster interface
–I
■ 1 Analog peripheral (low current coupling)
– 10-bit ADC with up to 16 robust input ports
■ Instruction set
– 8-bit Data Manipulation
– 63 Basic Instructions
– 17 main Addressing Modes
– 8 x 8 Unsigned Multiply Instruction
■ Development tools
– Full hardware/software development package
– DM (Debug module)
2
C interface
Table 1. Device summary
Features
Program memory - bytesFlash/ROM 16KFlash/ROM 32KFlash 48KFlash 60K
RAM (stack) - bytes512 (256)1024(256)1536 (256)2048(256)
Operating Voltage3.8V to 5.5V
Temp. Range up to -40°C to +125°C
ROM devices have up to 32 Kbytes of program memory and up to 1 Kbyte of RAM.
DEBUG MODULE
1 DESCRIPTION
The ST72F325 Flash and ST72325 ROM devices
are members of the ST7 microcontroller family designed for mid-range applications.
They are derivatives of the ST72321 and ST72324
devices, with enhanced characteristics and robust
Clock Security System.
All devices are based on a common industrystandard 8-bit core, featuring an enhanced instruction set and are available with Flash or ROM program memory. The ST7 family architecture offers
both power and flexibility to software developers,
enabling the design of highly efficient and compact
application code.
The on-chip peripherals include an A/D converter,
a PWM Autoreload timer, 2 general purpose tim-
2
C bus, SPI interface and an SCI interface.
ers, I
For power economy, microcontroller can switch
dynamically into WAIT, SLOW, ACTIVE-HALT or
Figure 1. Device Block Diagram
HALT mode when the application is in idle or
stand-by state.
Typical applications are consumer, home, office
and industrial products.
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
ICC Protocol Reference Manual.
Main Differences with ST72321:
– LQFP48 and LQFP32 packages
– Clock Security System
– Internal RC, Readout protection, LVD and PLL
without limitations
– Negative current injection not allowed on I/O port
– Output: OD = open drain
Refer to “I/O PORTS” on page 50 for more details on the software configuration of the I/O ports.
The RESET configuration of each pin is shown in bold. This configuration is valid as long as the device is
in reset state.
= Pin not connected in ST72325S devices
Table 2. LQFP64/48/44 and SDIP42 Device Pin Descriptions
139972PD0/AIN0I/OC
14 19 1083PD1/AIN1I/O C
15 11 1194PD2/AIN2I/O C
16 12 12 105PD3/AIN3I/O C
T
T
T
T
T
T
T
T
T
T
Xei2XX Port B1PWM Output 2
Xei2XX Port B2PWM Output 1
Xei2XX Port B3PWM Output 0
HS Xei3XX Port B4
Xei3XX Port B5
Xei3XX Port B6
PWM-ART External
Clock
PWM-ART Input Capture 1
PWM-ART Input Capture 2
X XX XX Port D0 ADC Analog Input 0
X XX XX Port D1 ADC Analog Input 1
X XX XX Port D2 ADC Analog Input 2
X XX XX Port D3 ADC Analog Input 3
12/197
ST72325xx
Pin n°
Pin Name
Type
LQFP64
LQFP48S
LQFP48C
SDIP42
LQFP44
17 13 13 116PD4/AIN4I/O C
18 14 14 127PD5/AIN5I/O C
4)
19 20 -
21 15 15 138V
22 16 16 149V
23----V
24----V
---PD6/AIN6I/O C
4)
---PD7/AIN7I/O C
6)
AREF
6)
SSA
6)
DD_3
6)
SS_3
I
SAnalog Ground Voltage
SDigital Main Supply Voltage
SDigital Ground Voltage
25 17 17 15 10 PF0/MCO/AIN8I/O C
26 18 18 16 11 PF1 (HS)/BEEPI/O C
27 19 19 17 12 PF2 (HS)I/O C
4)
28 -
---
29 20 20 18 13
4)
30 -
---
PF3/OCMP2_A/
AIN9
PF4/OCMP1_A/
AIN10
PF5/ICAP2_A/
AIN11
I/O C
I/O C
I/O C
31 21 21 19 14 PF6 (HS)/ICAP1_A I/O C
32 22 22 20 15
33 23 23 21-V
34 24 24 22-V
35 25 25 23 16
36 26 26 24 17
PF7 (HS)/
EXTCLK_A
6)
DD_0
6)
SS_0
PC0/OCMP2_B/
AIN12
PC1/OCMP1_B/
AIN13
I/O C
SDigital Main Supply Voltage
SDigital Ground Voltage
I/O C
I/O C
37 27 27 25 18 PC2 (HS)/ICAP2_B I/O C
38 28 28 26 19 PC3 (HS)/ICAP1_B I/O C
39 29 29 27 20
PC4/MISO/ICCDATA
I/O C
40 30 30 28 21 PC5/MOSI/AIN14I/O C
41 31 31 29 22 PC6/SCK/ICCCLKI/O C
LevelPort
InputOutput
Input
Output
T
T
T
T
X XX XX Port D4 ADC Analog Input 4
X XX XX Port D5 ADC Analog Input 5
X XX XX Port D6 ADC Analog Input 6
X XX XX Port D7 ADC Analog Input 7
float
int
wpu
ana
OD
Main
function
(after
reset)
PP
Alternate function
Analog Reference Voltage for
ADC
/2)
ADC Analog
Input 8
ADC Analog
Input 9
ADC Analog
Input 10
ADC Analog
Input 11
ADC Analog
Input 12
ADC Analog
Input 13
ICC Data
Input
ADC Analog
Input 14
ICC Clock
Output
T
T
T
Xei1XXX Port F0
HS Xei1XX Port F1Beep signal output
HS Xei1XX Port F2
Main clock
out (f
OSC
Timer A
T
X XXXXPort F3
Output
Compare 2
Timer A
T
X XXXXPort F4
Output
Compare 1
Timer A In-
T
X XXXXPort F5
put Capture 2
HS X XXXPort F6Timer A Input Capture 1
T
HS X XXXPort F7
T
Timer A External Clock
Source
Timer B
T
X XXXXPort C0
Output
Compare 2
Timer B
T
X XXXXPort C1
Output
Compare 1
HS X XXXPort C2 Timer B Input Capture 2
T
HS X XXXPort C3 Timer B Input Capture 1
T
SPI Master
T
X XXXPort C4
In / Slave
Out Data
SPI Master
T
X XXXXPort C5
Out / Slave
In Data
T
X XXXPort C6
SPI Serial
Clock
13/197
ST72325xx
LQFP64
Pin n°
LQFP48S
LQFP48C
Pin Name
SDIP42
LQFP44
LevelPort
Type
Input
Output
float
InputOutput
int
OD
ana
wpu
Main
function
(after
reset)
PP
Alternate function
SPI Slave
42 32 32 30 23 PC7/SS/AIN15I/O C
T
X XXXXPort C7
Select (active low)
4)
43 44 45 33---PA2I/O C
46 34 34 31 24 PA3 (HS)I/O C
47 35 35 32 25 V
48 36 36 33 26 V
49 37 37 34 27 PA4 (HS)I/O C
50 38 38 35 28 PA5 (HS)I/O C
51 39 39 36 29 PA6 (HS)/SDAI I/O C
52 40 40 37 30 PA7 (HS)/SCLII/O CTHS XTPort A7 I
---PA0I/OCTXei0XX Port A0
4)
---PA1I/OCTXei0XX Port A1
Xei0XX Port A2
HS Xei0XX Port A3
HS X XXXPort A4
HS X XXXPort A5
HS XTPort A6 I
DD_1
SS_1
T
6)
6)
T
SDigital Main Supply Voltage
SDigital Ground Voltage
T
T
T
2
C Data
2
C Clock
1)
1)
Must be tied low. In flash programming mode, this pin acts as the
53 41 41 38 31 VPP/ ICCSELI
programming voltage input V
See Section 12.9.2 for more details. High voltage must not be applied to ROM devices
54 42 42 39 32 RESET
I/O C
T
Top priority non maskable inter-
rupt.
55----EVDExternal voltage detector
56----TLIIC
57 43 43 40 33 V
58 44 44 41 34 OSC2
59 45 45 42 35 OSC1
60 46 46 43 36 V
SS_2
DD_2
6)
3)
3)
6)
61 47 47 44 37 PE0/TDOI/O C
62 48 48138 PE1/RDII/O C
631---PE2 I/O C
4)
64 -
---PE3I/OCTX XXXPort E3
T
SDigital Ground Voltage
I/O
I
SDigital Main Supply Voltage
T
T
T
XTop level interrupt input pin
Resonator oscillator inverter out-
put
External clock input or Resonator
oscillator inverter input
X XXXPort E0 SCI Transmit Data Out
X XXXPort E1 SCI Receive Data In
X XX
4)X4)
Port E2
ADC Analog
Input 15
.
PP
14/197
Table 3. LQFP32/DIP32 Device Pin Description
ST72325xx
Pin n°
Pin Name
DIP32
LQFP32
14V
25V
AREF
SSA
6)
6)
36PF0/MCO/AIN8I/O C
47PF1 (HS)/BEEPI/O C
58
PF4/OCMP1_A/
AIN10
69PF6 (HS)/ICAP1_A I/O C
710
811
912
PF7 (HS)/
EXTCLK_A
PC0/OCMP2_B/
AIN12
PC1/OCMP1_B/
AIN13
10 13 PC2 (HS)/ICAP2_B I/O C
11 14 PC3 (HS)/ICAP1_B I/O C
12 15
PC4/MISO/ICCDA-
TA
13 16 PC5/MOSI/AIN14I/O C
14 17 PC6/SCK/ICCCLKI/O C
15 18 PC7/SS
/AIN15I/O C
16 19 PA3 (HS)I/O C
17 20 PA4 (HS)I/O C
18 21 PA6 (HS)/SDAI I/O C
19 22 PA7 (HS)/SCLII/O CTHSXTPort A7 I
LevelPort
Type
Input
Output
float
InputOutput
wpu
int
ana
OD
function
(after
reset)
PP
Main
Alternate function
IAnalog Reference Voltage for ADC
SAnalog Ground Voltage
Main clock out
/2)
(f
OSC
Timer A Output
Compare 1
Timer B Output
Compare 2
Timer B Output
Compare 1
SPI Master In /
Slave Out Data
SPI Master Out /
Slave In Data
SPI Slave Select
(active low)
2
C Data
2
C Clock
I/O C
I/O C
I/O C
I/O C
I/O C
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
T
Xei1XXXPort F0
HSXei1XXPort F1Beep signal output
XXXXXPort F4
HSXXXXPort F6Timer A Input Capture 1
HSXXXXPort F7Timer A External Clock Source
XXXXXPort C0
XXXXXPort C1
HSXXXXPort C2 Timer B Input Capture 2
HSXXXXPort C3 Timer B Input Capture 1
XXXXPort C4
XXXXXPort C5
XXXXPort C6 SPI Serial Clock
XXXXXPort C7
HSXei0XXPort A3
HSXXXXPort A4
HSXTPort A6 I
Must be tied low. In flash programming
mode, this pin acts as the programming
20 23 VPP/ ICCSELI
voltage input VPP. See Section 12.9.2 for
more details. High voltage must not be ap-
plied to ROM devices
21 24 RESET
22 25 V
SS_2
23 26 OSC2
24 27 OSC1
25 28 V
DD_2
6)
3)
3)
6)
I/O C
SDigital Ground Voltage
I/OResonator oscillator inverter output
I
SDigital Main Supply Voltage
26 29 PE0/TDOI/O C
27 30 PE1/RDII/O C
T
T
T
XXXXPort E0SCI Transmit Data Out
XXXXPort E1SCI Receive Data In
Top priority non maskable interrupt.
External clock input or Resonator oscillator
inverter input
ADC Analog
Input 8
ADC Analog
Input 10
ADC Analog
Input 12
ADC Analog
Input 13
ICC Data Input
ADC Analog
Input 14
ICC Clock
Output
ADC Analog
Input 15
1)
1)
15/197
ST72325xx
Pin n°
Pin Name
DIP32
LQFP32
28 31 PB0/PWM3I/O C
29 32 PB3/PWM0I/O C
301PB4 (HS)/ARTCLKI/O C
312PD0/AIN0I/O C
323PD1/AIN1I/O C
LevelPort
Type
Input
Output
float
T
T
T
T
T
Xei2XXPort B0
Xei2XXPort B3PWM Output 0
HSXei3XXPort B4 PWM-ART External Clock
XXXXXPort D0 ADC Analog Input 0
XXXXXPort D1 ADC Analog Input 1
InputOutput
wpu
int
ana
OD
function
(after
reset)
PP
Main
Alternate function
PWM Output 3
Caution: Negative current injec-
tion not allowed on this pin
Notes for Table 2 and Table 3:
1. In the interrupt input column, “eiX” defines the associated external interrupt vector. If the weak pull-up
column (wpu) is merged with the interrupt column (int), then the I/O configuration is pull-up interrupt input,
else the configuration is floating interrupt input.
2. In the open drain output column, “T” defines a true open drain I/O (P-Buffer and protection diode to V
are not implemented). See See “I/O PORTS” on page 50. and Section 12.8 I/O PORT PIN CHARACTER-
DD
ISTICS for more details.
3. OSC1 and OSC2 pins connect a crystal/ceramic resonator, or an external source to the on-chip oscillator; see Section 1 DESCRIPTION and Section 12.5 CLOCK AND TIMING CHARACTERISTICS for
more details.
4. On the chip, each I/O port may have up to 8 pads:
– In all devices except 48-pin ST72325C, pads that are not bonded to external pins are forced by hardware
in input pull-up configuration after reset. The configuration of these pads must be kept at reset state to
avoid added current consumption.
PF3 and PF5) are in input floating configuration after reset. To avoid added current consumption, the
application must force these ports in input pull-up state by writing to the OR and DDR registers after reset. This initialization is not necessary in 48-pin ST72325S devices.
5.Pull-up always activated on PE2 see limitation Section 15.1.8.
6. It is mandatory to connect all available V
pins to ground.
DD
and V
pins to the supply voltage and all VSS and V
REF
SSA
16/197
3 REGISTER & MEMORY MAP
0000h
RAM
Program Memory
(60,48, 32 or 16K)
Interrupt & Reset Vectors
HW Registers
0080h
007Fh
0FFFh
(see Table 4)
1000h
FFDFh
FFE0h
FFFFh
(see Table 9)
0880h
Reserved
087Fh
Short Addressing
RAM (zero page)
256 Bytes Stack
16-bit Addressing
RAM
0100h
01FFh
027Fh
0080h
0200h
00FFh
32 KBytes
8000h
FFFFh
(2048, 1536, 1024,
or 047Fh
16 KBytes
C000h
or 512 Bytes)
60 KBytes
48 KBytes
1000h
4000h
or 087Fh
or 067Fh
ST72325xx
As shown in Figure 6, 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, up to 2Kbytes of RAM
and up to 60Kbytes of user program memory. The
RAM space includes up to 256 bytes for the stack
from 0100h to 01FFh.
The highest address bytes contain the user reset
and interrupt vectors.
Figure 6. Memory Map
IMPORTANT: Memory locations marked as “Re-
served” must never be accessed. Accessing a reseved area can have unpredictable effects on the
device.
Related Documentation
AN 985: Executing Code in ST7 RAM
17/197
ST72325xx
Table 4. Hardware Register Map
AddressBlock
0000h
0001h
Port A
0002h
0003h
0004h
Port B
0005h
0006h
0007h
Port C
0008h
0009h
000Ah
Port D
000Bh
000Ch
000Dh
Port E
000Eh
000Fh
0010h
Port F
0011h
0018h
0019h
001Ah
001Bh
2
C
I
001Ch
001Dh
001Eh
Register
Label
PADR
PADDR
PAOR
PBDR
PBDDR
PBOR
PCDR
PCDDR
PCOR
PDDR
PDDDR
PDOR
PEDR
PEDDR
PEOR
PFDR
PFDDR
PFOR
I2CCR
I2CSR1
I2CSR2
I2CCCR
I2COAR1
I2COAR2
I2CDR
Register Name
Port A Data Register
Port A Data Direction Register
Port A Option Register
Port B Data Register
Port B Data Direction Register
Port B Option Register
Port C Data Register
Port C Data Direction Register
Port C Option Register
Port D Data Register
Port D Data Direction Register
Port D Option Register
Port E Data Register
Port E Data Direction Register
Port E Option Register
Port F Data Register
Port F Data Direction Register
Port F Option Register
2
I
C Control Register
2
C Status Register 1
I
2
C Status Register 2
I
2
C Clock Control Register
I
2
C Own Address Register 1
I
2
C Own Address Register2
I
2
C Data Register
I
Reset
Status
1)
00h
00h
00h
1)
00h
00h
00h
1)
00h
00h
00h
1)
00h
00h
00h
1)
00h
00h
00h
1)
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
Remarks
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
2)
R/W
2)
R/W
R/W
R/W
R/W
R/W
Read Only
Read Only
R/W
R/W
R/W
R/W
001Fh
0020h
0021h
0022h
0023h
0024h
0025h
0026h
0027h
SPI
ITC
SPIDR
SPICR
SPICSR
ISPR0
ISPR1
ISPR2
ISPR3
Reserved Area (2 Bytes)
SPI Data I/O Register
SPI Control Register
SPI Control/Status Register
Main Clock Control / Status Register
Main Clock Controller: Beep Control Register
Reserved Area (3 Bytes)
Timer A Control Register 2
Timer A Control Register 1
Timer A Control/Status Register
Timer A Input Capture 1 High Register
Timer A Input Capture 1 Low Register
Timer A Output Compare 1 High Register
Timer A Output Compare 1 Low Register
Timer A Counter High Register
Timer A Counter Low Register
Timer A Alternate Counter High Register
Timer A Alternate Counter Low Register
Timer A Input Capture 2 High Register
Timer A Input Capture 2 Low Register
Timer A Output Compare 2 High Register
Timer A Output Compare 2 Low Register
Reset
Status
00h
00h
00h
00h
xxxx x0xx b
xxh
xxh
80h
00h
FFh
FCh
FFh
FCh
xxh
xxh
80h
00h
Remarks
R/W
R/W
R/W
R/W
R/W
Read Only
Read Only
R/W
R/W
Read Only
Read Only
Read Only
Read Only
Read Only
Read Only
R/W
R/W
Timer B Control Register 2
Timer B Control Register 1
Timer B Control/Status Register
Timer B Input Capture 1 High Register
Timer B Input Capture 1 Low Register
Timer B Output Compare 1 High Register
Timer B Output Compare 1 Low Register
Timer B Counter High Register
Timer B Counter Low Register
Timer B Alternate Counter High Register
Timer B Alternate Counter Low Register
Timer B Input Capture 2 High Register
Timer B Input Capture 2 Low Register
Timer B Output Compare 2 High Register
Timer B Output Compare 2 Low Register
SCI Status Register
SCI Data Register
SCI Baud Rate Register
SCI Control Register 1
SCI Control Register 2
SCI Extended Receive Prescaler Register
Reserved area
SCI Extended Transmit Prescaler Register
00h
00h
xxxx x0xx b
xxh
xxh
80h
00h
FFh
FCh
FFh
FCh
xxh
xxh
80h
00h
C0h
xxh
00h
x000 0000b
00h
00h
---
00h
R/W
R/W
R/W
Read Only
Read Only
R/W
R/W
Read Only
Read Only
Read Only
Read Only
Read Only
Read Only
R/W
R/W
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
Reserved Area (18 Bytes)
Control/Status Register
Data High Register
Data Low Register
PWM AR Timer Duty Cycle Register 3
PWM AR Timer Duty Cycle Register 2
PWM AR Timer Duty Cycle Register 1
PWM AR Timer Duty Cycle Register 0
PWM AR Timer Control Register
Auto-Reload Timer Control/Status Register
Auto-Reload Timer Counter Access Register
Auto-Reload Timer Auto-Reload Register
AR Timer Input Capture Control/Status Reg.
AR Timer Input Capture Register 1
AR Timer Input Capture Register 1
Reset
Status
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
00h
Remarks
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Read Only
Read Only
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Read Only
Read Only
007Eh
007Fh
Reserved Area (2 Bytes)
Legend: x=undefined, R/W=read/write
Notes:
1. 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.
2. The bits associated with unavailable pins must always keep their reset value.
3. For a description of the Debug Module registers, see ICC Protocol Reference manual.
20/197
4 FLASH PROGRAM MEMORY
4 Kbytes
4 Kbytes
2Kbytes
SECTOR 1
SECTOR 0
16 Kbytes
SECTOR 2
8K16K32K60K
FLASH
FFFFh
EFFFh
DFFFh
3FFFh
7FFFh
1000h
24 Kbytes
MEMORY SIZE
8Kbytes40 Kbytes
52 Kbytes
9FFFh
BFFFh
D7FFh
4K10K24K48K
ST72325xx
4.1 Introduction
The ST7 dual voltage High Density Flash
(HDFlash) is a non-volatile memory that can be
electrically erased as a single block or by individual sectors and programmed on a Byte-by-Byte basis using an external V
supply.
PP
The HDFlash devices can be programmed and
erased off-board (plugged in a programming tool)
or on-board using ICP (In-Circuit Programming) or
IAP (In-Application Programming).
The array matrix organisation allows each sector
to be erased and reprogrammed without affecting
other sectors.
4.2 Main Features
■ Three Flash programming modes:
– Insertion in a programming tool. In this mode,
all sectors including option bytes can be programmed or erased.
– ICP (In-Circuit Programming). In this mode, all
sectors including option bytes can be programmed or erased without removing the device from the application board.
– IAP (In-Application Programming) In this
mode, all sectors except Sector 0, can be programmed or erased without removing the device from the application board and while the
application is running.
■ ICT (In-Circuit Testing) for downloading and
executing user application test patterns in RAM
■ Read-out protection
■ Register Access Security System (RASS) to
prevent accidental programming or erasing
4.3 Structure
The Flash memory is organised in sectors and can
be used for both code and data storage.
Depending on the overall Flash memory size in the
microcontroller device, there are up to three user
sectors (see Table 5). Each of these sectors can
be erased independently to avoid unnecessary
erasing of the whole Flash memory when only a
partial erasing is required.
The first two sectors have a fixed size of 4 Kbytes
(see Figure 7). They are mapped in the upper part
of the ST7 addressing space so the reset and interrupt vectors are located in Sector 0 (F000hFFFFh).
Table 5. Sectors available in Flash devices
Flash Size (bytes)Available Sectors
4KSector 0
8KSectors 0,1
> 8KSectors 0,1, 2
4.3.1 Read-out Protection
Read-out 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.
In flash devices, this protection is removed by reprogramming the option. In this case, the entire
program memory is first automatically erased and
the device can be reprogrammed.
Read-out protection selection depends on the device type:
– 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.
Figure 7. Memory Map and Sector Address
21/197
ST72325xx
ICC CONNECTOR
ICCDATA
ICCCLK
RESET
V
DD
HE10 CONNECTOR TYPE
APPLICATION
POWER SUPPLY
1
246810
975 3
PROGRAMMING TOOL
ICC CONNECTOR
APPLICATION BOARD
ICC Cable
(See Note 3)
10kΩ
V
SS
ICCSEL/VPP
ST7
C
L2
C
L1
OSC1
OSC2
OPTIONAL
See Note 1
See Note 2
APPLICATION
RESET SOURCE
APPLICATION
I/O
(See Note 4)
FLASH PROGRAM MEMORY (Cont’d)
4.4 ICC Interface
ICC needs a minimum of 4 and up to 6 pins to be
connected to the programming tool (see Figure 8).
These pins are:
– RESET
–V
: device reset
: device power supply ground
SS
Figure 8. Typical ICC Interface
– ICCCLK: ICC output serial clock pin
– ICCDATA: ICC input/output serial data pin
– ICCSEL/V
: programming voltage
PP
– OSC1(or OSCIN): main clock input for exter-
nal source (optional)
: application board power supply (option-
–V
DD
al, see Figure 8, Note 3)
Notes:
1. 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 ICC 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 implemented in case another device forces the signal. Refer to the Programming
Tool documentation for recommended resistor values.
2. During the ICC session, the programming tool
must control the RESET
flicts between the programming tool and the application reset circuit if it drives more than 5mA at
high level (push pull output or pull-up resistor<1K).
A schottky diode can be used to isolate the application RESET circuit in this case. When using a
classical RC network with R>1K or a reset man-
22/197
pin. This can lead to con-
agement IC with open drain output and pull-up resistor>1K, no additional components are needed.
In all cases the user must ensure that no external
reset is generated by the application during the
ICC session.
3. The use of Pin 7 of the ICC 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.
4. Pin 9 has to be connected to the OSC1 or OSCIN pin of the ST7 when the clock is not available
in the application or if the selected clock option is
not programmed in the option byte. ST7 devices
with multi-oscillator capability need to have OSC2
grounded in this case.
FLASH PROGRAM MEMORY (Cont’d)
ST72325xx
4.5 ICP (In-Circuit Programming)
To perform ICP the microcontroller must be
switched to ICC (In-Circuit Communication) mode
by an external controller or programming tool.
Depending on the ICP code downloaded in RAM,
Flash memory programming can be fully customized (number of bytes to program, program locations, or selection serial communication interface
for downloading).
When using an STMicroelectronics or third-party
programming tool that supports ICP and the specific microcontroller device, the user needs only to
implement the ICP hardware interface on the application board (see Figure 8). For more details on
the pin locations, refer to the device pinout description.
4.6 IAP (In-Application Programming)
This mode uses a BootLoader program previously
stored in Sector 0 by the user (in ICP mode or by
plugging the device in a programming tool).
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.). For example, it is
possible to download code from the SPI, SCI, USB
or CAN interface and program it in the Flash. IAP
mode can be used to program any of the Flash
sectors except Sector 0, which is write/erase protected to allow recovery in case errors occur during the programming operation.
4.7 Related Documentation
For details on Flash programming and ICC protocol, refer to the ST7 Flash Programming Reference Manual and to the ST7 ICC Protocol Reference Manual
This register is reserved for use by Programming
Tool software. It controls the Flash programming
and erasing operations.
Figure 9. Flash Control/Status Register Address and Reset Value
Address
(Hex.)
0029h
Register
Label
FCSR
Reset Value00000000
76543210
23/197
ST72325xx
ACCUMULATOR
X INDEX REGISTER
Y INDEX REGISTER
STACK POINTER
CONDITION CODE REGISTER
PROGRAM COUNTER
70
1C1I1HI0NZ
RESET VALUE = RESET VECTOR @ FFFEh-FFFFh
70
70
70
0
7
158
PCH
PCL
15
8
70
RESET VALUE = STACK HIGHER ADDRESS
RESET VALUE =
1X11X1XX
RESET VALUE = XXh
RESET VALUE = XXh
RESET VALUE = XXh
X = Undefined Value
5 CENTRAL PROCESSING UNIT
5.1 INTRODUCTION
This CPU has a full 8-bit architecture and contains
six internal registers allowing efficient 8-bit data
manipulation.
5.2 MAIN FEATURES
■ Enable executing 63 basic instructions
■ Fast 8-bit by 8-bit multiply
■ 17 main addressing modes (with indirect
addressing mode)
■ Two 8-bit index registers
■ 16-bit stack pointer
■ Low power HALT and WAIT modes
■ Priority maskable hardware interrupts
■ Non-maskable software/hardware interrupts
Figure 10. CPU Registers
5.3 CPU REGISTERS
The six CPU registers shown in Figure 1 are not
present in the memory mapping and are accessed
by specific instructions.
Accumulator (A)
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.
Index Registers (X and Y)
These 8-bit registers are used to create effective
addresses or as 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.)
The Y register is not affected by the interrupt automatic procedures.
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).
24/197
CENTRAL PROCESSING UNIT (Cont’d)
Condition Code Register (CC)
Read/Write
Reset Value: 111x1xxx
70
Bit 1 = Z Zero.
This bit is set and cleared by hardware. This bit in-
dicates that the result of the last arithmetic, logical
or data manipulation is zero.
0: The result of the last operation is different from
zero.
11I1HI0NZ
C
1: The result of the last operation is zero.
This bit is accessed by the JREQ and JRNE test
The 8-bit Condition Code register contains the interrupt masksand four flags representative of the
result of the instruction just executed. This register
can also be handled by the PUSH and POP instructions.
These bits can be individually tested and/or controlled by specific instructions.
Arithmetic Management Bits
Bit 4 = H Half carry.
This bit is set by hardware when a carry occurs be-
tween bits 3 and 4 of the ALU during an ADD or
ADC instructions. 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 2 = N Negative.
This bit is set and cleared by hardware. It is repre-
sentative of the result sign of the last arithmetic,
logical or data manipulation. It’s a copy of the re-
th
sult 7
bit.
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.
instructions.
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.
Interrupt Management Bits
Bit 5,3 = I1, I0 Interrupt
The combination of the I1 and I0 bits gives the cur-
These two bits are set/cleared by hardware when
entering in interrupt. The loaded value is given by
the corresponding bits in the interrupt software priority registers (IxSPR). They can be also set/
cleared by software with the RIM, SIM, IRET,
HALT, WFI and PUSH/POP instructions.
See the interrupt management chapter for more
details.
The least significant byte of the Stack Pointer
(called S) can be directly accessed by a LD instruction.
Note: 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.
70
SP7SP6SP5SP4SP3SP2SP1
SP0
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 instruc-
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 2).
Since the stack is 256 bytes deep, the 8 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 SP7 to SP0 bits are set) which is the stack
tions. 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 2.
– When an interrupt is received, the SP is decre-
mented and the context is pushed on the stack.
– On return from interrupt, the SP is incremented
and the context is popped from the stack.
A subroutine call occupies two locations and an interrupt five locations in the stack area.
higher address.
Figure 11. Stack Manipulation Example
26/197
6 SUPPLY, RESET AND CLOCK MANAGEMENT
0
1
PLL OPTION BIT
PLL x 2
f
OSC2
/ 2
f
OSC
LOW VOLTAGE
DETECTOR
(LVD)
f
OSC2
AUXILIARY VOLTAGE
DETECTOR
(AVD)
MULTI-
OSCILLATOR
(MO)
OSC1
RESET
V
SS
EVD
V
DD
RESET SEQUENCE
MANAGER
(RSM)
CLOCK
FILTER
SAFE
OSC
CLOCK SECURITY SYSTEM
(CSS)
OSC2
MAIN CLOCK
CSS Interrupt Request
AVD Interrupt Request
CONTROLLER
PLL
SYSTEM INTEGRITY MANAGEMENT
WATCHDOG
SICSR
TIMER (WDG)
WITH REALTIME
CLOCK (MCC/RTC)
AVD
AVD AVD
LVD
RF
CSS
IE
IE
CSS
D
WDG
RF
0
1
f
OSC
f
OSC2
(option)
0
S
F
f
CPU
ST72325xx
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. An
overview is shown in Figure 13.
For more details, refer to dedicated parametric
section.
– Main supply Low voltage detection (LVD)
– Auxiliary Voltage detector (AVD) with interrupt
capability for monitoring the main supply
– Clock Security System (CSS) with Clock Filter
and Backup Safe Oscillator (enabled by option byte)
Figure 13. Clock, Reset and Supply Block Diagram
6.1 PHASE LOCKED LOOP
If the clock frequency input to the PLL is in the
range 2 to 4 MHz, the PLL can be used to multiply
the frequency by two to obtain an f
OSC2
of 4 to 8
MHz. The PLL is enabled by option byte. If the PLL
is disabled, then f
OSC2 = fOSC
/2.
Caution: The PLL is not recommended for applications where timing accuracy is required. See
“PLL Characteristics” on page 154.
Figure 12. PLL Block Diagram
27/197
ST72325xx
OSC1OSC2
EXTERNAL
ST7
SOURCE
OSC1OSC2
LOAD
CAPACITORS
ST7
C
L2
C
L1
OSC1OSC2
ST7
6.2 MULTI-OSCILLATOR (MO)
The main clock of the ST7 can be generated by
three different source types coming from the multioscillator block:
■ an external source
■ 4 crystal or ceramic resonator oscillators
■ an internal high frequency RC oscillator
Each oscillator is optimized for a given frequency
range in terms of consumption and is selectable
through the option byte. The associated hardware
configurations are shown in Table 6. Refer to the
electrical characteristics section for more details.
External Clock Source
In this external clock mode, a clock signal (square,
sinus or triangle) with ~50% duty cycle has to drive
the OSC1 pin while the OSC2 pin is tied to ground.
Crystal/Ceramic Oscillators
This family of oscillators has the advantage of producing a very accurate rate on the main clock of
the ST7. The selection within a list of 4 oscillators
with different frequency ranges has to be done by
option byte in order to reduce consumption (refer
to section 14.1 on page 181 for more details on the
frequency ranges). In this mode of the multi-oscillator, the resonator and the load capacitors have
to be placed as close as possible to the oscillator
pins in order to minimize output distortion and
start-up stabilization time. The loading capacitance values must be adjusted according to the
selected oscillator.
These oscillators are not stopped during the
RESET phase to avoid losing time in the oscillator
start-up phase.
Internal RC Oscillator
This oscillator allows a low cost solution for the
main clock of the ST7 using only an internal resistor and capacitor. Internal RC oscillator mode has
the drawback of a lower frequency accuracy and
should not be used in applications that require accurate timing.
In this mode, the two oscillator pins have to be tied
to ground.
The reset sequence manager includes three RESET sources as shown in Figure 15:
■ External RESET source pulse
■ Internal LVD RESET (Low Voltage Detection)
■ Internal WATCHDOG RESET
These sources act on the RESET
pin and it is al-
ways kept low during the delay phase.
The RESET service routine vector is fixed at ad-
dresses FFFEh-FFFFh in the ST7 memory map.
The basic RESET sequence consists of 3 phases
as shown in Figure 14:
■ Active Phase depending on the RESET source
■ 256 or 4096 CPU clock cycle delay (selected by
option byte)
■ RESET vector fetch
The 256 or 4096 CPU clock cycle delay allows the
oscillator to stabilise and ensures that recovery
has taken place from the Reset state. The shorter
or longer clock cycle delay should be selected by
option byte to correspond to the stabilization time
of the external oscillator used in the application
(see section 14.1 on page 181).
The RESET vector fetch phase duration is 2 clock
cycles.
Figure 14. RESET Sequence Phases
Caution: 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.
6.3.2 Asynchronous External RESET
The RESET
output with integrated R
pin is both an input and an open-drain
weak pull-up resistor.
ON
pin
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
“CONTROL PIN CHARACTERISTICS” on
page 162 for more details.
A RESET signal originating from an external
source must have a duration of at least t
h(RSTL)in
in
order to be recognized (see Figure 16). This detection is asynchronous and therefore the MCU
can enter reset state even in HALT mode.
Figure 15. Reset Block Diagram
29/197
ST72325xx
V
DD
RUN
RESET PIN
EXTERNAL
WATCHDOG
ACTIVE PHASE
V
IT+(LVD)
V
IT-(LVD)
t
h(RSTL)in
t
w(RSTL)out
RUN
t
h(RSTL)in
ACTIVE
WATCHDOG UNDERFLOW
t
w(RSTL)out
RUNRUNRUN
RESET
RESET
SOURCE
SHORT EXT.
RESET
LVD
RESET
LONG EXT.
RESET
WATCHDOG
RESET
INTERNAL RESET (256 or 4096 T
CPU
)
VECTOR FETCH
t
w(RSTL)out
PHASE
ACTIVE
PHASE
ACTIVE
PHASE
DELAY
RESET SEQUENCE MANAGER (Cont’d)
The RESET
plays a major role in EMS performance. In a noisy
environment, it is recommended to follow the
guidelines mentioned in the electrical characteristics section.
If the external RESET
t
w(RSTL)out
signal on the RESET
wise the delay will not be applied (see long ext.
Reset in Figure 16). Starting from the external RESET pulse recognition, the device RESET
as an output that is pulled low during at least
t
w(RSTL)out
6.3.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 V
level specified for the selected f
(see “OPERATING CONDITIONS” on page 144)
Figure 16. RESET Sequences
pin is an asynchronous signal which
pulse is shorter than
(see short ext. Reset in Figure 16), the
pin may be stretched. Other-
pin acts
.
is over the minimum
DD
frequency.
OSC
A proper reset signal for a slow rising V
supply
DD
can generally be provided by an external RC network connected to the RESET
pin.
6.3.4 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
pulled low when V
V
DD<VIT-
(falling edge) as shown in Figure 16.
The LVD filters spikes on V
pin acts as an output that is
DD<VIT+
(rising edge) or
larger than t
DD
g(VDD)
to
avoid parasitic resets.
6.3.5 Internal Watchdog RESET
The RESET sequence generated by a internal
Watchdog counter overflow is shown in Figure 16.
Starting from the Watchdog counter underflow, the
device RESET
low during at least t
pin acts as an output that is pulled
w(RSTL)out
.
30/197
Loading...
+ 167 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.