89E516RD2 SiliconStorageTechnology PDF
89E516RD2 SiliconStorageTechnology PDF
PRODUCT DESCRIPTION
The SST89E5xxRD2 and SST89V5xxRD2 are members In addition to the 16/24/40/72 KByte of EEPROM program
of the FlashFlex51 family of 8-bit microcontroller products memory on-chip, the devices can address up to 64 KByte
designed and manufactured with SST’s patented and pro- of external program memory. In addition to 1024 x8 bits of
prietary SuperFlash CMOS semiconductor process tech- on-chip RAM, up to 64 KByte of external RAM can be
nology. The split-gate cell design and thick-oxide tunneling addressed.
injector offer significant cost and reliability benefits for SST’s
The flash memory blocks can be programmed via a stan-
customers. The devices use the 8051 instruction set and
dard 87C5x OTP EPROM programmer fitted with a special
are pin-for-pin compatible with standard 8051 microcontrol-
adapter and the firmware for SST’s devices. During power-
ler devices.
on reset, the devices can be configured as either a slave to
The devices come with 16/24/40/72 KByte of on-chip flash an external host for source code storage or a master to an
EEPROM program memory which is partitioned into 2 external host for an in-application programming (IAP) oper-
independent program memory blocks. The primary Block 0 ation. The devices are designed to be programmed in-sys-
occupies 8/16/32/64 KByte of internal program memory tem and in-application on the printed circuit board for
space and the secondary Block 1 occupies 8 KByte of maximum flexibility. The devices are pre-programmed with
internal program memory space. an example of the bootstrap loader in the memory, demon-
strating the initial user program code loading or subsequent
The 8-KByte secondary block can be mapped to the lowest
user code updating via the IAP operation. The sample
location of the 8/16/32/64 KByte address space; it can also
bootstrap loader is available for the user’s reference and
be hidden from the program counter and used as an inde-
convenience only; SST does not guarantee its functionality
pendent EEPROM-like data memory.
or usefulness. Chip-Erase or Block-Erase operations will
erase the pre-programmed sample code.
©2004 Silicon Storage Technology, Inc. The SST logo, SuperFlash, and FlashFlex are registered trademarks of Silicon Storage Technology, Inc.
S71255-00-000 3/04 These specifications are subject to change without notice.
1
Free Datasheet http://www.datasheetlist.com/
FlashFlex51 MCU
SST89E52RD2 / SST89E54RD2 / SST89E58RD2 / SST89E516RD2
SST89V52RD2 / SST89V54RD2 / SST89V58RD2 / SST89V516RD2
Preliminary Specifications
TABLE OF CONTENTS
PRODUCT DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
LIST OF TABLES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
5.0 TIMERS/COUNTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.1 Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.2 Timer Set-up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
5.3 Programmable Clock-Out. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
10.0 RESET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
10.1 Power-on Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
10.2 Software Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
10.3 Brown-out Detection Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
11.0 INTERRUPTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
11.1 Interrupt Priority and Polling Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
LIST OF FIGURES
FIGURE 2-1: Pin Assignments for 40-pin PDIP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
FIGURE 2-2: Pin Assignments for 44-lead TQFP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
FIGURE 2-3: Pin Assignments for 44-lead PLCC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
FIGURE 3-1: Program Memory Organization for 8 KByte SST89E/V52RD2. . . . . . . . . . . . . . . . . . . . . . . . 11
FIGURE 3-2: Program Memory Organization for 16 KByte SST89E/V54RD2. . . . . . . . . . . . . . . . . . . . . . . 12
FIGURE 3-3: Program Memory Organization for 32 KByte SST89E/V58RD2. . . . . . . . . . . . . . . . . . . . . . . 12
FIGURE 3-4: Program Memory Organization for 64 KByte SST89E/V516RD2. . . . . . . . . . . . . . . . . . . . . . 13
FIGURE 3-5: Internal and External Data Memory Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
FIGURE 3-6: Dual Data Pointer Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
FIGURE 4-1: I/O Pin Assignments for External Host Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
FIGURE 6-1: Framing Error Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
FIGURE 6-2: UART Timings in Mode 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
FIGURE 6-3: UART Timings in Modes 2 and 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
FIGURE 6-4: SPI Master-slave Interconnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
FIGURE 6-5: SPI Transfer Format with CPHA = 0. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
FIGURE 6-6: SPI Transfer Format with CPHA = 1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
FIGURE 7-1: Block Diagram of Programmable Watchdog Timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
FIGURE 8-1: PCA Timer/Counter and Compare/Capture Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
FIGURE 8-2: PCA Capture Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
FIGURE 8-3: PCA Compare Mode (Software Timer). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
FIGURE 8-4: PCA High Speed Output Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
FIGURE 8-5: PCA Pulse Width Modulator Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
FIGURE 8-6: PCA Watchdog Timer (Module 4 only) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
FIGURE 9-1: Security Lock Levels. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
FIGURE 10-1: Power-on Reset Circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
FIGURE 11-1: Interrupt Structure. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
FIGURE 13-1: Oscillator Characteristics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
FIGURE 14-1: IDD vs. Frequency for 3V SST89V5xxRD2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
FIGURE 14-2: IDD vs. Frequency for 5V SST89E5xxRD2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
FIGURE 14-3: External Program Memory Read Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
FIGURE 14-4: External Data Memory Read Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
FIGURE 14-5: External Data Memory Write Cycle. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
FIGURE 14-6: External Clock Drive Waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
FIGURE 14-7: Shift Register Mode Timing Waveforms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
FIGURE 14-8: AC Testing Input/Output Test Waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
FIGURE 14-9: Float Waveform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
FIGURE 14-10: A Test Load Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
FIGURE 14-11: IDD Test Condition, Active Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
FIGURE 14-12: IDD Test Condition, Idle Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
FIGURE 14-13: IDD Test Condition, Power-down Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
FIGURE 14-14: Read-ID . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
LIST OF TABLES
TABLE 2-1: Pin Descriptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
TABLE 3-1: SFCF Values for Program Memory Block Switching for SST89E/V516RD2 . . . . . . . . . . . . . 13
TABLE 3-2: SFCF Values for Program Memory Block Switching for SST89E/V5xRD2 . . . . . . . . . . . . . . 13
TABLE 3-3: SFCF Values Under Different Reset Conditions (SST89E/V5xRD2) . . . . . . . . . . . . . . . . . . . 14
TABLE 3-4: SFCF Values Under Different Reset Conditions (SST89E/V516RD2) . . . . . . . . . . . . . . . . . . 14
TABLE 3-5: External Data Memory RD#, WR# with EXTRAM bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
TABLE 3-6: FlashFlex51 SFR Memory Map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
TABLE 3-7: CPU related SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
TABLE 3-8: Flash Memory Programming SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
TABLE 3-9: Watchdog Timer SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
TABLE 3-10: Timer/Counters SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
TABLE 3-11: Interface SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
TABLE 3-12: PCA SFRs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
TABLE 4-1: External Host Mode Commands for SST89E/V5xRD2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
TABLE 4-2: External Host Mode Commands for SST89E/V516RD2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
TABLE 4-3: Product Identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
TABLE 4-4: Additional Read Commands in External Host Mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
TABLE 4-5: IAP Address Resolution for SST89E/V516RD2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
TABLE 4-6: IAP Commands for SST89E/V516RD2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
TABLE 4-7: IAP Commands for SST89E/V5xRD2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
TABLE 5-1: Timer/Counter 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
TABLE 5-2: Timer/Counter 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
TABLE 5-3: Timer/Counter 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
TABLE 8-1: PCA Timer/Counter Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
TABLE 8-2: PCA Timer/Counter Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
TABLE 8-3: CMOD Values. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
TABLE 8-4: PCA High and Low Register Compare/Capture Modules. . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
TABLE 8-5: PCA Module Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
TABLE 8-6: PCA Module Modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
TABLE 8-7: Pulse Width Modulator Frequencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
8051
CPU Core
ALU,
ACC,
B-Register,
Instruction Register,
Program Counter,
Timing and Control
Interrupt
Oscillator 10 Interrupts
Control
SuperFlash
EEPROM RAM
Primary 1K x8
Block
8K/16K/32K/64K x8
8
I/O Port 0 I/O
Secondary
Block 8
Security
8K x8 I/O Port 1 I/O
Lock
8
I/O Port 2 I/O
Timer 0 (16-bit) 8
I/O Port 3 I/O
Timer 1 (16-bit) 4
I/O Port 4 I/O
PCA
Enhanced
UART
1255 B1.0
P4.2/INT3#
P0.0 (AD0)
P0.1 (AD1)
P0.2 (AD2)
P0.3 (AD3)
P1.2 (ECI)
37 P0.2 (AD2)
P1.0 (T2)
(CEX0) P1.3 4
36 P0.3 (AD3)
VDD
(CEX1 / SS#) P1.4 5
(CEX2 / MOSI) P1.5 6 35 P0.4 (AD4)
(CEX3 / MISO) P1.6 7 34 P0.5 (AD5) 44 43 42 41 40 39 38 37 36 35 34
40-pin PDIP
(CEX2 / MOSI) P1.5 1 33 P0.4 (AD4)
(CEX4 / SCK) P1.7 8 Top View 33 P0.6 (AD6)
(CEX3 / MISO) P1.6 2 32 P0.5 (AD5)
RST 9 32 P0.7 (AD7)
(CEX4 / SCK) P1.7 3 31 P0.6 (AD6)
(RXD) P3.0 10 31 EA# RST 4 30 P0.7 (AD7)
(TXD) P3.1 11 30 ALE/PROG# (RXD) P3.0 5 29 EA#
INT2#/P4.3
44-lead TQFP
(INT0#) P3.2 12 29 PSEN# 6 28 P4.1
(TXD) P3.1 7
Top View 27 ALE/PROG#
(INT1#) P3.3 13 28 P2.7 (A15)
(INT0#) P3.2 8 26 PSEN#
(T0) P3.4 14 27 P2.6 (A14) (INT1#) P3.3 9 25 P2.7 (A15)
(T1) P3.5 15 26 P2.5 (A13) (T0) P3.4 10 24 P2.6 (A14)
25 P2.4 (A12) (T1) P3.5 11 23 P2.5 (A13)
(WR#) P3.6 16 12 13 14 15 16 17 18 19 20 21 22
(RD#) P3.7 17 24 P2.3 (A11)
23 P2.2 (A10)
(WR#) P3.6
(RD#) P3.7
XTAL2
XTAL1
VSS
P4.0
(A8) P2.0
(A9) P2.1
(A10) P2.2
(A11) P2.3
(A12) P2.4
XTAL2 18
22 P2.1 (A9) 1255 44-tqfp TQJ P2.0
XTAL1 19
VSS 20 21 P2.0 (A8)
FIGURE 2-1: PIN ASSIGNMENTS FOR 40-PIN PDIP FIGURE 2-2: PIN ASSIGNMENTS FOR 44-LEAD TQFP
P1.4 (SS# / CEX1)
P4.2/INT3#
P0.0 (AD0)
P0.1 (AD1)
P0.2 (AD2)
P0.3 (AD3)
P1.2 (ECI)
P1.0 (T2)
VDD
6 5 4 3 2 1 44 43 42 41 40
(CEX2 / MOSI) P1.5 7 39 P0.4 (AD4)
(CEX3 / MISO) P1.6 8 38 P0.5 (AD5)
(CEX4 / SCK) P1.7 9 37 P0.6 (AD6)
RST 10 36 P0.7 (AD7)
(RXD) P3.0 11 44-lead PLCC 35 EA#
INT2#/P4.3 12 Top View 34 P4.1
(TXD) P3.1 13 33 ALE/PROG#
(INT0#) P3.2 14 32 PSEN#
(INT1#) P3.3 15 31 P2.7 (A15)
(T0) P3.4 16 30 P2.6 (A14)
(T1) P3.5 17 29 P2.5 (A13)
18 19 20 21 22 23 24 25 26 27 28
(WR#) P3.6
(RD#) P3.7
XTAL2
XTAL1
VSS
P4.0
(A8) P2.0
(A9) P2.1
(A10) P2.2
(A11) P2.3
(A12) P2.4
Not
Accessible
External Not Not
64 KByte Accessible Accessible
Not
Accessible
Not Not
Accessible Accessible
External
64 KByte
External
32 KByte
External External
24 KByte 24 KByte
24 KByte
Block 0
32 KByte 32 KByte
Block 0 Block 0
2000H
1FFFH
8 KByte
Block 1
0000H 0000H 0000H 0000H
1255 F03.0
EA# = 1 EA# = 1
EA# = 0 SFCF[1:0] = 00 SFCF[1:0] = 01, 10, 11
FFFFH FFFFH FFFFH
56 KByte
Block 0
External 64 KByte
64 KByte Block 0
2000H
1FFFH
8 KByte
Block 1
0000H 0000H 0000H
1255 F04.0
TABLE 3-1: SFCF VALUES FOR PROGRAM MEMORY BLOCK SWITCHING FOR SST89E/V516RD2
SFCF[1:0] Program Memory Block Switching
01, 10, 11 Block 1 is not visible to the program counter (PC).
Block 1 is reachable only via in-application programming from 0000H - 1FFFH.
00 Block 1 is overlaid onto the low 8K of the program address space; occupying address locations 0000H - 1FFFH.
When the PC falls within 0000H - 1FFFH, the instruction will be fetched from Block 1 instead of Block 0.
Outside of 0000H - 1FFFH, Block 0 is used. Locations 0000H - 1FFFH of Block 0 are reachable through
in-application programming.
T3-1.0 1255
TABLE 3-2: SFCF VALUES FOR PROGRAM MEMORY BLOCK SWITCHING FOR SST89E/V5XRD2
SFCF[1:0] Program Memory Block Switching
10, 11 Block 1 is not visible to the PC;
Block 1 is reachable only via in-application programming from E000H - FFFFH.
01 Both Block 0 and Block 1 are visible to the PC.
Block 0 is occupied from 0000H - 7FFFH. Block 1 is occupied from E000H - FFFFH.
00 Block 1 is overlaid onto the low 8K of the program address space; occupying address locations 0000H - 1FFFH.
When the PC falls within 0000H - 1FFFH, the instruction will be fetched from Block 1 instead of Block 0.
Outside of 0000H - 1FFFH, Block 0 is used. Locations 0000H - 1FFFH of Block 0 are reachable through
in-application programming.
T3-2.0 1255
TABLE 3-5: EXTERNAL DATA MEMORY RD#, WR# WITH EXTRAM BIT
MOVX @DPTR, A or MOVX A, @DPTR MOVX @Ri, A or MOVX A, @Ri
AUXR ADDR < 0300H ADDR >= 0300H ADDR = Any
EXTRAM = 0 RD# / WR# not asserted RD# / WR# asserted RD# / WR# not asserted1
EXTRAM = 1 RD# / WR# asserted RD# / WR# asserted RD# / WR# asserted
T3-5.0 1255
1. Access limited to ERAM address within 0 to 0FFH; cannot access 100H to 02FFH.
2FFH
FFFFH FFFFH
(Indirect Addressing) (Indirect Addressing)
External
External Data
Data Memory
Memory
0300H
2FFH
Expanded RAM
000H 0000H
EXTRAM = 0 EXTRAM = 1
1255 F05.0
AUXR1 / bit0
DPS
DPTR1
DPTR0
DPS = 0 → DPTR0
DPS = 1 → DPTR1 DPH DPL
83H 82H
Symbol Function
IAPEN Enable IAP operation
0: IAP commands are disabled
1: IAP commands are enabled
SWR Software Reset
See Section 10.2, “Software Reset”
BSEL Program memory block switching bit
See Figures 3-1 through 3-4 and Tables 3-3 and 3-4
Symbol Function
FIE Flash Interrupt Enable.
0: INT1# is not reassigned.
1: INT1# is re-assigned to signal IAP operation completion.
External INT1# interrupts are ignored.
FCM[6:0] Flash operation command
000_0001b Chip-Erase
000_1011b Sector-Erase
000_1101b Block-Erase
000_1100b Byte-Verify1
000_1110b Byte-Program
000_1111b Prog-SB1
000_0011b Prog-SB2
000_0101b Prog-SB3
000_1001b Prog-SC0
000_1001b Prog-SC1
000_1000bEnable-Clock-Double
All other combinations are not implemented, and reserved for future use.
1. Byte-Verify has a single machine cycle latency and will not generate any INT1# interrupt regardless of FIE.
Symbol Function
SFAL Mailbox register for interfacing with flash memory block. (Low order address register).
Symbol Function
SFAH Mailbox register for interfacing with flash memory block. (High order address register).
Symbol Function
SFDT Mailbox register for interfacing with flash memory block. (Data register).
Symbol Function
SB1_i Security Bit 1 status (inverse of SB1 bit)
SB2_i Security Bit 2 status (inverse of SB2 bit)
SB3_i Security Bit 3 status (inverse of SB3 bit)
Please refer to Table 9-1 for security lock options.
EDC_i Double Clock Status
0: 12 clocks per machine cycle
1: 6 clocks per machine cycle
FLASH_BUSY Flash operation completion polling bit.
0: Device has fully completed the last IAP command.
1: Device is busy with flash operation.
Symbol Function
EA Global Interrupt Enable.
0 = Disable
1 = Enable
EC PCA Interrupt Enable.
ET2 Timer 2 Interrupt Enable.
ES Serial Interrupt Enable.
ET1 Timer 1 Interrupt Enable.
EX1 External 1 Interrupt Enable.
ET0 Timer 0 Interrupt Enable.
EX0 External 0 Interrupt Enable.
Symbol Function
EBO Brown-out Interrupt Enable.
1 = Enable the interrupt
0 = Disable the interrupt
Symbol Function
PPC PCA interrupt priority bit
PT2 Timer 2 interrupt priority bit
PS Serial Port interrupt priority bit
PT1 Timer 1 interrupt priority bit
PX1 External interrupt 1 priority bit
PT0 Timer 0 interrupt priority bit
PX0 External interrupt 0 priority bit
Symbol Function
PPCH PCA interrupt priority bit high
PT2H Timer 2 interrupt priority bit high
PSH Serial Port interrupt priority bit high
PT1H Timer 1 interrupt priority bit high
PX1H External interrupt 1 priority bit high
PT0H Timer 0 interrupt priority bit high
PX0H External interrupt 0 priority bit high
Symbol Function
PBO Brown-out interrupt priority bit
PX2 External Interrupt 2 priority bit
PX3 External Interrupt 3 priority bit
Symbol Function
PBOH Brown-out Interrupt priority bit high
PX2H External Interrupt 2 priority bit high
PX3H External Interrupt 3 priority bit high
Symbol Function
EXTRAM Internal/External RAM access
0: Internal Expanded RAM access within range of 00H to 2FFH using MOVX @Ri /
@DPTR. Beyond 300H, the MCU always accesses external data memory.
For details, refer to Section 3.4, “Expanded Data RAM Addressing” .
1: External data memory access.
AO Disable/Enable ALE
0: ALE is emitted at a constant rate of 1/3 the oscillator frequency in 6 clock mode, 1/6 fOSC in
12 clock mode.
1: ALE is active only during a MOVX or MOVC instruction.
Symbol Function
GF2 General purpose user-defined flag.
DPS DPTR registers select bit.
0: DPTR0 is selected.
1: DPTR1 is selected.
Symbol Function
WDOUT Watchdog output enable.
0: Watchdog reset will not be exported on Reset pin.
1: Watchdog reset if enabled by WDRE, will assert Reset pin for 32 clocks.
WDRE Watchdog timer reset enable.
0: Disable watchdog timer reset.
1: Enable watchdog timer reset.
WDTS Watchdog timer reset flag.
0: External hardware reset or power-on reset clears the flag.
Flag can also be cleared by writing a 1.
Flag survives if chip reset happened because of watchdog timer overflow.
1: Hardware sets the flag on watchdog overflow.
WDT Watchdog timer refresh.
0: Hardware resets the bit when refresh is done.
1: Software sets the bit to force a watchdog timer refresh.
SWDT Start watchdog timer.
0: Stop WDT.
1: Start WDT.
Symbol Function
WDTD Initial/Reload value in Watchdog Timer. New value won’t be effective until WDT is set.
Symbol Function
CF PCA Counter Overflow Flag
Set by hardware when the counter rolls over. CF flags an interrupt if bit ECF in CMOD
is set. CF may be set by either hardware or software, but can only cleared by software.
CR PCA Counter Run control bit
Set by software to turn the PCA counter on. Must be cleared by software to turn the
PCA counter off.
- Not implemented, reserved for future use.
Note: User should not write ‘1’s to reserved bits. The value read from a reserved bit is indeterminate.
CCF4 PCA Module 4 interrupt flag. Set by hardware when a match or capture occurs.
Must be cleared by software.
CCF3 PCA Module 3 interrupt flag. Set by hardware when a match or capture occurs.
Must be cleared by software.
CCF2 PCA Module 2 interrupt flag. Set by hardware when a match or capture occurs.
Must be cleared by software.
CCF1 PCA Module 1 interrupt flag. Set by hardware when a match or capture occurs.
Must be cleared by software.
CCF0 PCA Module 0 interrupt flag. Set by hardware when a match or capture occurs.
Must be cleared by software.
Symbol Function
CIDL Counter Idle Control:
0: Programs the PCA Counter to continue functioning during idle mode
1: Programs the PCA Counter to be gated off during idle
WDTE Watchdog Timer Enable:
0: Disables Watchdog Timer function on PCA module 4
1: Enables Watchdog Timer function on PCA module 4
- Not implemented, reserved for future use.
Note: User should not write ‘1’s to reserved bits. The value read from a reserved bit is indeterminate.
CPS1 PCA Count Pulse Select bit 1
CPS0 PCA Count Pulse Select bit 2
Selected
CPS1 CPS0 PCA Input1
0 0 0 Internal clock, fOSC/6 in 6 clock mode (fOSC/12 in 12 clock mode)
0 1 1 Internal clock, fOSC/2 in 6 clock mode (fOSC/4 in 12 clock mode)
1 0 2 Timer 0 overflow
1 1 3 External clock at ECI/P1.2 pin
(max. rate = fOSC/4 in 6 clock mode, fOSC/8 in 12 clock mode)
1. fOSC = oscillator frequency
Symbol Function
- Not implemented, reserved for future use.
Note: User should not write ‘1’s to reserved bits. The value read from a reserved bit is indeterminate.
ECOMn Enable Comparator
0: Disables the comparator function
1: Enables the comparator function
CAPPn Capture Positive
0: Disables positive edge capture on CEX[4:0]
1: Enables positive edge capture on CEX[4:0]
CAPNn Capture Negative
0: Disables negative edge capture on CEX[4:0]
1: Enables negative edge capture on CEX[4:0]
MATn Match: Set ECOM[4:0] and MAT[4:0] to implement the software timer mode
0: Disables software timer mode
1: A match of the PCA counter with this module’s compare/capture register causes the
CCFn bit in CCON to be set, flagging an interrupt.
TOGn Toggle
0: Disables toggle function
1: A match of the PCA counter with this module’s compare/capture register causes the
the CEXn pin to toggle.
PWMn Pulse Width Modulation mode
0: Disables PWM mode
1: Enables CEXn pin to be used as a pulse width modulated output
ECCFn Enable CCF Interrupt
0: Disables compare/capture flag CCF[4:0] in the CCON register to generate an
interrupt request.
1: Enables compare/capture flag CCF[4:0] in the CCON register to generate an
interrupt request.
Symbol Function
SPIE If both SPIE and ES are set to one, SPI interrupts are enabled.
SPE SPI enable bit.
0: Disables SPI.
1: Enables SPI and connects SS#, MOSI, MISO, and SCK to pins P1.4, P1.5, P1.6, P1.7.
DORD Data Transmission Order.
0: MSB first in data transmission.
1: LSB first in data transmission.
MSTR Master/Slave select.
0: Selects Slave mode.
1: Selects Master mode.
CPOL Clock Polarity
0: SCK is low when idle (Active High).
1: SCK is high when idle (Active Low).
CPHA Clock Phase control bit.
0: Shift triggered on the leading edge of the clock.
1: Shift triggered on the trailing edge of the clock.
SPR1, SPR0 SPI Clock Rate Select bits. These two bits control the SCK rate of the device
configured as master. SPR1 and SPR0 have no effect on the slave. The relationship
between SCK and the oscillator frequency, fOSC, is as follows:
Symbol Function
SPIF SPI Interrupt Flag.
Upon completion of data transfer, this bit is set to 1.
If SPIE =1 and ES =1, an interrupt is then generated.
This bit is cleared by software.
WCOL Write Collision Flag.
Set if the SPI data register is written to during data transfer.
This bit is cleared by software.
Symbol Function
SMOD1 Double Baud rate bit. If SMOD1 = 1, Timer 1 is used to generate the baud rate, and the
serial port is used in modes 1, 2, and 3.
SMOD0 FE/SM0 Selection bit.
0: SCON[7] = SM0
1: SCON[7] = FE,
BOF Brown-out detection status bit, this bit will not be affected by any other reset. BOF
should be cleared by software. Power-on reset will also clear the BOF bit.
0: No brown-out.
1: Brown-out occurred
POF Power-on reset status bit, this bit will not be affected by any other reset. POF should be
cleared by software.
0: No Power-on reset.
1: Power-on reset occurred
GF1 General-purpose flag bit.
GF0 General-purpose flag bit.
PD Power-down bit, this bit is cleared by hardware after exiting from power-down mode.
0: Power-down mode is not activated.
1: Activates Power-down mode.
IDL Idle mode bit, this bit is cleared by hardware after exiting from idle mode.
0: Idle mode is not activated.
1: Activates idle mode.
Symbol Function
FE Set SMOD0 = 1 to access FE bit.
0: No framing error
1: Framing Error. Set by receiver when an invalid stop bit is detected. This bit needs to
be cleared by software.
SM0 SMOD0 = 0 to access SM0 bit.
Serial Port Mode Bit 0
SM1 Serial Port Mode Bit 1
SM2 Enables the Automatic Address Recognition feature in Modes 2 or 3. If SM2 = 1 then RI
will not be set unless the received 9th data bit (RB8) is 1, indicating an address, and
the received byte is a given or broadcast address. In Mode 1, if SM2 = 1 then RI will not
be activated unless a valid stop bit was received. In Mode 0, SM2 should be 0.
REN Enables serial reception.
0: to disable reception.
1: to enable reception.
TB8 The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software as
desired.
RB8 In Modes 2 and 3, the 9th data bit that was received. In Mode 1, if SM2 = 0, RB8 is the
stop bit that was received. In Mode 0, RB8 is not used.
TI Transmit interrupt flag. Set by hardware at the end of the 8th bit time in Mode 0, or at
the beginning of the stop bit in the other modes, in any serial transmission, Must be
cleared by software.
RI Receive interrupt flag. Set by hardware at the end of the8th bit time in Mode 0, or
halfway through the stop bit time in the other modes, in any serial reception (except see
SM2). Must be cleared by software.
Symbol Function
TF2 Timer 2 overflow flag set by a Timer 2 overflow and must be cleared by software. TF2
will not be set when either RCLK or TCLK = 1.
EXF2 Timer 2 external flag set when either a capture or reload is caused by a negative
transition on T2EX and EXEN2 = 1. When Timer 2 interrupt is enabled, EXF2 = 1 will
cause the CPU to vector to the Timer 2 interrupt routine. EXF2 must be cleared by
software. EXF2 does not cause an interrupt in up/down counter mode (DCEN = 1).
RCLK Receive clock flag. When set, causes the serial port to use Timer 2 overflow pulses for
its receive clock in modes 1 and 3. RCLK = 0 causes Timer 1 overflow to be used for
the receive clock.
TCLK Transmit clock flag. When set, causes the serial port to use Timer 2 overflow pulses for
its transmit clock in modes 1 and 3. TCLK = 0 causes Timer 1 overflow to be used for
the transmit clock.
EXEN2 Timer 2 external enable flag. When set, allows a capture or reload to occur as a result
of a negative transition on T2EX if Timer 2 is not being used to clock the serial port.
EXEN2 = 0 causes Timer 2 to ignore events at T2EX.
TR2 Start/stop control for Timer 2. A logic 1 starts the timer.
C/T2# Timer or counter select (Timer 2)
0: Internal timer (OSC/6 in 6 clock mode, OSC/12 in 12 clock mode)
1: External event counter (falling edge triggered)
CP/RL2# Capture/Reload flag. When set, captures will occur on negative transitions at T2EX if
EXEN2 = 1. When cleared, auto-reloads will occur either with Timer 2 overflows or
negative transitions at T2EX when EXEN2 = 1. When either RCLK = 1 or TCLK = 1,
this bit is ignored and the timer is forced to auto-reload on Timer 2 overflow.
Symbol Function
- Not implemented, reserved for future use.
Note: User should not write ‘1’s to reserved bits. The value read from a reserved bit is indeterminate.
T2OE Timer 2 Output Enable bit.
DCEN Down Count Enable bit. When set, this allows Timer 2 to be configured as an up/down
counter.
Symbol Function
EX2 External Interrupt 2
Enable bit if set
IE2 Interrupt Enable
If IT2=1, IE2 is set/cleared automatically by hardware when interrupt is detected/
serviced.
IT2 External Interrupt 2 is falling-edge/low-level triggered when this bit is cleared by
software.
EX3 External Interrupt 3
Enable bit if set
IE3 Interrupt Enable
If IT3=1, IE3 is set/cleared automatically by hardware when interrupt is detected/
serviced.
IT3 External Interrupt3 is falling-edge/low-level triggered when this bit is cleared by
software.
0 Input/
Port 0
Output
6 Data
7 Bus
0
0 1
1 2 Address Bus
2 3 A13-A8
Port 2
4
Ready/Busy# 3
Port 3 5
Address Bus A14 4
6 Flash
A15-A14 A15 5
7 Control Signals
Flash 6
0
Control Signals 7 Port 1
Address Bus
6 A7-A0
7
4.2 In-Application Programming Mode 4.2.2 Memory Bank Selection for In-Application
Programming Mode
The device offers either 16/24/40/72 KByte of in-application
programmable flash memory. During in-application pro- With the addressing range limited to 16 bit, only 64 KByte
gramming, the CPU of the microcontroller enters IAP of program address space is “visible” at any one time. As
mode. The two blocks of flash memory allow the CPU to shown in Table 4-5, the bank selection (the configuration of
execute user code from one block, while the other is being EA# and SFCF[1:0]), allows Block 1 memory to be overlaid
erased or reprogrammed concurrently. The CPU may also on the lowest 8 KByte of Block 0 memory, making Block 1
fetch code from an external memory while all internal flash reachable. The same concept is employed to allow both
is being reprogrammed. The mailbox registers (SFST, Block 0 and Block 1 flash to be accessible to IAP opera-
SFCM, SFAL, SFAH, SFDT and SFCF) located in the spe- tions. Code from a block that is not visible may not be used
cial function register (SFR), control and monitor the as a source to program another address. However, a block
device’s erase and program process. that is not “visible” may be programmed by code from the
other block through mailbox registers.
Table 4-6 and Table 4-7 outline the commands and their
associated mailbox register settings. The device allows IAP code in one block of memory to pro-
gram the other block of memory, but may not program any
4.2.1 In-Application Programming Mode Clock location in the same block. If an IAP operation originates
Source physically from Block 0, the target of this operation is implic-
itly defined to be in Block 1. If the IAP operation originates
During IAP mode, both the CPU core and the flash control-
physically from Block 1, then the target address is implicitly
ler unit are driven off the external clock. However, an inter-
defined to be in Block 0. If the IAP operation originates from
nal oscillator will provide timing references for Program and
external program space, then, the target will depend on the
Erase operations. The internal oscillator is only turned on
address and the state of bank selection.
when required, and is turned off as soon as the flash oper-
ation is completed.
4.2.3 IAP Enable Bit
The IAP enable bit, SFCF[6], enables in-application pro-
gramming mode. Until this bit is set, all flash programming
IAP commands will be ignored.
4.2.4.1 Chip-Erase
The Chip-Erase command erases all bytes in both memory
SFST[2] indicates INT1 interrupt
blocks. This command is only allowed when EA#=0 (exter- operation completion indicates completion
nal memory execution). Additionally this command is not
permitted when the device is in level 4 locking. In all other 1255 F09.0
Set-Up
IAP Enable
MOV SFDT, #55H
ORL SFCF, #40H
4.2.4.2 Block-Erase
SFST[2] indicates INT1 interrupt
The Block-Erase command erases all bytes in one of the operation completion indicates completion
two memory blocks (Block 0 or Block 1). The selection of
the memory block to be erased is determined by the 1255 F10.0
(SFAH[7]) of the SuperFlash Address Register. For
SST89x516RD2, refer to Table 4-5. For SST89x5xRD2, if
SFAH[7] = 0b, the primary flash memory Block 0 is
selected. If SFAH[7:4] = EH, the secondary flash memory
Block 1 is selected. The Block-Erase command sequence
for SST89x5xRD2 is as follows:
SFDT register
contains data
Move data to SFDT
MOV SFDT, #data 1255 F12.0
4.2.4.5 Byte-Verify
The Byte-Verify command allows the user to verify that the IAP Enable
device has correctly performed an Erase or Program com- ORL SFCF, #40H
1255 F13.0
1255 F15.0
IAP Enable
ORL SFCF, #40H There are no IAP counterparts for the external host com-
mands Select-Block0 and Select-Block1.
4.2.5 Polling
Set-up Program SC0 Set-up Program SC1
MOV SFAH, #5AH MOV SFAH, #0AAH A command that uses the polling method to detect flash
MOV SFDT, #0AAH MOV SFDT, #0AAH operation completion should poll on the FLASH_BUSY bit
(SFST[2]). When FLASH_BUSY de-asserts (logic 0), the
device is ready for the next operation.
MOVC instruction may also be used for verification of the
Program SC0 or SC1 - Program SC0 or SC1 - Programming and Erase operation of the flash memory.
Polling scheme Interrupt scheme MOVC instruction will fail if it is directed at a flash block that
MOV SFCM, #09H MOV SFCM, #89H is still busy.
1255 F16.0
RXD
D0 D1 D2 D3 D4 D5 D6 D7
RXD
D0 D1 D2 D3 D4 D5 D6 D7 D8
“Don’t cares” allow for a wider range in defining the broad- An external master drives the Slave Select input pin, SS#/
cast address, but in most cases, the broadcast address will P1[4], low to select the SPI module as a slave. If SS#/P1[4]
be FFH. has not been driven low, then the slave SPI unit is not
active and the MOSI/P1[5] port can also be used as an
On reset, SADDR and SADEN are “0”. This produces an input port pin.
given address of all “don’t cares” as well as a broadcast
address of all “don’t cares.” This effectively disables Auto- CPHA and CPOL control the phase and polarity of the SPI
matic Addressing mode and allows the microcontroller to clock. Figures 6-5 and 6-6 show the four possible combina-
function as a standard 8051, which does not make use of tions of these two bits.
this feature.
MOSI MOSI
SCK Cycle # 1 2 3 4 5 6 7 8
(for reference)
SCK (CPOL=0)
SCK (CPOL=1)
1255 F20.0
SCK Cycle # 1 2 3 4 5 6 7 8
(for reference)
SCK (CPOL=0)
SCK (CPOL=1)
1255 F21.0
344064
clks WDT Reset
CLK (XTAL1) Internal Reset
Counter WDT Upper Byte
Ext. RST
WDTC
WDTD
1255 F22.0
16 Bits Each
Module 0 P1.3/CEX0
Module 1 P1.4/CEX1
16 Bits
Module 3 P1.6/CEX3
Module 4 P1.7/CEX4
1255 F23.0
The four possible CMOD timer modes with and without the overflow interrupt enabled are shown below. This list
assumes that PCA will be left running during idle mode.
The CCON register is associated with all PCA timer functions. It contains run control bits and flags for the PCA
timer (CF) and all modules. To run the PCA the CR bit (CCON.6) must be set by software. Clearing the bit, will turn
off PCA. When the PCA counter overflows, the CF (CCON.7) will be set, and an interrupt will be generated if the
ECF bit in the CMOD register is set. The CF bit can only be cleared by software. Each module has its own timer
interrupt or capture interrupt flag (CCF0 for module 0, CCF4 for module 4, etc.). They are set when either a match
or capture occurs. These flags can only be cleared by software. (See “PCA Timer/Counter Control Register
(CCON)” on page 27.)
8.3 Compare/Capture Modules Bits CAPN (CCAPMn.4) and CAPP (CCAPMn.5) deter-
mine whether the capture input will be active on a positive
Each PCA module has an associated SFR with it. These
edge or negative edge. The CAPN bit enables the negative
registers are: CCAPM0 for module 0, CCAPM1 for module
edge that a capture input will be active on, and the CAPP
1, etc. Refer to “PCA Compare/Capture Module Mode Reg-
bit enables the positive edge. When both bits are set, both
ister (CCAPMn)” on page 29 for details. The registers each
edges will be enabled and a capture will occur for either
contain 7 bits which are used to control the mode each
transition. The last bit in the register ECOM (CCAPMn.6)
module will operate in. The ECCF bit (CCAPMn.0 where n
when set, enables the comparator function. Table 8-5
= 0, 1, 2, 3, or 4 depending on module) will enable the CCF
shows the CCAPMn settings for the various PCA functions.
flag in the CCON SFR to generate an interrupt when a
match or compare occurs. PWM (CCAPMn.1) enables the There are two additional register associated with each of
pulse width modulation mode. The TOG bit (CCAPMn.2) the PCA modules: CCAPnH and CCAPnL. They are regis-
when set, causes the CEX output associated with the mod- ters that hold the 16-bit count value when a capture occurs
ule to toggle when there is a match between the PCA or a compare occurs. When a module is used in PWM
counter and the module’s capture/compare register. When mode, these registers are used to control the duty cycle of
there is a match between the PCA counter and the mod- the output. See Figure 8-1.
ule’s capture/compare register, the MATn (CCAPMn.3) and
the CCFn bit in the CCON register to be set.
PCA Interrupt
PCA Timer/Counter
CH CL
Capture
CEXn
CCAPnH CCAPnL
CCAPMn ECOMn CAPPn CAPNn MATn TOGn PWMn ECCFn 1255 F24.0
n=0 to 4
0 0 0 0
1 0
Enable Match
16-bit Comparator
CH CL
PCA Timer/Counter
1 0
Enable Match
16-bit Comparator
Toggle
CH CL CEXn
PCA Timer/Counter
CCAPnH
CCAPnL
0
Enable CL < CCAPnL
8-bit Comparator CEXn
CL >= CCAPnL
1
CL
Overflow
PCA Timer/Counter
To use the Watchdog Timer, the user pre-loads a 16-bit MOVCCAP4H, #0FFH; Before PCA timer counts up
; to FFFF Hex, these compare
value in the compare register. Just like the other compare ; values must be changed.
modes, this 16-bit value is compared to the PCA timer
ORLCMOD, #40H; Set the WDTE bit to enable the
value. If a match is allowed to occur, an internal reset will be ; watchdog timer without
generated. This will not cause the RST pin to be driven high. ; changing the other bits in
; CMOD
In order to hold off the reset, the user has three options: ;==============================================
1. periodically change the compare value so it will ;Main program goes here, but call WATCHDOG periodically.
never match the PCA timer,
;==============================================
2. periodically change the PCA timer value so it will WATCHDOG:
never match the compare values, or
CLR EA; Hold off interrupts
3. disable the watchdog timer by clearing the WDTE
MOVCCAP4L, #00; Next compare value is within
bit before a match occurs and then re-enable it.
MOVCCAP4H, CH; 65,535 counts of the
The first two options are more reliable because the Watch- ; current PCA
dog Timer is never disabled as in option #3. If the program SETBEA; timer value
counter ever goes astray, a match will eventually occur and
cause an internal reset. The second option is also not rec- RET
ommended if other PCA modules are being used. Remem- ;==============================================
ber, the PCA timer is the time base for all modules;
This routine should not be part of an interrupt service rou-
changing the time base for other modules would not be a
tine. If the program counter goes astray and gets stuck in an
good idea. Thus, in most application the first solution is the
infinite loop, interrupts will still be serviced and the watchdog
best option.
will keep getting reset. Thus, the purpose of the watchdog
would be defeated. Instead, call this subroutine from the
main program of the PCA timer.
1 0
Enable Match
16-bit Comparator Reset
CH CL
PCA Timer/Counter
UUU/NN Level 1
PUU/SS Level 2
UPU/SS UUP/LS
Level 3
UPP/LL PPU/LS PUP/LL UPP/LL
PPP/LL Level 4
1255 F29.0
10.0 RESET
VDD
A system reset initializes the MCU and begins program
execution at program memory location 0000H. The reset +
input for the device is the RST pin. In order to reset the 10µF VDD
device, a logic level high must be applied to the RST pin for -
at least two machine cycles (24 clocks), after the oscillator RST
becomes stable. ALE, PSEN# are weakly pulled high dur- 8.2K
SST89E/V5xxRD2
ing reset. During reset, ALE and PSEN# output a high level
C2
in order to perform a proper reset. This level must not be
XTAL2
affected by external element. A system reset will not affect
the 1 KByte of on-chip RAM while the device is running,
XTAL1
however, the contents of the on-chip RAM during power up
C1
are indeterminate. Following reset, all Special Function
Registers (SFR) return to their reset values outlined in
Tables 3-7 to 3-11. 1255 F30.0
11.0 INTERRUPTS
HIGHEST PRIORITY
IE & IEA IP/IPH/IPA/IPAH INTERRUPT
REGISTERS REGISTERS
0
INT0# IT0 IE0
1
BOF INTERRUPT
POLLING
SEQUENCE
TF0
0
INT1# IT1 IE1
1
TF1
ECF
CF
CCFn
ECCFn
0
INT2# IT2 IE2
1
0
INT3# IT3 IE3
1
RI
TI
SPIF
SPIE
TF2
EXF2
GLOBAL
INDIVIDUAL DISABLE LOWEST PRIORITY
ENABLES INTERRUPT
1255 F31.0
13.1 Clock Input Options and Recom- More specific information about on-chip oscillator design
mended Capacitor Values for Oscillator can be found in the FlashFlex51 Oscillator Circuit Design
Considerations application note.
Shown in Figure 13-1 are the input and output of an inter-
nal inverting amplifier (XTAL1, XTAL2), which can be con-
figured for use as an on-chip oscillator. 13.2 Clock Doubling Option
By default, the device runs at 12 clocks per machine cycle
When driving the device from an external clock source,
(x1 mode). The device has a clock doubling option to
XTAL2 should be left disconnected and XTAL1 should be
speed up to 6 clocks per machine cycle. Please refer to
driven.
Table 13-2 for detail.
At start-up, the external oscillator may encounter a higher
Clock double mode can be enabled either via the external
capacitive load at XTAL1 due to interaction between the
host mode or the IAP mode. Please refer to Table 4-1 for
amplifier and its feedback capacitance. However, the
the external host mode enabling command and to Table 4-
capacitance will not exceed 15 pF once the external signal
6 and Table 4-7 for the IAP mode enabling commands
meets the VIL and VIH specifications.
(When set, the EDC# bit in SFST register will indicate 6
Crystal manufacturer, supply voltage, and other factors clock mode.).
may cause circuit performance to differ from one applica-
The clock double mode is only for doubling the inter-
tion to another. C1 and C2 should be adjusted appropri-
nal system clock and the internal flash memory, i.e.
ately for each design. Table 13-1, shows the typical values
EA#=1. To access the external memory and the peripheral
for C1 and C2 vs. crystal type for various frequencies
devices, careful consideration must be taken. Also note
that the crystal output (XTAL2) will not be doubled.
TABLE 13-1:RECOMMENDED VALUES FOR C1 AND
C2 BY CRYSTAL TYPE
Crystal C1 = C2
Quartz 20-30pF
Ceramic 40-50pF
T13-1.0 1255
XTAL2
C2 NC XTAL2
External
C1 Oscillator XTAL1
XTAL1 Signal
VSS VSS
Absolute Maximum Stress Ratings (Applied conditions greater than those listed under “Absolute Maximum
Stress Ratings” may cause permanent damage to the device. This is a stress rating only and functional operation
of the device at these conditions or conditions greater than those defined in the operational sections of this data
sheet is not implied. Exposure to absolute maximum stress rating conditions may affect device reliability.)
1. Outputs shorted for no more than one second. No more than one output shorted at a time.
(Based on package heat transfer limitations, not device power consumption.
Note: This specification contains preliminary information on new products in production.
The specifications are subject to change without notice.
TABLE 14-5: PIN IMPEDANCE (VDD=3.3V, Ta=25 °C, f=1 Mhz, other pins open)
30
15
10
1255 F33.0
5 Typical Active IDD
50
Maximum Active IDD
40
30
20
1255 F34.0
AC Characteristics: (Over Operating Conditions: Load Capacitance for Port 0, ALE#, and PSEN# = 100pF;
Load Capacitance for All Other Outputs = 80pF)
Explanation of Symbols Each timing symbol has 5 characters. The first character is always a ‘T’ (stands for
time). The other characters, depending on their positions, stand for the name of a signal or the logical status of that
signal. The following is a list of all the characters and what they stand for.
A: Address Q: Output data
C: Clock R: RD# signal
D: Input data T: Time
H: Logic level HIGH V: Valid
I: Instruction (program memory contents) W: WR# signal
L: Logic level LOW or ALE X: No longer a valid logic level
P: PSEN# Z: High Impedance (Float)
For example:
TAVLL = Time from Address Valid to ALE Low
TLLPL = Time from ALE Low to PSEN# Low
TLHLL
ALE
TPLPH
TAVLL TLLIV
TLLPL
TPLIV
PSEN#
TPXAV
TPLAZ
TPXIZ
TLLAX
TPXIX
PORT 0 A0 - A7 INSTR IN A0 - A7
TAVIV
1255 F35.0
TLHLL
ALE
TWHLH
PSEN# TLLDV
TRLRH
TLLWL
RD# TLLAX
TRLDV TRHDZ
TAVLL
TRLAZ
TRHDX
TAVWL
TAVDV
PORT 2 P2[7:0] or A8-A15 FROM DPH A8-A15 FROM PCH
1255 F36.0
TLHLL
ALE
TWHLH
PSEN#
TLLWL TWLWH
WR# TLLAX
TAVLL TQVWX TWHQX
TQVWH
PORT 0 A0-A7 FROM RI or DPL DATA OUT A0-A7 FROM PCL INSTR IN
TAVWL
VDD - 0.5
0.7VDD
TCHCX
0.45 V 0.2 VDD - 0.1
TCLCX TCLCH
TCLCL
TCHCL 1255 F38.0
INSTRUCTION 0 1 2 3 4 5 6 7 8
ALE
TXLXL
CLOCK
TQVXH TXHQX
OUTPUT DATA 0 1 2 3 4 5 6 7
TXHDX
WRITE TO SBUF TXHDV SET TI
INPUT DATA VALID VALID VALID VALID VALID VALID VALID VALID
CLEAR RI SET R I
1255 F39.0
AC Inputs during testing are driven at VIHT (VDD -0.5V) for Logic "1" and For timing purposes, a port pin is no longer floating when a 100 mV
VILT (0.45V) for a Logic "0". Measurement reference points for inputs and change from load voltage occurs, and begins to float when a 100 mV
outputs are at VHT (0.2VDD + 0.9) and VLT (0.2VDD - 0.1) change from the loaded VOH/VOL level occurs. IOL/IOH = ± 20mA.
Note: VHT- VHIGH Test
VLT- VLOW Test
VIHT-VINPUT HIGH Test
VILT- VINPUT LOW Test
TO TESTER
TO DUT
CL
1255 F42.0
VDD P0 P0
SST89x5xxRD2 SST89x5xxRD2
FIGURE 14-11: IDD TEST CONDITION, FIGURE 14-13: IDD TEST CONDITION,
ACTIVE MODE POWER-DOWN MODE
VDD
IDD
VDD VDD
P0
RST EA#
SST89x5xxRD2
(NC) XTAL2
CLOCK
SIGNAL XTAL1
VSS
1255 F45.0
All other pins disconnected
14.3 Flash Memory Programming Timing Diagrams with External Host Mode
TSU
RST
TES
PSEN#
ALE/PROG#
EA#
TRD TRD
P2[7:6] ,P3[7:6] 0000b 0000b
P0 BFH Device ID
1255 F46.0
Device ID = See Table 4-3, "Product Identification"
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
P3[3]
TPSB
Enables the selection of either of the flash memory blocks prior to issuing a Byte-Verify, Block-Erase, Sector-
Erase, or Byte-Program.
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
TCE
P3[3]
1255 F48.0
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
TBE
P3[3]
1255 F49.0
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
TBE
P3[3]
P3[5:4], P2[5:0] AH
1255 F50.0
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
P3[3]
TSE
P3[5:4], P2[5:0] AH
P1 AL
1255 F51.0
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
P3[3]
TPB
P3[5:4], P2[5:0] AH
P1 AL
P0 DI
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
P3[3]
TPS
TSU
RST
TES
PSEN#
TADS
ALE/PROG#
TPROG TDH
EA#
P3[3]
TPS
TSU
RST TES
PSEN#
ALE/PROG#
EA#
TOA
TAHA
P0 DO
TALA
P1 AL
P3[5:4], P2[5:0] AH
1255 F55.0
Note: Valid combinations are those products in mass production or will be in mass production. Consult your SST sales
representative to confirm availability of valid combinations and to determine availability of new combinations.
40
CL
.600
1 .625
Pin #1 Identifier
.530
.557
.065 2.020 12˚
.075 2.070 4 places
.220 Max.
Base Plane
Seating Plane
.015 Min. 0˚
15˚
.008
.012
.100 †
.200
.063 .045 .015 .100 BSC .600 BSC
.090 .055 .022
Note: 1. Complies with JEDEC publication 95 MS-011 AC dimensions (except as noted), although some dimensions may be more stringent.
† = JEDEC min is .115; SST min is less stringent
2. All linear dimensions are in inches (min/max). 40-pdip-PI-7
3. Dimensions do not include mold flash. Maximum allowable mold flash is .010 inches.
.042 .013
.048 .021
.050
BSC.
.020 Min.
.100
.050 .112
BSC. .026
.032
.165
.180
44-plcc-NJ-7
Note: 1. Complies with JEDEC publication 95 MS-018 AC dimensions (except as noted), although some dimensions may be more stringent.
† = JEDEC min is .650; SST min is less stringent
2. All linear dimensions are in inches (min/max).
3. Dimensions do not include mold flash. Maximum allowable mold flash is .008 inches.
4. Coplanarity: 4 mils.
Pin #1 Identifier 44 34
1 33
.30
.45
10.00 ± 0.10
12.00 ± 0.25 .80 BSC
11 23
12 22 .09
10.00 ± 0.10 .20
12.00 ± 0.25
.95
1.05
1.2
max. 0˚- 7˚
.05 .45
.15 .75
1.00 ref
Note: 1. Complies with JEDEC publication 95 MS-026 ACB dimensions, although some dimensions may be more stringent.
2. All linear dimensions are in millimeters (min/max). 44-tqfp-TQJ-7
3. Coplanarity: 0.1 (±0.05) mm.
4. Package body dimensions do not include mold flash. Maximum allowable mold flash is .25mm. 1mm
Silicon Storage Technology, Inc. • 1171 Sonora Court • Sunnyvale, CA 94086 • Telephone 408-735-9110 • Fax 408-735-9036
www.SuperFlash.com or www.sst.com