ST7SCR
8-BIT LOW-POWER, FULL-SPEED USB MCU WITH 16K
FLASH, 768 RAM, SMARTCARD I/F, TIMER
■
■
■
■
■
Memories
– Up to 16K of ROM or High Density Flash (HD-
Flash) program memory with read/write pro-
tection, HDFlash In-Circuit and In-Application
Programming. 100 write/erase cycles guaran-
teed, data retention: 40 years at 55°C
– Up to 768 bytes of RAM including up to 128
bytes stack and 256 bytes USB buffer
Clock, Reset and Supply Management
– Low Voltage Reset
– 2 power saving modes: Halt and Wait modes
– PLL for generating 48 MHz USB clock using a
4 MHz crystal
Interrupt Management
– Nested Interrupt Controller
USB (Universal Serial Bus) Interface
– 256-byte buffer for full speed bulk, control and
interrupt transfer types compliant with USB
specification (version 2.0)
– On-Chip 3.3V USB voltage regulator and
transceivers with software power-down
– 7 USB Endpoints:
One 8-byte Bidirectional Control Endpoint
One 64-byte In Endpoint,
One 64-byte Out Endpoint
Four 8-byte In Endpoints
35 or 4 I/O ports
– Up to 4 LED outputs with software program-
mable constant current (3 or 7 mA).
– 2 General purpose I/Os programmable as in-
terrupts
– Up to 8 line inputs programmable as interrupts
– Up to 20 Outputs
– 1 line assigned by default as static input after
reset
ST7FSCR1T1
16K FLASH
ST7SCR1T1
16K ROM
LQFP64 14x14
■
SO24
QFN24
■
■
■
ISO7816-3 UART Interface
– 4 Mhz Clock generation
– Synchronous/Asynchronous protocols (T=0,
T=1)
– Automatic retry on parity error
– Programmable Baud rate from 372 clock puls-
es up to 11.625 clock pulses (D=32/F=372)
– Card Insertion/Removal Detection
Smartcard Power Supply
– Selectable card V
CC
1.8V, 3V, and 5V
– Internal Step-up converter for 5V supplied
Smartcards (with a current of up to 55mA) us-
ing only two external components.
– Programmable Smartcard Internal Voltage
Regulator (1.8V to 3.0V) with current overload
protection and 4 KV ESD protection (Human
Body Model) for all Smartcard Interface I/Os
One 8-bit Timer
– Time Base Unit (TBU) for generating periodic
interrupts.
Development Tools
– Full hardware/software development package
Table 1. Device Summary
Features
Program memory
User RAM (stack) bytes
Peripherals
Operating Supply
CPU Frequency
Operating temperature
Package
LQFP64
ST7FSCR1M1
16K FLASH
768 (128)
USB Full-Speed (7 Ep), TBU, Watchdog timer, ISO7816-3 Interface
4.0 to 5.5V
4 or 8 Mhz
0°C to +70°C
SO24
QFN24
ST7SCR1M1
16K ROM
ST7SCR1U1
16K ROM
Rev. 4.0
Apr 2007
1/101
1
www.st.com
Table of Contents
ST7SCR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 PIN DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3 REGISTER & MEMORY MAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
4 FLASH PROGRAM MEMORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.2 MAIN FEATURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.3 STRUCTURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
4.4 ICP (IN-CIRCUIT PROGRAMMING) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.5 IAP (IN-APPLICATION PROGRAMMING) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.6 PROGRAM MEMORY READ-OUT PROTECTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.7 RELATED DOCUMENTATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.8 REGISTER DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
5 CENTRAL PROCESSING UNIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.2 MAIN FEATURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
5.3 CPU REGISTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6 SUPPLY, RESET AND CLOCK MANAGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.1 CLOCK SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.2 RESET SEQUENCE MANAGER (RSM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
7 INTERRUPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.2 MASKING AND PROCESSING FLOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
7.3 INTERRUPTS AND LOW POWER MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.4 CONCURRENT & NESTED MANAGEMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
7.5 INTERRUPT REGISTER DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
8 POWER SAVING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.2 WAIT MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.3 HALT MODE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
9 I/O PORTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.2 FUNCTIONAL DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
9.3 I/O PORT IMPLEMENTATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
9.4 REGISTER DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
10 MISCELLANEOUS REGISTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
11 LEDs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12 ON-CHIP PERIPHERALS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
12.1 WATCHDOG TIMER (WDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
101
.
...
38
41
42
42
12.2 TIME BASE UNIT (TBU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
12.3 USB INTERFACE (USB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
2/101
1
Table of Contents
12.4 SMARTCARD INTERFACE (CRD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
13 INSTRUCTION SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
13.1 CPU ADDRESSING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
13.2 INSTRUCTION GROUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
14 ELECTRICAL CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
14.1 ABSOLUTE MAXIMUM RATINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
14.2 RECOMMENDED OPERATING CONDITIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
14.3 SUPPLY AND RESET CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
14.4 CLOCK AND TIMING CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
14.5 MEMORY CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
14.6 SMARTCARD SUPPLY SUPERVISOR ELECTRICAL CHARACTERISTICS . . . . . . . . . . 84
14.7 EMC CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
14.8 COMMUNICATION INTERFACE CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . 89
15 PACKAGE CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
15.1 PACKAGE MECHANICAL DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
16 DEVICE CONFIGURATION AND ORDERING INFORMATION . . . . . . . . . . . . . . . . . . . . . . . . 92
16.1 DEVICE ORDERING INFORMATION AND TRANSFER OF CUSTOMER CODE . . . . . . 93
16.2 DEVELOPMENT TOOLS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
16.3 ST7 APPLICATION NOTES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
17 IMPORTANT NOTES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
17.1 UNEXPECTED RESET FETCH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
17.2 FLASH DEVICES ONLY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
18 REVISION HISTORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
3/101
ST7SCR
1 INTRODUCTION
The ST7SCR and ST7FSCR devices are mem-
bers of the ST7 microcontroller family designed for
USB applications. All devices are based on a com-
mon industry-standard 8-bit core, featuring an en-
hanced instruction set.
The ST7SCR ROM devices are factory-pro-
grammed and are not reprogrammable.
The ST7FSCR versions feature dual-voltage
Flash memory with Flash Programming capability.
They operate at a 4MHz external oscillator fre-
quency.
Under software control, all devices can be placed
in WAIT or HALT mode, reducing power consump-
tion when the application is in idle or stand-by
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 micro-
controllers feature true bit manipulation, 8x8 un-
Figure 1. ST7SCR Block Diagram
OSCIN
OSCOUT
4MHz
OSCILLATOR
PLL
48 MHz
DIVIDER
USB
DATA
BUFFER
(256 bytes)
USBDP
USBDM
USBVCC
8 MHz
or 4 MHz
ADDRESS AND DATA BUS
signed multiplication and indirect addressing
modes.
The devices include an ST7 Core, up to 16 Kbytes
of program memory, up to 512 bytes of user RAM,
up to 35 I/O lines and the following on-chip periph-
erals:
– USB full speed interface with 7 endpoints, pro-
grammable in/out configuration and embedded
3.3V voltage regulator and transceivers (no ex-
ternal components are needed).
– ISO7816-3 UART interface with Programmable
Baud rate from 372 clock pulses up to 11.625
clock pulses
– Smartcard Supply Block able to provide pro-
grammable supply voltage and I/O voltage levels
to the smartcards
– Low voltage reset ensuring proper power-on or
power-off of the device (selectable by option)
– Watchdog Timer
– 8-bit Timer (TBU)
PORT A
PORT B
PORT C
PORT D
LED
ISO7816 UART
SUPPLY
MANAGER
PA[5:0]
PB[7:0]
PC[7:0]
PD[7:0]
LED[3:0]
USB
WATCHDOG
8-BIT TIMER
PA6
V
PP
CONTROL
8-BIT CORE
ALU
LVD
RAM
(512 Bytes)
PROGRAM
MEMORY
(16K Bytes)
DIODE
SELF
DC/DC
CONVERTER
CRDVCC
CRDDET
CRDIO
CRDC4
CRDC8
3V/1.8V Vreg
CRDRST
CRDCLK
4/101
1
ST7SCR
2 PIN DESCRIPTION
Figure 2. 64-Pin LQFP Package Pinout
NC = Not Connected
CRDRST
NC
CRDCLK
NC
C4
CRDIO
C8
GND
PB0
PB1
PB2
PB3
PB4
PB5
PB6
PB7
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
48
1
47
2
46
3
45
4
44
5
43
6
42
7
41
8
40
9
39
10
38
11
37
12
36
13
35
14
34
15
33
16
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
CRDVCC
GND
GNDA
DIODE
SELF1
SELF2
PA5
PA4
NC
NC
LED3
LED2
LED1
VDD
VDDA
USBVcc
NC
DP
DM
LED0
PA6
V
PP
PC7/WAKUP1
PC6/WAKUP1
PC5/WAKUP1
PC4/WAKUP1
PC3/WAKUP1
PC2/WAKUP1
PC1/WAKUP1
PC0/WAKUP1
GND
VDD
CRDDET
VDD
WAKUP2/ICCDATA/PA0
WAKUP2/ICCCLK/PA1
WAKUP2/PA2
WAKUP2/PA3
PD0
PD1
PD2
PD3
PD4
PD5
PD6
PD7
OSCIN
OSCOUT
5/101
1