Академический Документы
Профессиональный Документы
Культура Документы
PSDIP32
CSDIP32W
SO34 (Shrink)
ST72631
512 (64)
4.0V to 5.5V
8 Mhz (with 24 MHz oscillator) or 4 MHz (with 12 MHz oscillator)
Operating temperature
Packages
EPROM device
ST72633
4K
256 (64)
Operating Supply
CPU frequency
ST72632
8K
16K
0C to +70C
SO34/SDIP32
ST72E631 1 (CSDIP32W)
Rev. 1.8
1/109
Table of Contents
1 GENERAL DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 PIN DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.3 EXTERNAL CONNECTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4 REGISTER & MEMORY MAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5 EPROM/OTP PROGRAM MEMORY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
1.5.1 EPROM ERASURE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2 CENTRAL PROCESSING UNIT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2 MAIN FEATURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3 CPU REGISTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3 CLOCKS AND RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1 CLOCK SYSTEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.1 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.2 External Clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.1 Low Voltage Detector (LVD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.2 Watchdog Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2.3 External Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 INTERRUPTS AND POWER SAVING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1 INTERRUPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
18
18
18
20
20
23
23
24
25
25
5.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.2 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.3 I/O Port Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.4 Port A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.5 Port B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.6 Port C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1.7 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 MISCELLANEOUS REGISTER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
25
25
26
27
29
30
31
32
33
33
34
34
34
36
36
5.4.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
2/109
Table of Contents
5.4.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4.4 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4.6 Summary of Timer modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4.7 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5 SERIAL COMMUNICATIONS INTERFACE (SCI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
36
48
48
48
49
54
5.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5.3 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5.4 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5.5 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5.6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5.7 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6 USB INTERFACE (USB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
54
54
54
56
60
60
61
65
5.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6.4 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6.5 Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7 IC BUS INTERFACE (IC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
65
65
65
66
71
73
5.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7.3 General Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7.4 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7.5 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7.6 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.7.7 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8 8-BIT A/D CONVERTER (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
73
73
73
75
78
78
79
84
5.8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8.2 Main Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8.3 Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8.4 Low Power Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8.5 Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.8.6 Register Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 INSTRUCTION SET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1 ST7 ADDRESSING MODES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
84
84
85
85
85
86
87
87
6.1.1 Inherent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.2 Immediate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.3 Direct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.4 Indexed (No Offset, Short, Long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.5 Indirect (Short, Long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.6 Indirect Indexed (Short, Long) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.7 Relative Mode (Direct, Indirect) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 INSTRUCTION GROUPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
88
88
88
88
88
89
89
90
7 ELECTRICAL CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
7.1 ABSOLUTE MAXIMUM RATINGS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
7.2 THERMAL CHARACTERISTICS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3/109
ST7263
4/109
ST7263
1 GENERAL DESCRIPTION
1.1 INTRODUCTION
The ST7263 Microcontrollers form a sub family of
the ST7 dedicated to USB applications. The devices are based on an industry-standard 8-bit core
and feature an enhanced instruction set. They operate at a 24MHz or 12 MHz oscillator frequency.
Under software control, the ST7263 MCUs may be
placed in either Wait or Halt modes, thus reducing
power consumption. The enhanced instruction set
and addressing modes afford real programming
potential. In addition to standard 8-bit data management, the ST7263 MCUs feature true bit manipulation, 8x8 unsigned multiplication and indirect
addressing modes. The devices include an ST7
Core, up to 16K program memory, up to 512 bytes
RAM, 19 I/O lines and the following on-chip peripherals:
USB low speed interface with 3 endpoints with
programmable in/out configuration using the
DMA architecture with embedded 3.3V voltage
regulator and transceivers (no external components are needed).
8-bit Analog-to-Digital converter (ADC) with 8
multiplexed analog inputs
industry standard asynchronous SCI serial interface (not on all products - see device summary
below)
digital Watchdog
16-bit Timer featuring an External clock input, 2
Input Captures, 2 Output Compares with Pulse
Generator capabilities
fast I2C Multi Master interface (not on all products - see device summary)
Low voltage (LVD) reset ensuring proper poweron or power-off of the device
All ST7263 MCUs are available in ROM and OTP
versions.
The ST72E631 is the EPROM version of the
ST7263 in CSDIP32 windowed packages.
A specific mode is available to allow programming
of the EPROM user memory array. This is set by a
specific voltage source applied to the VPP/TEST
pin.
OSCIN
OSCOUT
OSCILLATOR
I2C*
OSC/4 or OSC/2
(for USB)
VDD
VSS
PORT A
POWER
SUPPLY
PA[7:0]
(8 bits)
16-BIT TIMER
WATCHDOG
CONTROL
8-BIT CORE
ALU
LVD
USB DMA
VPP/TEST
VDDA
VSSA
PROGRAM
MEMORY
(4K/8K/16K Bytes)
RESET
PORT B
ADC
PB[7:0]
(8 bits)
PORT C
SCI*
(UART)
USB SIE
PC[2:0]
(3 bits)
USBDP
USBDM
USBVCC
RAM
(256/512 Bytes)
5/109
ST7263
VDD
34
VDDA
OSCOUT
OSCIN
33
32
USBVCC
USBDM
VSS
31
USBDP
PC2/USBOE
30
PC1/TDO
29
VSSA
PA0/MCO
PC0/RDI
28
PA1(25mA)/SDA
RESET
27
NC
NC
26
NC
AIN7/IT8/PB7(10mA)
AIN6/IT7/PB6(10mA)
10
25
NC
11
24
PA2(25mA)/SCL
VPP/TEST
AIN5/IT6/PB5(10mA)
12
23
PA3/EXTCLK
13
22
AIN4/IT5/PB4(10mA)
14
21
PA4/ICAP1/IT1
PA5/ICAP2/IT2
AIN3/PB3(10mA)
15
20
AIN2/PB2(10mA)
16
19
PA6/OCMP1/IT3
PA7/OCMP2/IT4
AIN1/PB1(10mA)
17
18
PB0(10mA)/AIN0
VDD
32
VDDA
OSCOUT
31
USBVCC
OSCIN
30
USBDM
USBDP
VSSA
VSS
29
PC2/USBOE
28
PC1/TDO
PC0/RDI
RESET
27
26
25
AIN7/IT8/PB7(10mA)
AIN6/IT7/PB6(10mA)
VPP/TEST*
24
10
23
NC
NC
PA2(25mA)/SCL
11
22
PA3/EXTCLK
AIN5/IT6/PB5(10mA)
12
21
AIN4/IT5/PB4(10mA)
13
20
AIN3/PB3(10mA)
14
19
PA4/ICAP1/IT1
PA5/ICAP2/IT2
PA6/COMP1/IT3
AIN2/PB2(10mA)
15
18
PA7/COMP2/IT4
AIN1/PB1/(10mA)
16
17
PB0(10mA)/AIN0
6/109
PA0/MCO
PA1(25mA)/SDA
ST7263
Port / Control
Output
Main
Function
(after reset)
OSCOUT
Oscillator output
OSCIN
Oscillator input
VSS
Digital ground
PC2/USBOE
I/O
CT
Port C2
PC1/TDO
I/O
CT
Port C1
PC0/RDI
I/O
CT
Port C0
RESET
I/O
--
NC
10 PB7/AIN7/IT8
I/O CT 10mA X
Port B7
10 11 PB6/AIN6/IT7
I/O CT 10mA X
Port B6
11 12 VPP/TEST
PP
OD
ana
int
wpu
VDD
float
Output
Pin Name
Input
SO34
Input
SDIP32
Type
Pin n
Alternate Function
Reset
--
Not connected
12 13 PB5/AIN5/IT6
I/O CT 10mA X
Port B5
13 14 PB4/AIN4/IT5
I/O CT 10mA X
Port B4
14 15 PB3/AIN3
I/O CT 10mA X
Port B3
15 16 PB2/AIN2
I/O CT 10mA X
Port B2
16 17 PB1/AIN1
I/O CT 10mA X
Port B1
17 18 PB0/AIN0
I/O CT 10mA X
Port B0
18 19 PA7/OCMP2/IT4
I/O
CT
Port A7
19 20 PA6/OCMP1/IT3
I/O
CT
Port A6
7/109
ST7263
Port / Control
Input
Main
Function
(after reset)
Alternate Function
CT
Port A5
21 22 PA4/ICAP1/IT1
I/O
CT
Port A4
22 23 PA3/EXTCLK
I/O
CT
Port A3
23 24 PA2/SCL
I/O CT 25mA X
Port A2
PP
I/O
OD
20 21 PA5/ICAP2/IT2
ana
int
Output
wpu
float
Output
Type
SO34
SDIP32
Pin Name
Input
Level
Pin n
-- 25 NC
--
Not connected
24 26 NC
--
Not connected
25 27 NC
--
Not connected
26 28 PA1/SDA
I/O CT 25mA X
27 29 PA0/MCO
I/O
28 30 VSSA
CT
T
X
Port A1
Port A0
Analog ground
29 31 USBDP
I/O
30 32 USBDM
I/O
31 33 USBVCC
32 34 VDDA
8/109
ST7263
VPP
VDD
10nF
VDD
0.1F
VSS
VDD
4.7K
0.1F
RESET
See
Clocks
Section
OSCIN
OSCOUT
VDD
10K
Unused I/O
9/109
ST7263
0000h
HW Registers
(see Table 4
003Fh
0040h
023Fh
0240h
0040h
Short Addressing
RAM (192 Bytes)
00FFh
0100h
Reserved
0040h
BFFFh
C000h
Short Addressing
RAM (192 Bytes)
00FFh
0100h
Program Memory*
013Fh
0140h
E000h
8K Bytes
16-bit Addressing RAM
(256 Bytes)
F000h
4K Bytes
023Fh
FFEFh
FFF0h
FFFFh
* Program memory and RAM sizes are product dependent (see Table 1 Device Summary)
Table 3. Interrupt Vector Map
Vector Address
Description
Masked by
Remarks
FFF0-FFF1h
I- bit
Internal Interrupt
No
FFF2-FFF3h
I- bit
Internal Interrupt
No
FFF4-FFF5h
I- bit
Internal Interrupt
No
FFF6-FFF7h
I- bit
Internal Interrupt
No
FFF8-FFF9h
I- bit
External Interrupts
Yes
Yes
FFFA-FFFBh
I- bit
Internal Interrupt
FFFC-FFFDh
none
CPU Interrupt
FFFE-FFFFh
RESET Vector
none
10/109
No
Yes
ST7263
Block
Register Label
Register name
Reset Status
Remarks
0000h
PADR
00h
R/W
0001h
PADDR
00h
R/W
0002h
PBDR
00h
R/W
0003h
PBDDR
00h
R/W
0004h
PCDR
1111 x000b
R/W
0005h
PCDDR
1111 x000b
R/W
0006h
Reserved (2 Bytes)
0007h
0008h
ITIFRE
Interrupt Register
00h
R/W
0009h
MISCR
Miscellaneous Register
F0h
R/W
DR
00h
Read only
CSR
00h
R/W
CR
7Fh
R/W
000Ah
000Bh
000Ch
ADC
WDG
000Dh
Reserved (4 Bytes)
0010h
0011h
CR2
00h
R/W
0012h
CR1
00h
R/W
0013h
SR
00h
Read only
0014h
IC1HR
xxh
Read only
0015h
IC1LR
xxh
Read only
0016h
OC1HR
80h
R/W
0017h
OC1LR
00h
R/W
CHR
FFh
Read only
0019h
CLR
FCh
R/W
001Ah
ACHR
FFh
Read only
001Bh
ACLR
FCh
R/W
001Ch
IC2HR
xxh
Read only
001Dh
IC2LR
xxh
Read only
001Eh
OC2HR
80h
R/W
001Fh
OC2LR
00h
R/W
0020h
SR
C0h
Read only
0021h
DR
xxh
R/W
0018h
TIM
SCI 1)
BRR
00xx xxxxb
R/W
0023h
CR1
xxh
R/W
0024h
CR2
00h
R/W
0022h
11/109
ST7263
Address
Block
Register Label
Register name
Reset Status
Remarks
0025h
PIDR
xxh
Read only
0026h
DMAR
xxh
R/W
0027h
IDR
xxh
R/W
0028h
ISTR
00h
R/W
0029h
IMR
00h
R/W
002Ah
CTLR
xxxx 0110b
R/W
DADDR
00h
R/W
002Ch
EP0RA
0000 xxxxb
R/W
002Dh
EP0RB
80h
R/W
002Eh
EP1RA
0000 xxxxb
R/W
002Fh
EP1RB
0000 xxxxb
R/W
0030h
EP2RA
0000 xxxxb
R/W
0031h
EP2RB
0000 xxxxb
R/W
00h
R/W
Reserved
002Bh
USB
0032h
Reserved (7 Bytes)
0038h
DR
0039h
003Ah
I2C1)
003Bh
OAR
00h
R/W
003Ch
CCR
00h
R/W
003Dh
SR2
00h
Read only
003Eh
SR1
00h
Read only
003Fh
CR
00h
R/W
Note 1. If the peripheral is present on the device (see Table 1 Device Summary)
12/109
ST7263
13/109
ST7263
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
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)
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.)
The Y register is not affected by the interrupt automatic procedures (not pushed to and popped from
the stack).
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).
0
ACCUMULATOR
0
X INDEX REGISTER
0
Y INDEX REGISTER
PCH
8 7
PCL
0
PROGRAM COUNTER
0
N Z C
RESET VALUE = 1 1 1 X 1 X X X
15
8 7
0
STACK POINTER
14/109
ST7263
0
1
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.
These bits can be individually tested and/or controlled by specific instructions.
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 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
(i.e. the most significant bit is a logic 1).
This bit is accessed by the JRMI and JRPL instructions.
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.
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.
15/109
ST7263
8
0
7
0
1
0
SP5
SP4
SP3
SP2
SP1
SP0
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 7).
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 (SP5 to SP0 bits are set) which is the stack
higher address.
PUSH Y
Interrupt
Event
POP Y
RET
or RSP
IRET
@ 0100h
SP
SP
CC
A
X
PCH
PCH
PCH
PCL
PCL
PCL
PCH
PCH
PCH
PCH
PCH
PCL
PCL
PCL
PCL
PCL
SP
@ 013Fh
16/109
SP
Y
CC
A
CC
A
SP
SP
ST7263
20
25
70
COSCIN
56pF
47pF
22pF
COSCOUT
56pF
47pF
22pF
RP
1-10 M
1-10 M
1-10 M
OSCIN
NC
EXTERNAL
CLOCK
OSCOUT
OSCIN
RP
COSCIN
COSCOUT
%3
OSCOUT
CLKDIV
1
24 or
12 MHz
Crystal
6 MHz (USB)
%2
%2
%2
17/109
ST7263
3.2 RESET
The Reset procedure is used to provide an orderly
software start-up or to exit low power modes.
Three reset modes are provided: a low voltage
(LVD) reset, a watchdog reset and an external reset at the RESET pin.
A reset causes the reset vector to be fetched from
addresses FFFEh and FFFFh in order to be loaded
into the PC and with program execution starting
from this point.
An internal circuitry provides a 4096 CPU clock cycle delay from the time that the oscillator becomes
active.
3.2.1 Low Voltage Detector (LVD)
Low voltage reset circuitry generates a reset when
VDD is:
below VIT+ when VDD is rising,
below VIT- when VDD is falling.
Table 6. List of sections affected by RESET, WAIT and HALT (Refer to 3.5 for Wait and Halt Modes)
Section
RESET
WAIT
HALT
18/109
ST7263
RESET
VIT+
VDD
VIT-
LOW VOLTAGE
DETECTOR
INTERNAL
RESET
FROM
WATCHDOG
RESET
VDD
RESET
VDD
Addresses
$FFFE
OSCIN
tOXOV
fCPU
PC
RESET
WATCHDOG RESET
FFFE
FFFF
4096 CPU
CLOCK
CYCLES
DELAY
Note: Refer to Electrical Characteristics for values of tDDR, tOXOV, VIT+, VIT- and Vhys
19/109
ST7263
20/109
ST7263
INTERRUPTS (Contd)
Figure 15. Interrupt Processing Flowchart
FROM RESET
BIT I SET
N
N
INTERRUPT
IRET
STACK PC, X, A, CC
SET I BIT
LOAD PC FROM INTERRUPT VECTOR
Y
EXECUTE INSTRUCTION
Source
Block
RESET
TRAP
USB
ITi
TIMER
I2C
Description
Reset
Software Interrupt
End Suspend Mode
External Interrupts
Timer Peripheral Interrupts
I2C Peripheral Interrupts
Register
Label
Priority
Order
N/A
Highest
Priority
ISTR
Address
yes
FFFEh-FFFFh
no
FFFCh-FFFDh
yes
ITRFRE
TIMSR
SCISR
USB
ISTR
FFF8h-FFF9h
FFF4h-FFF5h
I2CSR2
SCI
FFFAh-FFFBh
FFF6h-FFF7h
I2CSR1
Vector
Exit
from
HALT
no
Lowest
Priority
FFF2h-FFF3h
FFF0h-FFF1h
21/109
ST7263
INTERRUPTS (Contd)
4.1.1 Interrupt Register
INTERRUPTS REGISTER (ITRFRE)
Address: 0008h Read/Write
Reset Value: 0000 0000 (00h)
7
IT8E
0
IT7E
IT6E
IT5E
IT4E
IT3E
IT2E
IT1E
22/109
ST7263
HALT INSTRUCTION
OSCILLATOR
PERIPH. CLOCK
CPU CLOCK
OFF
OFF
OFF
CLEARED
I-BIT
N
RESET
N
EXTERNAL
INTERRUPT*
Y
OSCILLATOR
PERIPH. CLOCK
CPU CLOCK
I-BIT
ON
ON
ON
SET
23/109
ST7263
WAIT mode places the MCU in a low power consumption mode by stopping the CPU.
This power saving mode is selected by calling the
WFI ST7 software instruction.
All peripherals remain active. During WAIT mode,
the I bit of the CC register is forced to 0, to enable
all interrupts. All other registers and memory remain unchanged. The MCU remains in WAIT
mode until an interrupt or Reset occurs, whereupon the Program Counter branches to the starting
address of the interrupt or Reset service routine.
The MCU will remain in WAIT mode until a Reset
or an Interrupt occurs, causing it to wake up.
Refer to Figure 17.
WFI INSTRUCTION
OSCILLATOR
PERIPH. CLOCK
CPU CLOCK
I-BIT
ON
ON
OFF
CLEARED
N
RESET
N
INTERRUPT
OSCILLATOR
PERIPH. CLOCK
CPU CLOCK
I-BIT
ON
ON
ON
SET
IF RESET
4096 CPU CLOCK
CYCLES DELAY
24/109
ST7263
5 ON-CHIP PERIPHERALS
5.1 I/O PORTS
5.1.1 Introduction
The I/O ports offer different functional modes:
transfer of data through digital inputs and outputs
and for specific pins:
analog signal input (ADC)
alternate signal input/output for the on-chip peripherals.
external interrupt generation
An I/O port is composed of up to 8 pins. Each pin
can be programmed independently as digital input
(with or without interrupt generation) or digital output.
5.1.2 Functional description
Each port is associated to 2 main registers:
Data Register (DR)
Data Direction Register (DDR)
Each I/O pin may be programmed using the corresponding register bits in DDR register: bit X corresponding to pin X of the port. The same correspondence is used for the DR register.
Table 8. I/O Pin Functions
DDR
MODE
Input
Output
Input Modes
The input configuration is selected by clearing the
corresponding DDR register bit.
In this case, reading the DR register returns the
digital value applied to the external I/O pin.
Note 1: All the inputs are triggered by a Schmitt
trigger.
Note 2: When switching from input mode to output
mode, the DR register should be written first to
output the correct value as soon as the port is configured as an output.
Interrupt function
When an I/O is configured in Input with Interrupt,
an event on this I/O can generate an external In-
terrupt request to the CPU. The interrupt sensitivity is given independently according to the description mentioned in the ITRFRE interrupt register.
Each pin can independently generate an Interrupt
request.
Each external interrupt vector is linked to a dedicated group of I/O port pins (see Interrupts section). If more than one input pin is selected simultaneously as interrupt source, this is logically
ORed. For this reason if one of the interrupt pins is
tied low, it masks the other ones.
Output Mode
The pin is configured in output mode by setting the
corresponding DDR register bit (see Table 7).
In this mode, writing 0 or 1 to the DR register
applies this digital value to the I/O pin through the
latch. Then reading the DR register returns the
previously stored value.
Note: In this mode, the interrupt function is disabled.
Digital Alternate Function
When an on-chip peripheral is configured to use a
pin, the alternate function is automatically selected. This alternate function takes priority over
standard I/O programming. When the signal is
coming from an on-chip peripheral, the I/O pin is
automatically configured in output mode (push-pull
or open drain according to the peripheral).
When the signal is going to an on-chip peripheral,
the I/O pin has to be configured in input mode. In
this case, the pins state is also digitally readable
by addressing the DR register.
Notes:
1. Input pull-up configuration can cause an unexpected value at the input of the alternate peripheral input.
2. When the on-chip peripheral uses a pin as input
and output, this pin must be configured as an input
(DDR = 0).
Warning: The alternate function must not be activated as long as the pin is configured as input with
interrupt, in order to avoid generating spurious interrupts.
25/109
ST7263
26/109
ST7263
PORT A
Alternate Function
Input*
Output
Signal
Condition
PA0
with pull-up
push-pull
PA3
with pull-up
push-pull
Timer EXTCLK
PA4
with pull-up
PA5
with pull-up
PA6
with pull-up
PA7
with pull-up
MCO = 1 (MISCR)
CC1 =1
CC0 = 1 (Timer CR2)
Timer ICAP1
push-pull
IT1E = 1 (ITIFRE)
Timer ICAP2
push-pull
push-pull
push-pull
IT2E = 1 (ITIFRE)
Timer OCMP1
OC1E = 1
IT3E = 1 (ITIFRE)
Timer OCMP2
OC2E = 1
IT4E = 1 (ITIFRE)
*Reset State
ALTERNATE 1
OUTPUT
0
P-BUFFER
VDD
DR
PULL-UP
DATA BUS
LATCH
ALTERNATE ENABLE
DDR
LATCH
PAD
DDR SEL
N-BUFFER
DR SEL
ALTERNATE INPUT
DIODES
ALTERNATE ENABLE
VSS
27/109
ST7263
I/O
Alternate Function
Input*
Output
Signal
Condition
PA1
without pull-up
I2C enable
PA2
without pull-up
I2C enable
*Reset State
DDR
LATCH
DATA BUS
PAD
DDR SEL
N-BUFFER
DR SEL
ALTERNATE ENABLE
VSS
0
CMOS SCHMITT TRIGGER
28/109
ST7263
I/O
Alternate Function
Input*
Output
Signal
Condition
PB0
without pull-up
push-pull
PB1
without pull-up
push-pull
PB2
without pull-up
push-pull
PB3
without pull-up
push-pull
PB4
without pull-up
push-pull
IT5 Schmitt triggered input
IT4E = 1 (ITIFRE)
IT5E = 1 (ITIFRE)
IT6E = 1 (ITIFRE)
IT7E = 1 (ITIFRE)
PB5
without pull-up
PB6
push-pull
without pull-up
PB7
push-pull
without pull-up
push-pull
*Reset State
V DD
1
0
P-BUFFER
DR
LATCH
VDD
ALTERNATE ENABLE
DDR
PAD
LATCH
DATA BUS
ANALOG ENABLE
(ADC)
DDR SEL
ANALOG
SWITCH
DIODES
N-BUFFER
DR SEL
1
ALTERNATE ENABLE
0
DIGITAL ENABLE
V SS
ALTERNATE INPUT
29/109
ST7263
Alternate Function
PORT C
Input*
Output
Signal
Condition
PC0
with pull-up
push-pull
PC1
with pull-up
push-pull
SCI enable
PC2
with pull-up
push-pull
USBOE =1
(MISCR)
*Reset State
ALTERNATE 1
OUTPUT
0
P-BUFFER
DR
PULL-UP
LATCH
VDD
ALTERNATE ENABLE
DATA BUS
DDR
PAD
LATCH
DDR SEL
N-BUFFER
DR SEL
DIODES
ALTERNATE ENABLE
VSS
ALTERNATE INPUT
CMOS SCHMITT TRIGGER
30/109
ST7263
0
DD7
D7
D6
D5
D4
D3
D2
D1
DD6
DD5
DD4
DD3
DD2
DD1
DD0
D0
Register
Label
PADR
PADDR
PBDR
PBDDR
PCDR
PCDDR
MSB
MSB
MSB
MSB
MSB
MSB
0
LSB
LSB
LSB
LSB
LSB
LSB
31/109
ST7263
0
-
LVD
CLKDIV USBOE
MCO
32/109
ST7263
RESET
T6
T5
T4
T3
T2
T1
T0
7-BIT DOWNCOUNTER
fCPU
CLOCK DIVIDER
49152
33/109
ST7263
Max
FFh
393.216
Min
C0h
6.144
Notes: Following a reset, the watchdog is disabled. Once activated it cannot be disabled, except
by a reset.
The T6 bit can be used to generate a software reset (the WDGA bit is set and the T6 bit is cleared).
5.3.3.1 Using Halt Mode with the WDG
The HALT instruction stops the oscillator. When
the oscillator is stopped, the WDG stops counting
and is no longer able to generate a reset until the
microcontroller receives an external interrupt or a
reset.
If an external interrupt is received, the WDG restarts counting after 4096 CPU clocks. If a reset is
generated, the WDG is disabled (reset state).
Recommendations
Make sure that an external event is available to
wake up the microcontroller from Halt mode.
Before executing the HALT instruction, refresh
the WDG counter, to avoid an unexpected WDG
34/109
0
T6
T5
T4
T3
T2
T1
T0
ST7263
Register
Label
WDGCR
WDGA
T6
T5
T4
T3
T2
T1
T0
Reset Value
35/109
ST7263
36/109
ST7263
8 low
8
8
low
high
low
high
EXEDG
low
high
high
8-bit
buffer
low
8 high
16
1/2
1/4
1/8
OUTPUT
COMPARE
REGISTER
2
OUTPUT
COMPARE
REGISTER
1
COUNTER
REGISTER
ALTERNATE
COUNTER
REGISTER
EXTCLK
pin
INPUT
CAPTURE
REGISTER
1
INPUT
CAPTURE
REGISTER
2
16
16
16
CC[1:0]
TIMER INTERNAL BUS
16 16
OVERFLOW
DETECT
CIRCUIT
OUTPUT COMPARE
CIRCUIT
EDGE DETECT
CIRCUIT1
ICAP1
pin
EDGE DETECT
CIRCUIT2
ICAP2
pin
LATCH1
OCMP1
pin
LATCH2
OCMP2
pin
(Status Register) SR
CC1
(See note)
TIMER INTERRUPT
37/109
ST7263
Read
MS Byte
LS Byte
is buffered
Other
instructions
Read
At t0 +t LS Byte
LS Byte value at t0
Sequence completed
The user must read the MS Byte first, then the LS
Byte value is buffered automatically.
This buffered value remains unchanged until the
16-bit read sequence is completed, even if the
user reads the MS Byte several times.
After a complete reading sequence, if only the
CLR register or ACLR register are read, they return the LS Byte of the count value at the time of
the read.
Whatever the timer mode used (input capture, output compare, One Pulse mode or PWM mode) an
overflow occurs when the counter rolls over from
FFFFh to 0000h then:
The TOF bit of the SR register is set.
A timer interrupt is generated if:
TOIE bit of the CR1 register is set and
I bit of the CC register is cleared.
If one of these conditions is false, the interrupt remains pending to be issued as soon as they are
both true.
38/109
ST7263
CPU CLOCK
INTERNAL RESET
TIMER CLOCK
FFFD FFFE FFFF 0000
COUNTER REGISTER
0001
0002
0003
FFFC
FFFD
0000
0001
CPU CLOCK
INTERNAL RESET
TIMER CLOCK
COUNTER REGISTER
FFFC
FFFD
0000
Note: The MCU is in reset state when the internal reset signal is high. When it is low, the MCU is running.
39/109
ST7263
MS Byte
ICiHR
LS Byte
ICiLR
40/109
ST7263
ICAP1
pin
ICAP2
pin
EDGE DETECT
CIRCUIT1
ICIE
IEDG1
(Status Register) SR
IC1R Register
IC2R Register
ICF1
ICF2
16-BIT
CC1
CC0
IEDG2
COUNTER
TIMER CLOCK
COUNTER REGISTER
FF01
FF02
FF03
ICAPi PIN
ICAPi FLAG
ICAPi REGISTER
FF03
41/109
ST7263
MS Byte
OCiHR
LS Byte
OCiLR
42/109
OCiR =
t * fCPU
PRESC
Where:
t
= Output compare period (in seconds)
fCPU
= CPU clock frequency (in hertz)
PRESC = Timer prescaler factor (2, 4 or 8 depending on CC[1:0] bits, see Table 1)
If the timer clock is an external clock, the formula
is:
OCiR = t * fEXT
Where:
t
= Output compare period (in seconds)
= External timer clock frequency (in hertz)
fEXT
Clearing the output compare interrupt request (i.e.
clearing the OCFi bit) is done by:
1. Reading the SR register while the OCFi bit is
set.
2. An access (read or write) to the OCiLR register.
The following procedure is recommended to prevent the OCFi bit from being set between the time
it is read and the write to the OCiR register:
Write to the OCiHR register (further compares
are inhibited).
Read the SR register (first step of the clearance
of the OCFi bit, which may be already set).
Write to the OCiLR register (enables the output
compare function and clears the OCFi bit).
ST7263
OC1E OC2E
CC1
CC0
16-bit
16-bit
OCIE
OLVL1
16-bit
Latch
1
Latch
2
OC1R Register
OCF1
OCF2
OCMP1
Pin
OCMP2
Pin
OC2R Register
(Status Register) SR
43/109
ST7263
2ECF 2ED0
2ED3
44/109
2ECF 2ED0
ST7263
OCMP1 = OLVL2
Counter is reset
to FFFCh
ICF1 bit is set
When
Counter
= OC1R
OCMP1 = OLVL1
Then, on a valid event on the ICAP1 pin, the counter is initialized to FFFCh and the OLVL2 bit is
loaded on the OCMP1 pin, the ICF1 bit is set and
the value FFFDh is loaded in the IC1R register.
Because the ICF1 bit is set when an active edge
occurs, an interrupt can be generated if the ICIE
bit is set.
t * fCPU
-5
PRESC
Where:
t
= Pulse period (in seconds)
fCPU = CPU clock frequency (in hertz)
PRESC = Timer prescaler factor (2, 4 or 8 depending on the CC[1:0] bits, see Table 1)
If the timer clock is an external clock the formula is:
OCiR = t * fEXT -5
Where:
t
= Pulse period (in seconds)
fEXT
= External timer clock frequency (in hertz)
When the value of the counter is equal to the value
of the contents of the OC1R register, the OLVL1
bit is output on the OCMP1 pin (see Figure 10).
Notes:
1. The OCF1 bit cannot be set by hardware in
One Pulse mode but the OCF2 bit can generate
an Output Compare interrupt.
2. When the Pulse Width Modulation (PWM) and
One Pulse mode (OPM) bits are both set, the
PWM mode is the only active one.
3. If OLVL1=OLVL2 a continuous signal will be
seen on the OCMP1 pin.
4. The ICAP1 pin can not be used to perform input
capture. The ICAP2 pin can be used to perform
input capture (ICF2 can be set and IC2R can be
loaded) but the user must take care that the
counter is reset each time a valid edge occurs
on the ICAP1 pin and ICF1 can also generates
interrupt if ICIE is set.
5. When One Pulse mode is used OC1R is dedicated to this mode. Nevertheless OC2R and
OCF2 can be used to indicate that a period of
time has elapsed but cannot generate an output
waveform because the OLVL2 level is dedicated to One Pulse mode.
45/109
ST7263
COUNTER
FFFC FFFD
2ED3
ICAP1
OLVL2
OCMP1
OLVL1
OLVL2
compare1
Note: IEDG1=1, OC1R=2ED0h, OLVL1=0, OLVL2=1
OLVL2
OCMP1
compare2
OLVL1
compare1
46/109
34E2
FFFC
OLVL2
compare2
ST7263
When
Counter
= OC2R
OCMP1 = OLVL1
The OCiR register value required for a specific timing application can be calculated using the following formula:
OCiR Value =
t * fCPU
-5
PRESC
Where:
t
= Signal or pulse period (in seconds)
fCPU = CPU clock frequency (in hertz)
PRESC = Timer prescaler factor (2, 4 or 8 depending on CC[1:0] bits, see Table 1)
If the timer clock is an external clock the formula is:
OCiR = t * fEXT -5
Where:
t
= Signal or pulse period (in seconds)
fEXT
= External timer clock frequency (in hertz)
The Output Compare 2 event causes the counter
to be initialized to FFFCh (See Figure 11)
Notes:
1. After a write instruction to the OCiHR register,
the output compare function is inhibited until the
OCiLR register is also written.
2. The OCF1 and OCF2 bits cannot be set by
hardware in PWM mode, therefore the Output
Compare interrupt is inhibited.
3. The ICF1 bit is set by hardware when the counter reaches the OC2R value and can produce a
timer interrupt if the ICIE bit is set and the I bit is
cleared.
4. In PWM mode the ICAP1 pin can not be used
to perform input capture because it is disconnected from the timer. The ICAP2 pin can be
used to perform input capture (ICF2 can be set
and IC2R can be loaded) but the user must
take care that the counter is reset after each
period and ICF1 can also generate an interrupt
if ICIE is set.
5. When the Pulse Width Modulation (PWM) and
One Pulse mode (OPM) bits are both set, the
PWM mode is the only active one.
OCMP1 = OLVL2
Counter is reset
to FFFCh
ICF1 bit is set
47/109
ST7263
HALT
Description
No effect on 16-bit Timer.
Timer interrupts cause the device to exit from WAIT mode.
16-bit Timer registers are frozen.
In HALT mode, the counter stops counting until Halt mode is exited. Counting resumes from the previous
count when the MCU is woken up by an interrupt with exit from HALT mode capability or from the counter
reset value when the MCU is woken up by a RESET.
If an input capture event occurs on the ICAPi pin, the input capture detection circuitry is armed. Consequently, when the MCU is woken up by an interrupt with exit from HALT mode capability, the ICFi bit is set, and
the counter value present when exiting from HALT mode is captured into the ICiR register.
5.4.5 Interrupts
Event
Flag
Interrupt Event
Input Capture 1 event/Counter reset in PWM mode
Input Capture 2 event
Output Compare 1 event (not available in PWM mode)
Output Compare 2 event (not available in PWM mode)
Timer Overflow event
ICF1
ICF2
OCF1
OCF2
TOF
Enable
Control
Bit
ICIE
OCIE
TOIE
Exit
from
Wait
Yes
Yes
Yes
Yes
Yes
Exit
from
Halt
No
No
No
No
No
Note: The 16-bit Timer interrupt events are connected to the same interrupt vector (see Interrupts chapter). These events generate an interrupt if the corresponding Enable Control Bit is set and the interrupt
mask in the CC register is reset (RIM instruction).
5.4.6 Summary of Timer modes
MODES
Input Capture (1 and/or 2)
Output Compare (1 and/or 2)
One Pulse mode
PWM Mode
1)
Input Capture 1
Yes
Yes
No
No
AVAILABLE RESOURCES
Input Capture 2
Output Compare 1 Output Compare 2
Yes
Yes
Yes
Yes
Yes
Yes
1)
No
Partially 2)
Not Recommended
3)
Not Recommended
No
No
48/109
ST7263
49/109
ST7263
50/109
CC1
0
0
1
CC0
0
1
0
Note: If the external clock pin is not available, programming the external clock configuration stops
the counter.
Bit 1 = IEDG2 Input Edge 2.
This bit determines which type of level transition
on the ICAP2 pin will trigger the capture.
0: A falling edge triggers the capture.
1: A rising edge triggers the capture.
Bit 0 = EXEDG External Clock Edge.
This bit determines which type of level transition
on the external clock pin (EXTCLK) will trigger the
counter register.
0: A falling edge triggers the counter register.
1: A rising edge triggers the counter register.
ST7263
0
OCF1
TOF
ICF2
OCF2
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
51/109
ST7263
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
MSB
LSB
52/109
MSB
LSB
MSB
LSB
MSB
LSB
ST7263
Register
Label
OC1E
OC2E
OPM
PWM
CC1
CC0
IEDG2
EXEDG
Reset Value
CR1
0
ICIE
0
OCIE
0
TOIE
0
FOLV2
0
FOLV1
0
OLVL2
0
IEDG1
0
OLVL1
Reset Value
SR
0
ICF1
0
OCF1
0
TOF
0
ICF2
0
OCF2
0
0
0
0
0
0
Reset Value
IC1HR
CR2
Reset Value
IC1LR
Reset Value
OC1HR
Reset Value
OC1LR
Reset Value
CHR
Reset Value
CLR
Reset Value
ACHR
Reset Value
ACLR
Reset Value
IC2HR
Reset Value
IC2LR
Reset Value
OC2HR
Reset Value
OC2LR
Reset Value
MSB
LSB
MSB
LSB
MSB
1
LSB
0
MSB
0
LSB
0
MSB
1
LSB
1
MSB
1
LSB
0
MSB
1
LSB
1
MSB
1
LSB
0
MSB
LSB
MSB
LSB
MSB
1
LSB
0
MSB
0
LSB
0
53/109
ST7263
54/109
ST7263
Write
Read
(Data Register) DR
CR1
R8
WAKE
UP
UNIT
TRANSMIT
CONTROL
T8
WAKE
RECEIVER
CLOCK
RECEIVER
CONTROL
SR
CR2
TIE TCIE RIE
ILIE
TE
RE RWU SBK
NF
FE
SCI
INTERRUPT
CONTROL
TRANSMITTER
CLOCK
fCPU
Transmitter Rate
Control
/2
/16
/PR
BRR
SCP1 SCP0 SCT2 SCT1 SCT0 SCR2 SCR1SCR0
Receiver Rate
Control
BAUD RATE GENERATOR
55/109
ST7263
Data Frame
Start
Bit
Bit0
Bit2
Bit1
Bit3
Bit4
Bit5
Bit6
Start
Bit
Break Frame
Extra
1
Possible
Parity
Bit
Data Frame
56/109
Bit0
Bit8
Next
Stop Start
Bit
Bit
Idle Frame
Start
Bit
Bit7
Bit1
Bit2
Bit3
Bit4
Bit5
Bit6
Bit7
Start
Bit
Next
Start
Bit
Idle Frame
Start
Bit
Break Frame
Extra Start
Bit
1
ST7263
57/109
ST7263
58/109
Overrun Error
An overrun error occurs when a character is received when RDRF has not been reset. Data can
not be transferred from the shift register to the
TDR register as long as the RDRF bit is not
cleared.
When a overrun error occurs:
The OR bit is set.
The RDR content will not be lost.
The shift register will be overwritten.
An interrupt is generated if the RIE bit is set and
the I bit is cleared in the CC register.
The OR bit is reset by an access to the SR register
followed by a DR register read operation.
Noise Error
Oversampling techniques are used for data recovery by discriminating between valid incoming data
and noise.
When noise is detected in a frame:
The NF is set at the rising edge of the RDRF bit.
Data is transferred from the Shift register to the
DR register.
No interrupt is generated. However this bit rises
at the same time as the RDRF bit which itself
generates an interrupt.
The NF bit is reset by a SR register read operation
followed by a DR register read operation.
Framing Error
A framing error is detected when:
The stop bit is not recognized on reception at the
expected time, following either a de-synchronization or excessive noise.
A break is received.
When the framing error is detected:
The FE bit is set by hardware
Data is transferred from the Shift register to the
DR register.
No interrupt is generated. However this bit rises
at the same time as the RDRF bit which itself
generates an interrupt.
The FE bit is reset by a SR register read operation
followed by a DR register read operation.
ST7263
fCPU
(32*PR)*TR
Rx =
fCPU
(32*PR)*RR
with:
PR = 1, 3, 4 or 13 (see SCP0 & SCP1 bits)
TR = 1, 2, 4, 8, 16, 32, 64,128
(see SCT0, SCT1 & SCT2 bits)
RR = 1, 2, 4, 8, 16, 32, 64,128
(see SCR0,SCR1 & SCR2 bits)
All these bits are in the BRR register.
Example: If fCPU is 8 MHz and if PR=13 and
TR=RR=1, the transmit and receive baud rates are
19200 bauds.
Note: The baud rate registers MUST NOT be
changed while the transmitter or the receiver is enabled.
5.5.4.5 Receiver Muting and Wake-up Feature
In multiprocessor configurations it is often desirable that only the intended message recipient
59/109
ST7263
Description
No effect on SCI.
SCI interrupts exit from Wait mode.
SCI registers are frozen.
In Halt mode, the SCI stops transmitting/receiving until Halt mode is exited.
5.5.6 Interrupts
Interrupt Event
Transmit Data Register Empty
Transmission Complete
Received Data Ready to be Read
Overrrun Error Detected
Idle Line Detected
60/109
Enable
Control
Bit
TDRE
TIE
TC
TCIE
RDRF
RIE
OR
IDLE
ILIE
Event
Flag
Exit
from
Wait
Yes
Yes
Yes
Yes
Yes
Exit
from
Halt
No
No
No
No
No
ST7263
0
TC
RDRF
IDLE
OR
NF
FE
61/109
ST7263
0
T8
WAKE
0
TCIE
RIE
ILIE
TE
RE
RWU
SBK
62/109
ST7263
DR7
DR6
DR5
DR4
DR3
DR2
DR1
DR0
SCP1
SCP0
SCT2
SCT1
SCT0
SCR2
SCR1 SCR0
SCP1
SCP0
13
SCT2
SCT1
SCT0
16
32
64
128
SCR2
SCR1
SCR0
16
32
64
128
63/109
ST7263
Register
Label
20
SR
Reset Value
TDRE
1
TC
1
RDRF
0
IDLE
0
OR
0
NF
0
FE
0
0
0
21
DR
Reset Value
DR7
x
DR6
x
DR5
x
DR4
x
DR3
x
DR2
x
DR1
x
DR0
x
22
BRR
Reset Value
SCP1
0
SCP0
0
SCT2
x
SCT1
x
SCT0
x
SCR2
x
SCR1
x
SCR0
x
23
CR1
Reset Value
R8
x
T8
x
0
0
M
x
WAKE
x
0
0
0
0
0
0
24
CR2
Reset Value
TIE
0
TCIE
0
RIE
0
ILIE
0
TE
0
RE
0
RWU
0
SBK
0
64/109
ST7263
ENDPOINT
REGISTERS
USBDM
Transceiver
SIE
DMA
USBDP
CPU
Address,
data buses
and interrupts
USBVCC
3.3V
Voltage
Regulator
INTERRUPT
REGISTERS
MEMORY
USBGND
65/109
ST7263
DA7
DA15
0
DA14
DA13
DA12
DA11
DA10
DA9
DA6
EP1
EP0
CNT3
CNT2
CNT1
CNT0
DA8
101111
Endpoint 2 TX
101000
100111
Endpoint 2 RX
100000
011111
011000
010111
010000
001111
Endpoint 1 TX
Endpoint 1 RX
Endpoint 0 TX
001000
000111
Endpoint 0 RX
DA15-6,000000
66/109
000000
ST7263
TP3
TP2
RX_
SEZ
RXD
TP2
0
0
1
PID Name
OUT
IN
SETUP
7
SUSP
0
DOVR
CTR
ERR
IOVR
ESUSP
RESET
SOF
67/109
ST7263
0
DOV
RM
CTR
M
ERR
M
IOVR
M
ESU
SPM
RES
ETM
SOF
M
Bits 7:0 = These bits are mask bits for all interrupt
condition bits included in the ISTR. Whenever one
of the IMR bits is set, if the corresponding ISTR bit
is set, and the I bit in the CC register is cleared, an
interrupt request is generated. For an explanation
68/109
0
0
RESUME
PDWN
FSUSP
FRES
ST7263
0
ADD6
ADD5
ADD4
ADD3
ADD2
ADD1
ADD0
0
DTOG
_TX
STAT
_TX1
STAT
_TX0
TBC
3
TBC
2
TBC
1
TBC
0
69/109
ST7263
STAT_RX1
CTRL
NAK: the endpoint is naked and all reception requests result in a NAK
handshake.
VALID: this endpoint is
enabled for reception.
0
DTOG
_RX
STAT
_RX1
STAT
_RX0
EA3
EA2
EA1
EA0
STAT_RX0 Meaning
70/109
STAT_RX0 Meaning
DISABLED: reception
transfers cannot be executed.
STALL: the endpoint is
stalled and all reception
requests result in a
STALL handshake.
0
DTOG
RX
STAT
RX1
STAT
RX0
ST7263
When the operation is completed, they can be accessed again to enable a new operation.
5.6.5.4 Interrupt Handling
Start of Frame (SOF)
The interrupt service routine may monitor the SOF
events for a 1 ms synchronization event to the
USB bus. This interrupt is generated at the end of
a resume sequence and can also be used to detect this event.
USB Reset (RESET)
When this event occurs, the DADDR register is reset, and communication is disabled in all endpoint
registers (the USB interface will not respond to any
packet). Software is responsible for reenabling
endpoint 0 within 10 ms of the end of reset. To do
this, set the STAT_RX bits in the EP0RB register
to VALID.
Suspend (SUSP)
The CPU is warned about the lack of bus activity
for more than 3 ms, which is a suspend request.
The software should set the USB interface to suspend mode and execute an ST7 HALT instruction
to meet the USB-specified power constraints.
End Suspend (ESUSP)
The CPU is alerted by activity on the USB, which
causes an ESUSP interrupt. The ST7 automatically terminates HALT mode.
Correct Transfer (CTR)
1. When this event occurs, the hardware automatically sets the STAT_TX or STAT_RX to NAK.
Note: Every valid endpoint is NAKed until software clears the CTR bit in the ISTR register,
independently of the endpoint number
addressed by the transfer which generated the
CTR interrupt.
Note: If the event triggering the CTR interrupt is
a SETUP transaction, both STAT_TX and
STAT_RX are set to NAK.
2. Read the PIDR to obtain the token and the IDR
to get the endpoint number related to the last
transfer.
Note: When a CTR interrupt occurs, the TP3TP2 bits in the PIDR register and EP1-EP0 bits
in the IDR register stay unchanged until the
CTR bit in the ISTR register is cleared.
3. Clear the CTR bit in the ISTR register.
71/109
ST7263
72/109
Register
Name
TP3
TP2
RX_SEZ
RXD
Reset Value
DMAR
x
DA15
x
DA14
0
DA13
0
DA12
0
DA11
0
DA10
0
DA9
0
DA8
Reset Value
IDR
x
DA7
x
DA6
x
EP1
x
EP0
x
CNT3
x
CNT2
x
CNT1
x
CNT0
Reset Value
ISTR
x
SUSP
x
DOVR
x
CTR
x
ERR
0
IOVR
0
ESUSP
0
RESET
0
SOF
Reset Value
IMR
0
SUSPM
0
DOVRM
0
CTRM
0
ERRM
0
IOVRM
Reset Value
CTLR
0
0
0
0
0
0
0
0
0
RESUME
0
PDWN
0
FSUSP
0
FRES
Reset Value
DADDR
0
0
0
ADD6
0
ADD5
0
ADD4
0
ADD3
1
ADD2
1
ADD1
0
ADD0
Reset Value
EP0RA
0
ST_OUT
0
TBC3
0
TBC2
0
TBC1
0
TBC0
Reset Value
EP0RB
0
1
0
0
STAT_TX1
STAT_TX0
DTOG_TX
0
0
0
DTOG_RX STAT_RX1 STAT_RX0
x
0
x
0
x
0
x
0
Reset Value
EP1RA
1
ST_OUT
0
0
0
DTOG_TX STAT_TX1 STAT_TX0
0
TBC3
0
TBC2
0
TBC1
0
TBC0
Reset Value
EP1RB
0
CTRL
0
0
0
DTOG_RX STAT_RX1 STAT_RX0
x
EA3
x
EA2
x
EA1
x
EA0
Reset Value
EP2RA
0
ST_OUT
0
0
0
DTOG_TX STAT_TX1 STAT_TX0
x
TBC3
x
TBC2
x
TBC1
x
TBC0
Reset Value
EP2RB
0
CTRL
0
0
0
DTOG_RX STAT_RX1 STAT_RX0
x
EA3
x
EA2
x
EA1
x
EA0
Reset Value
PIDR
0
0
ESUSPM RESETM
0
SOFM
ST7263
MSB
SCL
1
START
CONDITION
9
STOP
CONDITION
VR02119B
73/109
ST7263
The SCL frequency (FSCL) is controlled by a programmable clock divider which depends on the IC
bus mode.
When the IC cell is enabled, the SDA and SCL
ports must be configured as floating open-drain
output or floating input. In this case, the value of
the external pull-up resistor used depends on the
application.
When the IC cell is disabled, the SDA and SCL
ports revert to being standard I/O port pins.
SDAI
DATA CONTROL
SDA
COMPARATOR
SCLI
SCL
CLOCK CONTROL
CONTROL LOGIC
INTERRUPT
74/109
ST7263
The slave waits for a read of the SR1 register followed by a write in the DR register, holding the
SCL line low (see Figure 3 Transfer sequencing
EV3).
When the acknowledge pulse is received:
The EVF and BTF bits are set by hardware with
an interrupt if the ITE bit is set.
Closing Slave Communication
After the last data byte is transferred a Stop Condition is generated by the master. The interface
detects this condition and sets:
EVF and STOPF bits with an interrupt if the ITE
bit is set.
Then the interface waits for a read of the SR2 register (see Figure 3 Transfer sequencing EV4).
Error Cases
BERR: Detection of a Stop or a Start condition
during a byte transfer. In this case, the EVF and
BERR bits are set with an interrupt if the ITE bit
is set.
If it is a Stop condition, then the interface discards the data, released the lines and waits for
another Start condition.
If it is a Start condition, then the interface discards the data and waits for the next slave address on the bus.
AF: Detection of a non-acknowledge bit. In this
case, the EVF and AF bits are set with an interrupt if the ITE bit is set.
Note: In both cases, the SCL line is not held low;
however, the SDA line can remain low due to possible 0 bits transmitted last. It is then necessary
to release both lines by software.
How to Release the SDA / SCL lines
Set and subsequently clear the STOP bit while
BTF is set. The SDA/SCL lines are released after
the transfer of the current byte.
Slave Transmitter
Following the address reception and after the SR1
register has been read, the slave sends bytes from
the DR register to the SDA line via the internal shift
register.
75/109
ST7263
76/109
ST7263
Data1
EV1
Data2
EV2
EV2
.....
DataN
P
EV2
EV4
Slave Transmitter
S Address
Data1
EV1 EV3
Data2
EV3
EV3
.....
DataN
NA
P
EV3-1
EV4
Master Receiver
S
Address
EV5
Data1
EV6
Data2
EV7
EV7
.....
DataN
NA
P
EV7
Master Transmitter
S
Address
EV5
Data1
EV6 EV8
Data2
EV8
A
EV8
.....
DataN
P
EV8
Legend:
S=Start, P=Stop, A=Acknowledge, NA=Non-acknowledge
EVx=Event (with interrupt if ITE=1)
EV1: EVF=1, ADSL=1, cleared by reading the SR1 register.
EV2: EVF=1, BTF=1, cleared by reading the SR1 register followed by reading the DR register.
EV3: EVF=1, BTF=1, cleared by reading the SR1 register followed by writing the DR register.
EV3-1: EVF=1, AF=1, BTF=1; AF is cleared by reading the SR1 register. The BTF is cleared
by releasing the lines (STOP=1, STOP=0) or by writing the DR register (DR=FFh).
Note: If lines are released by STOP=1, STOP=0, the subsequent EV4 is not seen.
EV4: EVF=1, STOPF=1, cleared by reading the SR2 register.
EV5: EVF=1, SB=1, cleared by reading the SR1 register followed by writing the DR register.
EV6: EVF=1, cleared by reading the SR1 register followed by writing the CR register
(for example PE=1).
EV7: EVF=1, BTF=1, cleared by reading the SR1 register followed by reading the DR register.
EV8: EVF=1, BTF=1, cleared by reading the SR1 register followed by writing the DR register.
77/109
ST7263
HALT
Description
No effect on IC interface.
IC interrupts exit from Wait mode.
IC registers are frozen.
In Halt mode, the IC interface is inactive and does not acknowledge data on the bus. The IC
interface resumes operation when the MCU is woken up by an interrupt with exit from Halt
mode capability.
5.7.6 Interrupts
Figure 41. Event Flags and Interrupt Generation
BTF
ADSL
SB
AF
STOPF
ARLO
BERR
ITE
INTERRUPT
EVF
*
* EVF can also be set by EV6 or an error from the SR2 register.
Interrupt Event
End of Byte Transfer Event
Address Matched Event (Slave mode)
Start Bit Generation Event (Master mode)
Acknowledge Failure Event
Stop Detection Event (Slave mode)
Arbitration Lost Event (Multimaster configuration)
Bus Error Event
78/109
Event
Flag
Enable
Control
Bit
BTF
ADSEL
SB
AF
STOPF
ARLO
BERR
ITE
Exit
from
Wait
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Exit
from
Halt
No
No
No
No
No
No
No
ST7263
0
0
PE
ENGC START
ACK
STOP
ITE
79/109
ST7263
0
0
TRA
BUSY
BTF
ADSL
M/SL
SB
80/109
ST7263
0
0
AF
81/109
ST7263
CC6
CC5
CC4
CC3
CC2
CC1
CC0
ADD7
0
D6
D5
D4
D3
D2
D1
D0
82/109
0
ADD6
ADD5
ADD4
ADD3
ADD2
ADD1
ADD0
ST7263
Register
Name
DR
OAR
CCR
SR2
SR1
CR
FM/SM
EVF
TRA
PE
DR7 .. DR0
ADD7 .. ADD0
CC6 .. CC0
AF
STOPF
BUSY
BTF
ENGC
START
ARLO
ADSL
ACK
BERR
M/SL
STOP
GCAL
SB
ITE
83/109
ST7263
COCO
ADON
CH2
CH1
CH0
ANALOG
MUX
fCPU
SAMPLE
&
HOLD
ANALOG TO
DIGITAL
CONVERTER
AD7
AD6
AD5
AD4
AD3
AD2
AD1
(Data Register) DR
84/109
AD0
ST7263
VDDA
0.1F
VSSA
ST7
RAIN
VAIN
Px.x/AINx
Characteristics:
The conversion is monotonic, meaning the result
never decreases if the analog input does not and
never increases if the analog input does not.
If input voltage is greater than or equal to VDD
(voltage reference high) then results = FFh (full
scale) without overflow indication.
If input voltage VSS (voltage reference low) then
the results = 00h.
The conversion time is 64 CPU clock cycles including a sampling time of 31.5 CPU clock cycles.
RAIN is the maximum recommended impedance
for an analog input signal. If the impedance is too
high, this will result in a loss of accuracy due to
leakage and sampling not being completed in the
alloted time.
The A/D converter is linear and the digital result of
the conversion is given by the formula:
Digital result =
HALT
Description
No effect on A/D Converter
A/D Converter disabled.
After wakeup from Halt mode, the A/D
Converter requires a stabilisation time
before accurate conversions can be
performed.
5.8.5 Interrupts
None.
85/109
ST7263
0
-
ADON
CH2
CH1
CH0
86/109
Pin*
CH2
CH1
CH0
AIN0
AIN1
AIN2
AIN3
AIN4
AIN5
AIN6
AIN7
0
AD6
AD5
AD4
AD3
AD2
AD1
AD0
ST7263
6 INSTRUCTION SET
6.1 ST7 ADDRESSING MODES
The ST7 Core features 17 different addressing
modes which can be classified in 7 main groups:
Addressing Mode
Example
Inherent
nop
Immediate
ld A,#$55
Direct
ld A,$55
Indexed
ld A,($55,X)
Indirect
ld A,([$55],X)
Relative
jrne loop
Bit operation
bset
byte,#5
so, most of the addressing modes may be subdivided in two sub-modes called long and short:
Long addressing mode is more powerful because it can use the full 64 Kbyte address space,
however it uses more bytes and more CPU cycles.
Short addressing mode is less powerful because
it can generally only access page zero (0000h 00FFh range), but the instruction size is more
compact, and faster. All memory to memory instructions use short addressing modes only
(CLR, CPL, NEG, BSET, BRES, BTJT, BTJF,
INC, DEC, RLC, RRC, SLL, SRL, SRA, SWAP)
The ST7 Assembler optimizes the use of long and
short addressing modes.
Syntax
Pointer
Address
(Hex.)
Destination/
Source
Pointer
Size
(Hex.)
Length
(Bytes)
Inherent
nop
+0
Immediate
ld A,#$55
+1
Short
Direct
ld A,$10
00..FF
+1
Long
Direct
ld A,$1000
0000..FFFF
+2
No Offset
Direct
Indexed
ld A,(X)
00..FF
+ 0 (with X register)
+ 1 (with Y register)
Short
Direct
Indexed
ld A,($10,X)
00..1FE
+1
Long
Direct
Indexed
Short
Indirect
ld A,($1000,X)
0000..FFFF
ld A,[$10]
00..FF
+2
00..FF
byte
+2
Long
Indirect
ld A,[$10.w]
0000..FFFF
00..FF
word
+2
Short
Indirect
Indexed
ld A,([$10],X)
00..1FE
00..FF
byte
+2
Long
Indirect
Indexed
ld A,([$10.w],X)
0000..FFFF
00..FF
word
+2
00..FF
byte
00..FF
byte
1)
Relative
Direct
jrne loop
PC-128/PC+127
Relative
Indirect
jrne [$10]
PC-128/PC+1271)
Bit
Direct
bset $10,#7
00..FF
Bit
Indirect
bset [$10],#7
00..FF
Bit
Direct
Relative
btjt $10,#7,skip
00..FF
Bit
Indirect
Relative
+1
+2
+1
+2
+2
00..FF
byte
+3
Note 1. At the time the instruction is executed, the Program Counter (PC) points to the instruction following JRxx.
87/109
ST7263
Function
NOP
No operation
TRAP
S/W Interrupt
WFI
HALT
RET
Sub-routine Return
IRET
SIM
RIM
SCF
RCF
RSP
LD
Load
CLR
Clear
PUSH/POP
INC/DEC
Increment/Decrement
TNZ
CPL, NEG
1 or 2 Complement
MUL
Byte Multiplication
SWAP
Swap Nibbles
6.1.2 Immediate
Immediate instructions have two bytes, the first
byte contains the opcode, the second byte contains the operand value.
Immediate Instruction
Function
LD
Load
CP
Compare
BCP
Bit Compare
Logical Operations
Arithmetic Operations
88/109
6.1.3 Direct
In Direct instructions, the operands are referenced
by their memory address.
The direct addressing mode consists of two submodes:
Direct (short)
The address is a byte, thus requires only one byte
after the opcode, but only allows 00 - FF addressing space.
Direct (long)
The address is a word, thus allowing 64 Kbyte addressing space, but requires 2 bytes after the opcode.
6.1.4 Indexed (No Offset, Short, Long)
In this mode, the operand is referenced by its
memory address, which is defined by the unsigned
addition of an index register (X or Y) with an offset.
The indirect addressing mode consists of three
sub-modes:
Indexed (No Offset)
There is no offset, (no extra byte after the opcode),
and allows 00 - FF addressing space.
Indexed (Short)
The offset is a byte, thus requires only one byte after the opcode and allows 00 - 1FE addressing
space.
Indexed (long)
The offset is a word, thus allowing 64 Kbyte addressing space and requires 2 bytes after the opcode.
6.1.5 Indirect (Short, Long)
The required data byte to do the operation is found
by its memory address, located in memory (pointer).
The pointer address follows the opcode. The indirect addressing mode consists of two sub-modes:
Indirect (short)
The pointer address is a byte, the pointer size is a
byte, thus allowing 00 - FF addressing space, and
requires 1 byte after the opcode.
Indirect (long)
The pointer address is a byte, the pointer size is a
word, thus allowing 64 Kbyte addressing space,
and requires 1 byte after the opcode.
ST7263
SWAP
Swap Nibbles
CALL, JP
Function
JRxx
Conditional Jump
CALLR
Call Relative
Function
LD
Load
CP
Compare
Logical Operations
BCP
Bit Compare
Function
CLR
Clear
INC, DEC
Increment/Decrement
TNZ
CPL, NEG
1 or 2 Complement
BSET, BRES
Bit Operations
BTJT, BTJF
89/109
ST7263
LD
CLR
Stack operation
PUSH
POP
Increment/Decrement
INC
DEC
CP
TNZ
BCP
Logical operations
AND
OR
XOR
CPL
NEG
Bit Operation
BSET
BRES
BTJT
BTJF
Arithmetic operations
ADC
ADD
SUB
SBC
MUL
SLL
SRL
SRA
RLC
RRC
SWAP
SLA
JRA
JRT
JRF
JP
CALL
CALLR
NOP
Conditional Branch
JRxx
Interruption management
TRAP
WFI
HALT
IRET
SIM
RIM
SCF
RCF
Using a pre-byte
The instructions are described with one to four
bytes.
In order to extend the number of available opcodes for an 8-bit CPU (256 opcodes), three different prebyte opcodes are defined. These prebytes
modify the meaning of the instruction they precede.
The whole instruction becomes:
PC-2 End of previous instruction
PC-1 Prebyte
PC
Opcode
PC+1 Additional word (0 to 2) according to the
number of bytes required to compute the
effective address
90/109
RSP
RET
ST7263
Description
Function/Example
Dst
Src
ADC
A=A+M+C
ADD
Addition
A=A+M
AND
Logical And
A=A.M
BCP
tst (A . M)
BRES
Bit Reset
bres Byte, #3
BSET
Bit Set
bset Byte, #3
BTJF
BTJT
CALL
Call subroutine
CALLR
CLR
Clear
CP
Arithmetic Compare
tst(Reg - M)
reg
reg, M
CPL
One Complement
A = FFH-A
DEC
Decrement
dec Y
HALT
Halt
IRET
Pop CC, A, X, PC
INC
Increment
inc X
JP
Absolute Jump
jp [TBL.w]
JRA
JRT
Jump relative
JRF
Never jump
JRIH
JRIL
JRH
Jump if H = 1
H=1?
JRNH
Jump if H = 0
H=0?
JRM
Jump if I = 1
I=1?
JRNM
Jump if I = 0
I=0?
JRMI
Jump if N = 1 (minus)
N=1?
JRPL
Jump if N = 0 (plus)
N=0?
JREQ
Jump if Z = 1 (equal)
Z=1?
JRNE
Z=0?
JRC
Jump if C = 1
C=1?
JRNC
Jump if C = 0
C=0?
JRULT
Jump if C = 1
Unsigned <
JRUGE
Jump if C = 0
JRUGT
Jump if (C + Z = 0)
Unsigned >
reg, M
reg, M
0
H
reg, M
jrf *
91/109
ST7263
Description
Function/Example
Dst
Src
JRULE
Jump if (C + Z = 1)
Unsigned <=
LD
Load
reg, M
M, reg
MUL
Multiply
X,A = X * A
A, X, Y
X, Y, A
NEG
neg $10
reg, M
NOP
No Operation
OR
OR operation
A=A+M
POP
pop reg
reg
pop CC
CC
reg, CC
PUSH
push Y
RCF
C=0
RET
Subroutine Return
RIM
Enable Interrupts
I=0
RLC
reg, M
RRC
reg, M
RSP
S = Max allowed
SBC
A=A-M-C
SCF
C=1
SIM
Disable Interrupts
I=1
SLA
reg, M
SLL
reg, M
SRL
reg, M
SRA
reg, M
SUB
Subtraction
A=A-M
SWAP
SWAP nibbles
TNZ
tnz lbl1
TRAP
S/W trap
S/W interrupt
WFI
XOR
Exclusive OR
92/109
1
1
1
0
A = A XOR M
ST7263
7 ELECTRICAL CHARACTERISTICS
7.1 ABSOLUTE MAXIMUM RATINGS
Devices of the ST72 family contain circuitry to protect the inputs against damage due to high static
voltage or electric fields. Nevertheless, it is recommended that normal precautions be observed in
order to avoid subjecting this high-impedance circuit to voltages above those quoted in the Absolute Maximum Ratings. For proper operation, it is
recommended that the input voltage V IN be constrained within the range:
(VSS - 0.3V) VIN (VDD + 0.3V)
To enhance reliability of operation, it is recommended to configure unused I/Os as inputs and to
Ratings
Value
Unit
- 0.3 to +6.0
- 0.3 to +6.0
|VDDA - VDD|
50
mV
|VSSA - VSS|
50
mV
IVDD - IVSS
VIN
VOUT
80/80
mA
Output Voltage
TA
TSTG
TL to TH
0 to + 70
-65 to +150
TJ
Junction Temperature
150
PD
Power Dissipation
350
mW
ESD
ESD susceptibility
2000
93/109
ST7263
Package
Typical Value
SO34
70
PSDIP32
50
(*): Maximum chip dissipation can directly be obtained from Tj (max), JA and TA parameters.
94/109
Unit
C/W
ST7263
VDD
fOSC
Parameter
Supply voltage
1)
Min
Max
Unit
Conditions
3.00
4.00
VIT+
4.00
4.0
5.25
5.25
5.50
12
24
MHz
Note 1: USB 1.1 specifies that the power supply must be between 4.00 and 5.25 Volts. The USB cell is
therefore guaranteed only in that range.
95/109
ST7263
Parameter
VDD
Conditions
Min
Typ.
Max
Unit
5.5
IDD
5.5
14
20
mA
fCPU = 8 MHz,
TA = 20C
350
12
mA
100
450
Note 1:
Note 2:
Note 3:
CPU in HALT mode, USB Transceiver disabled, Low Voltage Reset function enabled.
Note 4:
Note 5:
96/109
ST7263
VOL
VOH
VOH
VIH
VIL
RPU
Parameter
Conditions
Min
Typ
Max
Unit
1.5
0.4
1.3
IOH = 1.6mA
VDD-0.8
IOH = 10mA
VDD-1.3
Leading Edge
0.7xVDD
VDD
Trailing Edge
VSS
0.3xVDD
VDD = 5V
80
120
CIO
Pull-up resistor
I/O Pin Capacitance 1)
tf(IO)out
tr(IO)out
tr(IO)out
CL=50pF
Between 10% and 90%
1
100
5
pF
25 2)
ns
25 2)
ns
tCPU
97/109
ST7263
Parameter
Conditions
Min
Typ
Max
Unit
3.6
3.75
4.0
3.2
3.5
3.7
200
250
VDD rising
Low Voltage Reset Threshold
VDD falling
Hysteresis (VIT+ - VIT-)
mV
Parameter
Conditions
Value
Min
Typ.
Max
Unit
fOSC
Oscillator Frequency
24
MHz
fCPU
Operating Frequency
MHz
tRL
External RESET
Input pulse Width
1.5
tCPU
tPORL
4096
tCPU
TDOGL
200
ns
tDOG
tOXOV
tDDR
Watchdog Time-out
fcpu = 8MHz
Crystal Oscillator
Start-up Time
Power up rise time
from VDD = 0 to 4V
49152
3145728
tCPU
384
ms
50
ms
100
ms
Note 1: The minimum period t ILIL should not be less than the number of cycle times it takes to execute the
interrupt service routine plus 21 cycles.
C
98/109
ST7263
Symbol
Conditions
Min.
Max.
Unit
Input Levels:
Differential Input Sensitivity
VDI
I(D+, D-)
0.2
VCM
0.8
2.5
V
V
VSE
0.8
2.0
0.3
Output Levels
Static Output Low
VOL
VOH
2.8
3.6
USBV
VDD=5v
3.00
3.60
99/109
ST7263
Differential
Data Lines
Crossover
points
VCRS
VSS
tr
tf
Symbol
Conditions
Min
Rise time
tr
Note 1,CL=50 pF
75
Fall Time
tf
trfm
VCRS
Max
Unit
Driver characteristics:
Note 1, CL=600 pF
Note 1, CL=50 pF
300
75
Note 1, CL=600 pF
tr/tf
ns
ns
ns
300
ns
80
120
1.3
2.0
Note1: Measured from 10% to 90% of the data signal. For more detailed informations, please refer to Chapter 7 (Electrical) of the USB specification (version 1.1).
100/109
ST7263
Standard I2C
Min
Fast I2C
Max
Min
Max
Symbol
Unit
4.7
1.3
TBUF
ms
4.0
0.6
THD:STA
4.7
1.3
TLOW
4.0
0.6
THIGH
4.7
0.6
TSU:STA
0 (1)
0 (1)
THD:DAT
ns
250
TSU:DAT
ns
TR
ns
100
1000
0.9(2)
300
4.0
20+0.1Cb
300
20+0.1Cb
300
0.6
400
400
TF
ns
TSU:STO
ns
Cb
pF
1) The device must internally provide a hold time of at least 300 ns for the SDA signal in order to bridge the undefined
region of the falling edge of SCL
2) The maximum hold time of the START condition has only to be met if the interface does not stretch the low period of
SCL signal
Cb = total capacitance of one bus line in pF
101/109
ST7263
GE
255
254
253
1LSB
i deal
V
V
DDA
SSA
= ----------------------------------------256
(2)
(3)
TUE
(1)
6
5
4
ILE
OE
DLE
1 LSB(ideal)
1
0
1
VSSA
Vin (LSBideal)
2
Parameter
|TUE|
OE
Offset error*
GE
Gain Error*
|DLE|
|ILE|
VAIN
IADC
tSTAB
Conditions
Min
Typ
Max
Unit
2
fADC=fCPU=4MHz
VDD=VDDA=5V
-1
-2
LSB
1
2
VSSA
VDDA
1
mA
30
fADC=fCPU=4MHz
VDD=VDDA=5V
V
s
8
32
s
1/fADC
8
32
s
1/fADC
tLOAD
tCONV
RAIN
20
RADC
18
22
pF
102/109
ST7263
VDD
Sampling
Switch
VT = 0.6V
RAIN
VAIN
SS
Px.x/AINx
Cpin
VT
= input capacitance
= threshold voltage
SS
= sampling switch
Chold
= sample/hold
capacitance
leakage = leakage current
at the pin due
to various junctions
Cpin
5pF
Chold
22.4 pF
VT = 0.6V
leakage
1A
VSS
103/109
ST7263
8 PACKAGE CHARACTERISTICS
8.1 PACKAGE MECHANICAL DATA
Figure 45. 34-Pin Shrink Plastic Small Outline Package, 300-mil Width
mm
Dim.
0.10mm
.004
seating plane
Min
inches
Typ
Max
Min
Typ
Max
2.46
2.64 0.097
0.104
A1
0.13
0.29 0.005
0.0115
0.36
0.48 0.014
0.019
0.23
0.32 0.0091
0.0125
17.73
18.06 0.698
0.711
7.42
7.59 0.292
0.299
1.02
0.040
10.16
10.41 0.400
0.410
0.64
0.74 0.025
0.029
0.61
1.02 0.024
K
L
8
0.040
Number of Pins
N
34
SO34S
Figure 46. 32-Pin Shrink Plastic Dual in Line Package, 400-mil Width
E
Dim.
inches
Max
Min
Typ
A1
0.51
A2
3.05 3.56
eA
0.36 0.46
eB
0.020
b1
0.76 1.02
0.20 0.25
E1
7.62 8.89
A2
E1
A1
N/2
1.78
0.070
eA
10.16
0.400
eB
e
VR01725J
12.70
2.54 3.05
0.500
Number of Pins
104/109
Max
3.56 3.76
e3
Typ
b1
mm
Min
32
ST7263
mm
Min
Typ
Min
Typ
3.63
Max
0.143
A1
0.38
0.015
0.36
B1
0.64
0.20
D1
26.67
1.050
10.16
0.400
E1
CDIP32SW
inches
Max
9.45
1.78
9.40
0.070
0.370
G1
14.73
0.580
G2
1.12
0.044
3.30
0.130
7.37
0.290
Number of Pins
N
32
105/109
ST7263
106/109
Program
Memory
(bytes)
16K EPROM
16K ROM
16K OTP
16K ROM
16K OTP
8K ROM
8K OTP
8K ROM
8K OTP
4K ROM
4K OTP
4K ROM
4K OTP
Note 1. /xxx stands for the ROM code name assigned by STMicroelectronics.
RAM
Package
(bytes)
CSDIP32
512
SO34
PSDIP32
SO34
256
PSDIP32
SO34
256
PSDIP32
ST72E63-EPB/EU
ST72E63-EPB/US
Remarks
220V Power
Supply
110V Power
Supply
ST7263
....
....
....
Contact:
....
Phone No: . . . .
Reference : . . . .
.......
.......
.......
.......
.......
.......
......
......
......
......
......
......
......
......
......
......
......
......
.....
.....
.....
.....
.....
.....
STMicroelectronics references:
Device:
[ ] ST72631K4
[ ] ST72632K2
[ ] ST72633K1
Package:
Special Marking:
[ ] No
[ ] Yes "_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _"
For marking, one line is possible with maximum 13 characters.
Authorized characters are letters, digits, ., -, / and spaces only.
We have checked the ROM code verification file returned to us by STMicroelectronics. It conforms
exactly with the ROM code file orginally supplied. We therefore authorize STMicroelectronics to
proceed with device manufacture.
Signature
............................
Date
............................
107/109
ST7263
108/109
ST7263
10 SUMMARY OF CHANGES
Description of the changes between the current release of the specification and the previous one.
Revision
1.8
Main changes
Changed status of the document (datasheet instead of preliminary data).
Added Section 9.2 and section 9.3 on page 108.
Date
August 00
Information furnished is believed to be accurate and reliable. However, STMicroelectronics assumes no responsibility for the consequences
of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted
by implication or otherwise under any patent or patent rights of STMicroelectronics. Specifications mentioned in this publication are subject
to change without notice. This publication supersedes and replaces all information previously supplied. STMicroelectronics products are not
authorized for use as critical components in life support devices or systems without the express written approval of STMicroelectronics.
The ST logo is a registered trademark of STMicroelectronics
2001 STMicroelectronics - All Rights Reserved.
Purchase of I2C Components by STMicroelectronics conveys a license under the Philips I2C Patent. Rights to use these components in an
I2C system is granted provided that the system conforms to the I2C Standard Specification as defined by Philips.
STMicroelectronics Group of Companies
Australia - Brazil - China - Finland - France - Germany - Hong Kong - India - Italy - Japan - Malaysia - Malta - Morocco - Singapore - Spain
Sweden - Switzerland - United Kingdom - U.S.A.
http://www.st.com
109/109