• Reduce EMI Mode (I nhibi t ALE t hro ugh AUXR SFR )
• SPI Serial Interface
• TTL- and CMOS-Compatible Logic Levels
• Brown-out Detection
• Extended Power-Saving Modes
– Idle Mode
– Power Down Mode with External Interrupt Wake-up
– Standby (Stop Clock) Mode
• PDIP-40, PLCC-44 and TQFP-44 Packages
• Temperature Ranges:
– Commercial (0°C to +70°C)
– Industrial (-40°C to +85°C)
PRODUCT DESCRIPTION
SST89E564RD, SST89V564RD, SST89E554RC, and
SST89V554RC are members of the Fl ashFlex5 1 famil y of 8bit microcontroller s. The Flash Flex51 is a family o f microcontroller products designed and manufactured on the state-ofthe-art SuperFlash CMOS semiconductor process technology. The device uses the same powerful instruction set and
is pin-fo r-pin com patib le with standard 8xC 5x micr ocontroll er
devices.
The device comes with 72/40 KByte of on-chip flash
EEPROM program memory using SST’s patented and proprietar y CMO S Super Flash E EPROM tech nolo gy with the
SST’s field-enhancing, tunneling injector, split-gate memory cells. The SuperFlash memory is partitioned into 2
independent program memory blocks. The primary SuperFlash Block 0 occupies 64 /32 KByte of internal program
memory space and the secondary SuperFlash Block 1
occupies 8 KByte of i nt ernal program mem ory space. The
8-KByte second ary SuperFlash block ca n be mapped to
the lowest location of the 64/32 KByte address space; it
can also be hidden from the program counter and used as
an independent EEPROM-like data memory. The flash
memory blocks can be programmed via a standard 87C5x
OTP EPR OM prog ramm er fitted with a specia l adapter and
firmware for SST’s device. During the power-on reset, the
device can be configured as a slave to an external host for
source code storage or as a master to an external host for
In-Application Programming (IAP) o perati on. T he device is
designed to be p rogrammed “In-System ” and “In-Applic ation” on the printed circuit board for maximum flexibility. The
device is pre-programmed with an example of bootstrap
loader in the memo ry, demonstrati ng the initial user program code loading or su bsequent user c ode updating v ia
the “IAP” operatio n. An example of bootstrap loader is for
the user’s reference and convenience only. SST does not
guarantee the functionality or the usefulness of the sample
bootstrap loader. Chip-Erase or Block-Erase operations will
erase the pr e-pro gra mmed sa mple code .
In addition to 72/ 40 KByte of SuperFlash EEPROM program memory on-chip, the device can address up to 64
KByte of external program memory. In additio n t o 1024 x 8
bits of on-chip RAM, up to 64 KBy te of exter nal RAM ca n
be addressed.
SST’s highly reliable, patented SuperFlash technology and
memory cell architecture have a number of important
advantages for designing and manufacturing flash
EEPROMs. These advantages translate into significant
cost and reliability benefits for our customers.
TABLE 3-1: SFCF Values for Program Memory Block Switching for SST89E564RD/SST89V564RD . . . 11
TABLE 3-2: SFCF Values for Program Memory Block Switching for SST89E554RC/SST89V554RC . . . 12
sink several LS TTL inputs. Port 0 pins float that have “1”s written to them, and in this state
can be used as high-impedance inputs. Port 0 is also the multiplexed low-order address and
data bus during accesses to external memory. In this application, it uses strong internal pullups when transitioning to V
. Port 0 also receives the code bytes during the external host
OH
mode programming, and outputs the code bytes during the external host mode verification.
External pull-u ps are required during program verification.
Port 1: Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The P ort 1 output buffers
can drive LS TTL inputs. Port 1 pins are pulled high by the internal pull-ups when “1”s are
written to them and can be used as inputs in this state. As inputs, Port 1 pins that are externally pulled lo w will source cu rren t (I
, see Tables 11-3 and 11-4 ) beca use of t he i nternal pull-
IL
ups. P1[5, 6, 7] have high current drive of 16 mA. Port 1 also receives the low-order address
bytes during the external host mode p rogramming and verification.
This signal is the external clock input for the PCS timer/counter.
Each compare/capture module connects to a Port 1 pin for external I/O. When not used by
the PCA, this pin can handle standard I/O.
OR
CEX1: Compare/Capture Module External I/O
OR
CEX2: Compare/Capture Module External I/O
OR
CEX3: Compare/Capture Module External I/O
OR
CEX4: Compare/Capture Module External I/O
Port 2: Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. Port 2 pins are pulled
high by the internal pull-ups when “1”s are written to them and can be used as inputs in this
state. As inputs, Port 2 pins that are externally pulled low will source current (I
, see Tables
IL
11-3 and 11-4) because of the internal pull-ups. Port 2 sends the high-order address byte
during fetches from exte rnal Program memory and during acce sses to e xternal Data Mem ory
that use 16-bit address (MOVX@DPTR). In this application, it uses strong internal pull-ups
when transitioning to V
. Port 2 also receives some control signals and a partial of high-
OH
order address bits during the external host mode programming and verification.
Port 3: Port 3 is an 8-bit bidirection al I / O po rt with internal pul l-u ps. The Port 3 output buff e rs
can drive LS TTL inputs. Port 3 pins are pulled high by the internal pull-ups when “1”s are
written to them and can be used as inputs in this state. As inputs, Port 3 pins that are externally pulled lo w will source cu rren t (IIL, see Tables 11-3 and 11-4 ) beca use of t he i nternal pullups. P ort 3 also receives some control signals and a partial of high-order addre ss bit s du ring
the external host mode programming and verification.
SymbolType
P0[7:0]I/OPort 0: Port 0 is an 8-bit open drain bi-directional I/O port. As an output port each pin can
P1[7:0]I/O with internal
P1[0]I/OT2: External count input to Timer/Counter 2 or Clock-out from Timer/Counter 2
P1[1]IT2EX: Timer/Counter 2 capture/reload trigger and direction control
P1[2]IECI: PCA Timer/Counter External Input:
P1[3]I/OCEX0: Compare/Capture Module External I/O
P1[4]I/OSS#: Master Input or Slave Output for SPI.
P1[5]I/OMOSI: Master Output line, Slave Input line for SPI
P1[6]I/OMISO: Master Input li ne, Slave Output line for SPI
P1[7]I/OSCK: Master clock output, slave clock input line for SPI
P2[7:0]I/O with internal
P3[7:0]I/O with internal
P3[0]IRXD: Serial input line
P3[1]OTXD: Serial output lin e
P3[2]IINT0#: External Interrupt 0 Input
P3[3]IINT1#: External Interrupt 1 Input
P3[4]IT0: External count input to Timer/Counter 0
P3[5]IT1: External count input to Timer/Counter 1
P3[6]OWR#: External Data Memory Write strobe
P3[7]ORD#: External Data Memory Read strobe
PSEN#I/OProgram Store Enable: PSEN# is the Read strobe to External Program Store. When the
RSTIReset: Whil e the oscill ator is running, a hi gh logic sta te on this pin for tw o machi ne cycles will
EA#IExternal Access Enable : EA# must be driven to V
ALE/PROG#I/OAddress Latch Enable: ALE is the output signal for latching the low byte of the address dur-
XTAL1
XTAL2
V
DD
V
SS
1. I = Input; O = Output
2. It is not necessary to receive a 12V programming supply voltage during flash programming.
1
Name and Functions
device is executing from Internal Program Memory, PSEN# is inactive (V
). When the
OH
device is executing code from External Program Memory, PSEN# is activated twice each
machine cycle, ex ce pt whe n acce ss to Exte rnal Data Memory while one PSEN# activation is
skipped in each machine cycle. A forced high-to-low input transition on the PSEN# pin while
the RST input is conti n ual ly hel d hi gh for more than ten machine cycles will cause the device
to enter External Host mode for programming.
reset the device. After a reset, if the PSEN# pin is driven by a high-to-low input transition
while the RST input pin is held high, the device will enter the External Host mode, otherwise
the device will enter the Normal operation mode.
in order to enable the device to fetch
code from the External Program Memory. EA# must be driven to V
IL
for internal program exe-
IH
cution. However, Security lock level 4 will disable EA#, and program execution is only possible from internal program memory. The EA# pin can tolerate a high voltage2 of 12V
(see “Absolute Maximum Stress Ratings” on page 51).
ing acces s es to external memory. This pin is also the programming pulse input (PROG#) for
the external host mode. ALE is activated twice each machine cycle, except when access to
External Data Memory, one ALE activation is skipped in th e seco nd mac hine cy cle . Ho wever,
if AO is set to 1, ALE is disabled. (see “Auxiliary Register (AUXR)” on page 20)
I
O
Oscillator: Input and output to the inverting oscillator amplifier. XTAL1 is input to internal
clock generation circuits from an external clock source.
IPower Supp ly: Supply voltage during normal, Idle, Power Down, and Standby Mode opera-
The device has separate addr e ss s pa ce s for program an d
data memory.
3.1 Program Memory
There are two internal flash memor y blocks in the device.
The primary flash memory block (Block 0) has 64/32
KByte. The secondary flash memory block (Block 1) has 8
KByte. Since the total program address space is limited to
64/32 KByte, the SFCF[1:0] bit are used to control Program
FFFFH
EA# = 0
FFFFH
SFCF[1:0] = 00
Bank Selectio n. Please re fer to Figure 3-1 and F igure 3-2
for the program memory configurations. Program Bank
Select is described in the next section.
The 64K/32K x8 primary SuperFlash block is organized as
512/256 sectors, each sector consists of 128 Bytes.
The 8K x8 secondary SuperFlash block is organized as 64
sectors, each sector consists also of 128 Bytes.
For both blocks, the 7 least significant program address bits
select the byte within the sector. The remainder of the program addr ess bi ts selec t the sect or with in the bloc k.
EA# = 1
EA# = 1
SFCF[1:0] = 01, 10, 11
FFFFH
56 KByte
Block 0
0000H
FIGURE3-1: P
External
64 KByte
64 KByte
Block 0
2000H
1FFFH
8 KByte
Block 1
0000H
ROGRAM MEMORY ORGANIZATIONFOR SST89E564RD AND SST89V564RD
FIGURE3-2: PROGRAM MEMORY ORGANIZATIONFOR SST89E554RC AND SST89V554RC
555 ILL F03.2
3.2 Program Memory Block Switching
The prog r am mem ory block switching feature of the de v ice
allows either Block 1 or the lowest 8 KByte of Block 0 to be
used for the lowest 8 KByte of the program address space.
SFCF[1:0] controls program memory block switching.
TABLE3-1: SFCF VALUESFOR P ROGRAM MEMORY B LOCK SWITCHINGFOR SST89E564RD/SST89V564RD
SFCF[1:0]Program Memory Block Switching
01, 10, 11Block 1 is not visible to the PC;
Block 1 is reachable only via In-Application Programming from 000H - 1FFFH.
00Block 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.
Block 1 is reachable only via In-Application Programming from E000H - FFFFH.
01Both Block 0 and Block 1 are visible to the PC.
Block 0 is occupied from 0000H - 7FFFH. Block 1 is occupied from E000H - FFFFH.
00Block 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.
3.2.1 Reset Configuration of Program Memory
Block Switching
Program memory block switching is initialized after reset
according to the state of the Start-up Configuration bit SC0.
The SC0 bit is programmed via an External Host Mode
command or an IAP Mode command. Se e Table 4-2 and
Table 4-6.
Once out of reset, the SFCF[0] bit can be changed dynamically by the progr am f or desir ed eff ects . Changing SFCF[0]
will not change the SC0 bit.
Caution must be taken when dynamically changing the
SFCF[0] bit. Since this will cause different physical memory
to be mapped to t he logical program address s pace. The
user must avoid executing block switching instructions
within the address range 0000H to 1FFFH.
ALUESFOR PROGRAM MEMORY BLOCK SWITCHINGFOR SS T8 9E554RC/S ST89V 554RC
3.3 D ata Memory
The device has 1024 x8 bits of on-chip RAM and can
address up to 64 KByte of external data memory .
The device has f our sect ions of internal dat a memory:
1. The lower 128 Bytes of RAM (00H to 7FH) are
directly and indirectly addressable.
2. The higher 128 Bytes of RAM (80H to FFH) are
indirectly addressable.
3. The Special Function Registers (SFRs, 80H to
FFH) are directly addressable only.
4. The expanded RAM of 768 Bytes (00H to 2FFH) is
indirectly addressable by the move external
instruction (MOVX) and clearing the EXTRAM bit.
(See “Auxiliary Register (AUXR)” on page 20)
T3-2.0 555
TABLE3-3: SFCF VALUES UNDER DIFFERENT
ESET CONDITIONS
R
State of SFCF[1:0] after:
WDT
Power-on
or
1
SC1
SC0
11 00
10 01x111
01101010
00111111
1. SC1 only applies to SST89E554RC and SST89V554RC.
External
Reset
(default)
Reset
or
Brown-out
Reset
x010
Software
Reset
T3-3.0 555
3.4 Dual Data Pointers
The device has two 16-bit data pointers. The DPTR Select
(DPS) bit in AUXR1 determines which of the two data
pointers is accessed. When DPS=0, DPTR0 is selected;
when DPS=1, DPTR1 is selected. Quickly switching
between the two data pointers can be accomplished by a
single INC instruction on AUXR1.
3.5 Special Function Registers (SFR)
Most of the unique features of the Flash Flex51 microcontroller family are contr o ll ed by bits in s pecial function r eg isters (SFRs) located in the SFR Memory Map shown in
Table 3-4. Individual descriptions of each SFR are provided
and Reset values indicated in T ables 3-5 to 3-9.
1: Device is busy with flash operation.
0: Device has fully completed the last command.
SuperFlash Configuration Register (SFCF)
Location76543210Reset Value
0B1H-IAPEN----
SymbolFunction
IAPENEnable IAP operation
0: IAP commands are disabled
1: IAP commands are enabled
SWRSoftware Reset
See “10.2 Software Reset” on page 47
BSELProgram memory block switching bit
See Figures 3-1 and 3-2.
--xxxxx0xxb
SWRBSEL
x0xxxxxxb
SuperFlash Command Register (SFCM)
Location76543210Reset Value
0B2HFIE FCM6FCM5FCM4FCM3FCM2FCM1FCM000000000b
SymbolFunction
FIEFlash 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_1011b S ector-Erase
000_1101b Block-Erase
000_1100b B yte-Verify
1
000_1110b Byte-Program
000_1111b Prog-SB1
000_0011b Prog-SB2
000_0101b Prog-SB3
000_1001b Prog-SC0
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.
0: Disables the module comparator function.
1: Enables the module comparator function. The comparator is used to implement the
software timer, high-speed output, pulse width modulation, and watchdog timer modes.
CEX[4:0].
1: Enables the capture function with capture triggered by a positive edge on pin
CEX[4:0].
CEX[4:0].
1: Enables the capture function with capture trigg er ed by a negative edge on pin
CEX[4:0].
0: Disable the software timer mode
1: A match of the PCA timer/counter with the compare/capture register sets the
CCF[4:0] bit in the CCON register, flagging an interrupt.
mode.
0: Disable the toggle function
1: A match of the PCA timer/counter with the compare/capture register toggles the
CEX[4:0] pin.
0: Disable the pulse width modulation mode
1: Configures the module for operation as an 8-bit pulse width modulator with output
waveform on the CEX[4:0] pin.
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.
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.
Serial Port Mode Bit 0
SM0SM1ModeDescriptionBaud Rate
000Shift Registerf
0118-bit UARTVariable
1029-bit UARTf
1139-bit UARTVariable
1. f
= oscillator frequency
OSC
OSC
12 (12 clock mode)
OSC
mode) or f
f
OSC
1
/6 (6 clock mode) or f
/32 or f
/32 (12 clock mode)
/16 (6 clock
OSC
/64 or
OSC
OSC
/
SM2Enables 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, and the received byte is a Given
or Broadcast Address. In Mode 0, SM2 should be 0.
RENEnables serial reception.
0: to disable reception.
1: to enable reception.
TB8The 9th data bit that will be transmitted in Modes 2 and 3. Set or clear by software as
desired.
RB8In 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.
TITransmit 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.
RIReceive 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.
The device internal fl ash memor y can be programmed or
erased us ing the f o llowin g two m ethod s:
•External Host Mode
•In-Application Programming (IAP) Mode
logic high to a logic low while RST input is being held continuously high. The device will stay in External Host Mode
as long as RST = 1 and PSEN# = 0.
A Read-ID operation is necessary to “arm” the device in
External Host Mode, and no other External Host Mode com-
4.1 External Host Programming Mode
External Ho st Programming Mod e allows the user to pr ogram the Flash memory directly without using the CPU.
External Ho st Mode is entered by forcing PSEN# from a
mands can be enabled until a Read-ID is performed. In
External Host Mode, the internal Flash memory blocks are
accessed through the re-assigned I/O port pins (see Figure
4-1 for details) b y an ex ternal host, such as a MCU programmer, a PCB tester or a PC-controlled dev elopment board.
The Read-ID command accesses the Signature Bytes that
identify the device and the m anufacturer as SST. External
programmers primarily use these Signature Bytes in the
selection of programming algorithms. The Read-ID command is selected by the command c ode of 0H on P3[7:6 ]
and P2[7:6]. See Figure 4-2 for timing waveforms.
An arming command sequence must take place before
any External Host Mode sequence command is recognized by the device. This prevents accidental trigg ering of
External Hos t Mode Comman ds due to nois e or pro grammer error. The arming command is as follows:
1. PSEN# goes low while RST is high. This will get
the machine in External Host Mode, re-configuring
the pins, and turning on the on-chip oscillator.
2. A Read-ID command is issued, and after 1 ms the
External Host Mode commands can be issued.
After the above sequence, all other Exte rnal Host Mode
commands are enabled. Before the Read-ID command is
received, all other External Host Mode commands
received are igno red.
4.1.3 Detail Explanation of the External Host Mode
Commands
The External Host Mode commands are Read-I D, ChipErase, Block-Erase, Sector-Erase, Byte-Program, ByteVerify, Prog-SB1, Prog-SB2, Prog-SB3, Prog-SC0, ProgSC1, Select-Block0, Select-Block1. See T ables 4-1 and 4-2
for all signal logic assignments, Figure 4-1 for I/O pin
assignments, and Table 4-7 for the timing parameters. The
critical timing for all Erase and Program commands is generated by an on-chip flas h me mo ry contro ller. The high-t olow transition of the PROG # signal initiates the Erase or
Program commands, which are synchronized internally.
The Read comman ds are asynchronous read s, independent of the PROG# signal level.
Following is a detailed description of the External Host
Mode commands:
The Select-Block0 com mand enables Block 0 to be programmed in Exter nal Host Mode. Once this co mmand is
ex e cu te d , al l subsequent External Host Commands wil l be
directed at Block 0. S ee Figure 4-3 for timing waveforms.
This command applies to SST89E564RD/
SST89V564RD only.
The Select-Block1 command enables Block 1 (8 KByte
Block) to be programmed. Once this command is executed, all subsequ ent External Host Command s that are
directed to the address range below 2000H will be directed
at Block 1. The Sele ct-Block1 command only a ffects the
lowest 8 KByte of the program address space. For
addresses greater than or equal to 2000H, Block 0 is
accessed by default. Upon entering External Host Mode,
Block 1 is selected by default. Se e Figure 4-3 for timing
waveforms. This command applies to SST89E564RD/
SST89V564RD only.
The Chip-Erase, Block-Erase, and Sector-Erase commands are used for erasing all or part of the memory
array. Erased data bytes in the memory array will be
erased to FFH. Memory locations that are to be programmed must be in the erase d state pr ior to program ming.
The Chip-Erase command erases all bytes in both memory
blocks, regardless of any previous Select-Block0 or SelectBlock1 commands. Chip-Erase ignores the Security Lock
status and will erase the Security Lock, returning the device
to its Unlocked state. The Chip-Erase command will also
erase the SC0 bit. Upon c ompletion of Chip-Erase command, Block 1 will be the selected block. See Figure 4-4 for
timing waveforms.
The Block-Erase command erases all bytes in the selected
memory blocks. This command will not be executed if the
security lock is enabled. The selection of the memory block
to be erased is d etermined by t he prior execution Selec tBlock0 or Select-Bl ock1 command. Se e Figur e 4-6 for the
timing waveforms.
The Sector-Erase c ommand erases all of the bytes in a
sector. The sector size for the fla sh memory is 128 B ytes.
This command wi ll not be executed if the Sec urity lock is
enabled. See Figure 4-7 for timing waveforms.
The Byte-Program command is used for programming new
data into the memory array. Programming will not take
place if any security locks are enabled. Se e Figure 4-8 for
timing waveforms.
The Byte-Verify command allows the user to verify that the
device correctly performed an Erase or Program command. This comm an d wi ll b e d is a bled if any sec u r it y l ocks
are enabled. See Figure 4-11 for timing waveforms.
The Prog-SB1, Prog-SB2, Prog-SB3 commands program
the security bits, the functions of these bits are described in
the Security Lock secti on an d al s o i n Table 9-1. Once programmed, these bits can only be erased through a ChipErase command. See Figure 4-9 for timing waveforms.
Prog-SC0 comma nd pr ograms SC0 b it, whi ch de ter min es
the state of SFCF[0] out of reset. Once programmed, SC0
can only be re stored to a n erased state v ia a Chip- Erase
command. See Figure 4-10 for timing waveforms.
Prog-SC1 comma nd pr ograms SC1 b it, whi ch de ter min es
the state of SFCF[1] out of reset. Once programmed, SC1
can only be re stored to a n erased state v ia a Chip- Erase
command. See Figure 4-10 for timing waveforms. ProgSC1 is for SST89E554RC/SST89V554RC only .
4.1.4 Externa l Host Mode Clock Source
In External Host Mode, an internal oscillator will provide
clocking for the device. The on-chip oscillator will be turned
on as the device enters External Host Mode; i.e. when
PSEN# goes low while RST is high. Dur ing Exter nal Host
Mode, the CPU core is held in reset. Upon exit from External Host Mode, the internal oscillator is turned off.
4.1.5 Flash Operation Status Detection Via External
Host Handshake
The device provides two meth ods for an external host to
detect the completi on of a flash me mory operatio n to opt imize the Program or Erase time. The e nd of a fla sh me mory operation cycle can be detected by:
1. monitoring the Ready/Busy# bit at P3[ 3];
2. monitoring the Data# Polling bit at P0[3].
4.1.5.2 Data# Polling (P0[3])
During a Program op eration, any attempts to read (Byt eVerify), wh ile the device is busy, will receive the comple ment of the data of the last byte loaded (logic low, i.e. “ 0” for
an erase) on P0[3] with the rest of the bits “0”. During a Program operation, the Byte-Verify command is reading the
data of the last byte loade d, not the data at the addres s
specified.
4.1.6 Step-by-step instructions to perform
External Host Mode commands
To program data into the memory array, apply power
supply voltage (V
) to VDD and RST pins, and per-
DD
form the following steps:
1. Maintain RST high and set PSEN# from logic high
to low, in sequence according to the appropriate
timing diagram.
2. Raise EA# High (V
).
IH
3. Issue Read-ID command to enable the External
Host Mode.
4. Verify that the memory blocks or sectors for programming is in the erased state, FFH. If they are
not erased, then erase them using the appropriate
Erase command.
5. Select the memory location using the address
lines (P3[5:4], P2[5:0], P1[7:0]).
8. Wait for low to high transition on READY/BUSY#
(P3[3]).
9. Repeat steps 5 - 8 until programming is finished.
10. Verify the flash memory contents.
4.1.5.1 Ready/Busy# (P3[3])
The progress of the flash memory programming can be
monitored by the Ready/Busy# output signal. P3[3] is
driven low, some time after ALE/PROG# goes low during a
flash memory operation to indicate the Busy# status of the
Flash Control Unit (FCU). P3[3] is driven high when the
Flash programming operati on is completed to indicate the
Ready status .
4.1.7 Flash Memory Programming Timing Diagrams with External Host Mode
T
SU
RST
T
PSEN#
ALE/PROG#
EA#
ES
T
P2[7:6] ,P3[7:6]
P3[5:4] ,P2[5:0] ,P1
FIGURE4-2: R
P0
Device ID = 91H for SST89E564RD
90H for SST89V564RD
99H for SST89E554RC
98H for SST89V554RC
EAD-ID
RD
0000b
0030H
BFH
Reads chip signature and identification registers at the addressed location.
T
SU
RST
T
T
ES
ADS
T
PROG
PSEN#
ALE/PROG#
T
RD
0000b
0031H
Device ID
T
555 ILL F05.1
DH
EA#
P3[3]
T
PSB
P3[5:4], P2[5:0]A5H/55H
P3[7:6], P2[7:6]
FIGURE4-3: S
ELECT-BLOCK1 / SELECT-BLOCK0
1001b
555 ILL F06.1
Enables the selection o f either of the flash memor y blocks prior to issuing a Byte-Verify, B lock-Erase, SectorErase, or Byte-Program. These commands apply to SST89E564RD/SST89V564RD only.
Programs the addressed cod e byte if the byte location has be en successfully erased and not yet programmed .
Byte-Program operation is only allowed when the security lock is not activated on that flash memory block.
T
SU
RST
T
T
ES
ADS
T
PROG
T
DH
PSEN#
ALE/PROG#
EA#
P3[3]
T
PS
P3[7:6], P2[7:6]
FIGURE4-9: P
ROG-SB1 / PROG-SB2 / PROG-SB3
1111b / 0011b / 0101b
555 ILL F12.1
Programs the Security bits SB1, SB2 and SB3 respectively . Only a Chip-Erase will erase a programmed security bit.
Programs the star t-up configuration bit SC0/SC1. O nly a Chip-Erase will erase a programmed SC0/SC1 bit.
Prog-SC1 applies to SST89E5 54RC/SST89V554RC only.
T
SU
RST
T
ES
PSEN#
ALE/PROG#
EA#
T
OA
P3[7:6], P2[7:6]
P0
P1
T
AHA
DO
AL
1100b
T
ALA
P3[5:4], P2[5:0]
FIGURE 4-11: B
YTE-VERIFY
AH
555 ILL F14.1
Reads the code byte from the addres sed flas h memory location if the secur ity lock is not act ivated on that flas h
memory block.
The device offers either 72 or 40 KByte of In-Application
Programmable flash memory. During In-Application Programming, the CPU of the microcontroller enters IAP
Mode. The two blocks of flash me mory allow the CPU to
execute user code from one block, while the other is being
erased or reprogrammed concu rre ntly. The CPU may also
fetch code from an external memory while all internal flash
is being reprogrammed. The mailbox registers (SFST,
SFCM, SFAL, SF AH, SFDT and SFCF) located in the Special Function Register (SFR), control and monitor the
device’s erase and program process.
Table 4-6 outlines the commands and their associated
mailbox re gister settings .
During IAP Mode, both the CPU core and the flash controller unit are dri ven off th e external clock. However, an internal oscillator will provide timing references for Program and
Erase operations. The inte rnal oscill ator is only tur ned on
when required, and is turned off as soon as the Flash operation is compl eted.
4.2.2 Memory Bank Selection for In-Application
Programming Mode
With the addressing ran ge limited to 16 bit, only 64 KByte
of program address sp ace is “visible” at any o ne time. As
shown in Ta ble 4-4, Bank Selection (the c onfiguration of
EA# and SFCF[1:0]), allows Block 1 memory to be overlaid
on the lowest 8 KByte of B lock 0 m em ory, making Block 1
reachable. The same c oncept is employed to allow both
Block 0 and Block 1 Flash to be acc essible to IAP operations. C ode fr om a b lo c k th at is not vi sib le ma y not be u sed
as a source to program another address. However , a b loc k
that is not “visible” m ay be programmed by code from th e
other block through mailbox registers.
The device allows IAP code in one block of memory to program the other block of memory, but may not program any
location in the sam e block. If an IAP operation origi nates
physically from Block 0, the target of this operation is implicitly defined to be in Blo ck 1. If the IAP op eratio n or igi nates
physically from Block 1, then the target address is implicitly
defined to be in Block 0. If the IAP operation originates from
External program space, then, the target will depend on the
address and the state of Bank Select.
TABLE4-4: IAP A
EA#SFCF[1:0]Address of IAP Inst.Target AddressBlock Being Programmed
1. No operation is performed because code from one block may not program the same originating block
4.2.3 IAP Enable Bit
The IAP Enable Bit, SFCF[6], e nables In-Application Pr ogramming mode. Until this bi t is set all flash pr ogramming
IAP commands will be ignored.
4.2.4 In-Application Programming Mode Commands
All of the following commands can only be initiated in the
IAP Mode. In all situations, wri ting the control byte to the
SFCM register will initiate all of the operations. All commands will not be enabled if the security locks are enabled
on the selected me mory bloc k.
DDRESS RESOLUTIONFOR SST89E564RD/SST89V564RD
The Program command is for programming new data int o
the memory array. The portion of the memory array to be
programmed should be in the erased state, FFH. If the
memory is not erased, it should first be erased with an
appropriate Erase command. Warning: Do not attempt to
write (program or erase) to a block that the code is currently fetching from. This will cause unpredictable program behavior and may corrupt program data.
The Block-Erase command erase s all bytes in one of the
two memory blocks. The s elect ion of the memory block to
be erased is determined by the source of Block-Erase
Command, as defined in T abl e 4-4.
Preliminary Specifications
The Sector-Erase c ommand erases all of the bytes in a
sector. The sector size for the flash memor y Blocks is 12 8
Bytes. The selection of the sector to be erased is determined by the contents of SFAH and SF AL.
The Byte-Program comm and programs data into a s ingle
byte. The address is deter m ined by the contents of SFAH
and SFAL. The data byte is in SFDT .
The Byte-Verify command allows the user to verify that the
device has correctly performed an Erase or Program command.
Byte-Verify command returns th e data byte i n SFDT if the
command is successful. The user is required to check that
the previous Flash operation has fully completed before
issuing a Byte- Verify. By te-Verify comman d execution time
is short enough that there is no need to poll for command
completion and no interrupt is generated.
Prog-SB3, Prog-SB2, Prog-SB1 commands are used to
program the Secur ity bits (see Table 9-1). Comp letion of
any of these commands, the security options will be
updated immediately.
Security bits previously in un-programmed state can be
programmed by these commands. Prog-SB3, Prog-SB2
and Prog-SB1 commands should only reside in Block 1.
Prog-SC0 comman d is used to p rogram the SC0 bi t. This
command only chang es the SC0 bit a nd has no effect on
BSEL bit until after a reset cycle.
SC0 bit previously in un-programmed state can be programmed by this command. The Prog-SC0 command
should reside only in Bl ock 1.
.
Prog-SC1 comman d is used to p rogram the SC1 bi t. This
command only chang es the SC1 bit a nd has no effect on
BSEL bit until after a reset cycle.
SC1 bit previously in un-programmed state can be programmed by this command. The Prog-SC1 command
should reside only in Block 1.
There are no IAP counterparts for the External Host commands Select-Block0 and Select-Block1.
4.2.5 Polling
A command that uses the polling method to detect flash
operation completi on s hould poll on the FLA SH_BUS Y bit
(SFST[2]). When FLASH_BUSY de-asserts (logic 0), the
device is ready for the next operation.
MOVC instruction may als o be used for verifi cation of th e
Programming and Erase operation of the flash memory.
MOVC instruction will fail if it is directed at a flash block that
is still busy.
4.2.6 Interrupt Termination
If interrupt ter mination is selected, (SFCM[7] is set), the n
an interrupt (INT1) will be generated to indicate flash operation completion. Under this condition, the INT1 becomes an
internal in terrupt s ource. The INT 1# pin can now be us ed
as a general purp ose po rt pin and it ca nnot be the so urce
of External Interrupt 1 during In-Application Programming.
In order to use an interrupt to signal flash operation termination. EX1 and E A bi ts of IE r egi ster mus t be s et. The IT1
bit of TCON register must also be set for edge trigger
detection.
Reset Setup TimeT
Read-ID Command WidthT
PSEN# Setup TimeT
Address, Command, Data Setu p TimeT
Chip-Erase TimeT
Block-Erase TimeT
Sector-Erase TimeT
Program Setup TimeT
Address, Command, Data HoldT
Byte-Program Time
Select-Block Program TimeT
Security bit Program TimeT
Verify Command Delay TimeT
Verify High Order Address Delay TimeT
V eri fy Lo w Ord er Addres s Delay TimeT
1. Program and Erase times will scale inversely proportional to programming clock frequency.
2. All timing measurements are from the 50% of the input to 50% of the output.
3. Each byte must be erased before programming.
LASH MEMORY PROGRAMMING/VERIF IC A TI ON PARAMETERS
1,2
3
SymbolMinMaxUnits
SU
RD
ES
ADS
CE
BE
SE
PROG
DH
T
PB
PSB
PS
OA
AHA
ALA
3µs
1 µs
1.125µs
0ns
1.2µs
0ns
125ms
100ms
30ms
50µs
500ns
80µs
50ns
50ns
50ns
T4-7.0 555
5.0 TIMERS/COUNTERS
The device has three 16 -bit regist ers that c an be used as
either timers or event counters. The three Timers/Counters
are denoted Timer 0 (T0), Timer 1 (T1) , and Time r 2 (T2).
Each is design ated a pair of 8-bit regi sters in the SFRs.
The pair consists of a most significant (high) byte and least
significant (low) byte. The respective registers are TL0,
TH0, TL1, TH1, TL2, and TH2.
The device Serial I/O port is a full duplex port that allows
data to be transmitted and received simultaneously in
hardware by the transmit and receive registers, respectively, while the software is performing other tasks. The
transmit and receive registers are both located in the
Serial Data Buffer ( SBUF) special function register. Writing to the SBUF register loads the transmit register, and
reading from the SBUF register obtains the contents of
the receive regi ster.
The UART has four modes of operation which are selected
by the Serial Port Mode Specifier (SM0 and SM1) bits of
the Serial Port Control (SCON) special function register. In
all four modes, transmis sion is initiated by any instructio n
that uses the SBUF register as a destination register.
Reception is initiated in mode 0 when the Receive Interrupt
(RI) flag bit of the Serial Port Control (SCON) SFR is
cleared and the Reception Enable/ Disable (REN) bit of the
SCON register is set. Reception is initiated in the other
modes by the incoming start bit if the REN bit of the SCON
register is set.
6.1.1 Framing Error Detection
Framing Error Detection allows the se ria l por t to au tomatically check for valid stop bits in Mo des 1, 2 or 3. If
a stop bit is missing the Framing Error bit (F E) will be
set. The software can then check this bit after a reception to detect communication errors. The FE bit must
be cleared by software.
The FE bit is loc ated in SCON and sh ares the same bit
address as SM0. The SMOD0 bit located in the PCON register determines which of these two bits is accessed. When
SMOD0 = 0, SCON[7] will act as SM0. When SMOD0 = 1,
SCON[7] will act as FE.
6.1.2 Automatic Address Recognition
Automatic Address Re cognition (AAR) reduces the CP U
time required to ser vice th e seri al por t in a multi processor
environment. When using AAR, the serial port hardware
will only generate an interrupt when it receives its own
address, thus eliminating the software overhead required to
compare addresses.
AAR is only available when using the serial port in either
mode 2 or 3. Setting the SM2 bit in SCON enables AAR.
Each slave must have its SM2 bit set when waiting for an
address (9th bi t = 1) . The R eceiv e Inte rrupt (R I) fla g will only
be set when the recei ved byte matche s eithe r the G iven or
Broadcast Address. The slave then clears its SM2 bit to
enable reception of data bytes (9th bit = 0) from the master.
The master can selectively communicate with groups of
slaves by sending the Given Address. Addressing all
slaves is also possible by sending the Broadcas t address.
The SADDR and SADEN special function registers define
these addresses for each slave.
SADDR specifies a slaves indivi dua l ad dr es s and SADEN
is a mask byte that defines don’t-care bits to form the Given
address when com bi ned wi th S AD DR. The following is a n
exampl e:
UART Slave 1
SADDR=1111 0001
SADEN=1111 1010
GIVEN=1111 0x0x
UART Slave 2
SADDR=1111 0011
SADEN=1111 1001
GIVEN=1111 0xx1
In this example Slave 1 can be distinguished from Slave 2
by using bits 0 and 1. Slave 1 will not respond to an
address that ha s bi t 1 s et to 1 wh ile Slave 2 will. S imila r ly,
Slave 2 will not respond to an address that has bit 0 set to 0
while Slave 1 will. Both slaves will respond to an address of
1111 0x01b so this is t he Broa dcast Addre ss. The Broa dcast Addresses is formed by the logical OR of SADDR and
SADEN with 0s treated as don’t-care bits.
6.2 Serial Peripheral Interface (SPI)
The device SPI allows for high-speed ful l-duplex synchronous data transfer between the device and o ther compat ible SPI devices.
Figure 6-1 shows the correspondence between master
and slave SPI devices. The SCK pin is the clock output and
input for the master and slave modes, respectively . The SPI
clock generator will start following a write to the master
devices SPI data register. The written d ata is then shi fted
out of the MOSI pin on the master device into the MOSI pin
of the slave device. Following a complete transmission of
one byte of data, the SPI clock generator i s stopped and
the SPIF flag is set. An SPI interrupt request will be generated if the SPI interrupt enable bit (SPIE) and the serial port
interrupt enable bit (ES) are both set.
An external master dr ives the Slave Select inpu t pin, S S#/
P1[4], low to select the SPI module as a slave. If SS#/P1[4]
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
input port pin.
CPHA and CPOL control the phase and polarity of the SPI
clock. Figures 6-2 and 6-3 show the four possible combinations of these two bits.
The devic e off ers a pro gram mable Wa tchdog Ti mer (WDT )
for fail safe protection against software dea dlock an d aut omatic recovery.
To protect the s ystem agai nst sof tware deadlock, the user
software must refresh the W DT w ithin a us er-d efine d tim e
period. If the software fails to do this perio dical refresh , an
internal hardware reset will be initiated if enabled (WDRE=
1). The software can be designed such that the WDT times
out if the program does not work properly .
The WDT in the device uses the syst em cl ock (XTAL1) as
its time base. So strictly speaking, it is a watchdog counter
rather than a watchdog timer. The WDT registe r will i ncrement every 344064 cr ys tal clocks. The u pper 8- bits of th e
time base register (WDTD) are used as the reload register
of the WDT.
344064
clks
WDT Upper Byte
Ext. RST
CLK (XTAL1)
Counter
The WDTS flag bit is set by WDT overflow and is not
changed by WDT reset. User software can clear WDTS by
writing “1” to it.
Figure 7-1 provides a block diagram of the WDT . Two SFRs
(WDTC and WDTD) control watchdog timer operation.
During idle mode, WDT operation is temporarily suspended, and resumes upon an interrupt exit from idle.
The time-out period of the WDT is calculated as follows:
Period = (255 - WDT) * 344064 * 1/f
OSC
where WDT is the value loaded in to the WDT regi s ter and
The device is equipped with an integrated Program
Counter Array (PCA). The PCA consists of a dedicated
timer/counter th at serves as the co mm on ti me ba se for an
array of 5 compare/capture modules. Each of the modules
can be programmed in 1 of 4 mode s. Additionally, the 5th
module can be programmed as a Watchdog Timer.
8.1 PCA Timer/Counter
The timer/coun ter for the PCA is a free-ru nning 16 timer
and consists of registers CH and CL (the high and low
bytes of the count values). These registers can be read and
written to at any time. The Count Pulse Select bits (CPS1 &
CPS0) in the CMOD register configure the timer/counter to
operate in 1 of 4 modes. See Table 8-1. The CMOD register also con tains the Counter Idle (CID L) bi t. Wh e n CI DL =
1 the PCA timer/coun ter will be tur ned off wh en the MCU
enters Idle Mode
The Counter Run bit (CR) in CCON register turns the timer/
counter on and of f. When CR = 1 the ti me r/ coun ter is r u nning and when CR = 0 the timer/coun ter will be disa bled.
When the PCA timer/counter overflows the CF bit in CCON
register will be set an d if the ECF bit in CMO D register is
set an interrupt will be gener ated .
8.2 PCA Compare/Capture Modules
Each of the 5 Comp are/ Cap ture mo dule s has a mo de reg ister called CCAPMn (n = 0, 1, 2, 3, or 4) which select s the
function it wi ll perf orm. The se ven possibl e modes and their
associated values for CCAPMn are shown in T able 8-2.
TABLE8-2: POSSIBLE MODESAND ASSOCIATED
ALUESFOR CCAPMN
V
CCAPMn Value
without
interrupt
Module Function
Capture Po si tive Edge Only20H21H
Capture Negative Edge Only10H11H
Capture Both Edges30H31H
16-Bit Software Timer48H49H
High Speed Output4CH4DH
Pulse Widt h Modulato r42H43H
Watchdog Timer
1. Only for Module 4
1
enabled
48H or 4CH-
with
interrupt
enabled
T8-2.0 555
Additionally each of the five modules has two 8-bit capture/
compare registers (CCAPnH & CCAPnL) and an external
input/output pin associated with it. The external input/output
pins are P1.3 for Module 0, P1.4 for Modul e 1, P1.5 for
Module 2, P1.6 for Module 3 a nd P 1.7 for Module 4. Each
module also has an associated event flag CCFn located in
CCON register. These flags must be clear ed by so ftw are .
Writing to CCA PnL w ill disa ble the co mpare feature of th e
corresponding module and writing to CCAPnH will reenable it. Therefore, when using th e compare feature (16Bit Software Timer, High Speed Output, Pulse Width Modulator & Watchdog Timer modes) the software should
always write to CCAPnL first an d then write to CCAPnH
second.
8.2.1 Capture Mode
Capture Mode is used to capture the PCA timer/counter
value into a module’s capture registers (CCAPnH &
CCAPnL). The capture will occur on a positive edge, a negative edge or both edges of th e input signal on th e corresponding external input pin depending on whic h mode is
selected. Also, the event flag (CCFn) is set and an interrupt
is generated if ECCFn is set.
In the 16-bit Software Timer mode the PCA timer/ counter
value is compared with the 16-bit value pre-loaded into the
module’s compare registers (CCAPnH & CCAPnL). When
a match occurs, the event flag (CCFn) is set and an in terrupt is generated if ECCFn is set.
8.2.3 High Speed Output Mode
In the High Speed Output mode, the PCA timer/counter is
compared with the 16-bit value pre-loaded into the module’s
compare registers (CCAPnH & CCAPnL). When a match
occurs, the modules corresponding output pin is toggled.
Additionally the event flag (CCFn) is set and an interrupt is
generated if ECCFn is set. The frequency of the output is
only dependent on the PCA timer/counter a nd will be the
same for all 5 modules but the duty cycle can vary depending on the value pre-loaded into the compare registers.
8.2.4 Pulse Width Modulator
The Pulse Width Modu lator mode generates 1 -bit PWMs
by comparing the low byte of the PCA time r (CL) with the
low byte of the compare registers (CCAPnL). When CL <
CCAPnL the corresponding output pin is low. When CL >
CCAPnL the corresponding output pin is high. The frequency of the PW M is onl y dependent on the PCA timer/
counter and will be the s ame for all 5 modules. The duty
cycle will vary depending on the value in CCAPnL.
CCAPnL can be chan ged dynamically by loading a new
value into CCAPnH. This new value will be shifted into
CCAPnL when CL rolls over from FFH to 00H.
8.2.5 Watchdog Timer
Only Module 4 can be pr ogramme d as a Watchdog T im er
(but it can still be pro grammed to the other modes if th e
Watchdog Timer mode is not us ed). T he Watchdog Timer
compares the PCA timer/counter value (CH & CL) with
Module 4’s compare registers (CCAP4H & CCAP4L).
When a match occurs, an internal reset will be generated if
the WDTE bit in CMOD r egister is set. This internal re set
will not cause the RST pin to be driven high. In order to
hold of the reset the user must periodically change the
compare value so it will never match the PCA timer.
9.0 SECURITY LOCK
The Security Lock protects against software piracy and
prevents the contents of the flash from being read by unauthorized parties. It also protects against code corruption
resulting from acc idental erasing and pro gramming to the
internal flash memory. There are two different types of
security locks i n the d evic e security loc k system: Hard Loc k
and SoftLock.
9.1 Hard Lock
When Hard Lock is activated, MOVC or IAP instructio ns
executed from an unlocked or SoftLocked program
address space, are disabled from reading code bytes in
Hard Locked memory blocks (See Table 9-2). Hard Lock
can either lock both flash memory blocks or just lo ck the 8
KByte flash memory block (Block 1). All External Host an d
IAP commands except for Chip-Erase are ignored for
memory blocks that are Hard Locked.
9.2 SoftLock
SoftLock allows flash contents to be altered under a secure
environment. This lock option allows the user to update
program code in the SoftLocked memory block through InApplication Programming Mode under a predetermined
secure environmen t. For example, if Block 1 (8 K) m emory
block is locked (Hard Locked or SoftLocked), and Block 0
(64K for SST89E564RD/SST89V564RD) memory block is
SoftLocked, code residing in Block 1 can program Block 0.
The following IAP mode commands issued through the
command mailbox register, SFCM, executed from a
Locked (Hard Locked or SoftLocked) block, can be operated on a SoftLocked block: Block-Erase, Sector-Erase,
Byte-Program and Byte-Verify.
In External Host Mode, SoftLock behaves the sam e as a
Hard Lock.
9.3 Security Lock Status
The three bits that indicate the device security lock
status are located in S FST [7: 5]. A s shown in Fig ur e 91 and Table 9-1, the three s ec urity lock bits control th e
lock status of the primary and secondary blocks of
memory. There are four distinct levels of security lock
status. In the first level, none of the secur ity lock bits
are programmed and both blocks are unlo cked. In the
second level, although both blocks are now locked and
cannot be programmed, they are available for read
operation via Byte-Verify. In t he t hir d level, three different options are available: Block 1 Hard Lock / Block 0
SoftLock, SoftLock on both blocks, and Hard Lock on
both blocks. Locking both blocks is the same as Level
of security is the most secure level. It doesn’t allow
read/program of internal memory or boot from external
memory. Please note that for unused combinations of
UUU/NN
PUU/SS
UPU/SS
the security lock bits, the chip will default to Level 4
status. For details on how to program the security lock
bits refer to the External Host Mode and In-Application
Programming Section.
Level 1
Level 2
UUP/LS
Level 3
UPP/LLPPU/LS
FIGURE9-1: S
Note: P = Programmed (Cell logic state = 0), U = Unprogrammed (Cell logic state = 1), N = Not Locked, L = Hard Locked, S = SoftLocked
ECURITY LOCK LEVELS
PUP/LLUPP/LL
PPP/LL
Level 4
555 ILL F19.0
.
TABLE9-1: SECURITY LOCK OPTIONS
Security Lock Bits
Level
1000UUUUnlockUnlockNo Security Features are Enabled.
2100PUUSoftLockSoftLockMOVC instructions executed from
3011
101
U
P
010UPUSoftLockSoftLockLevel 2 plus Verify disabled. Code in
110
001
P
U
4111PPPHard LockHard LockSame as Level 3 Hard Lock/Hard
1. P = Programmed (Cell logic state = 0), U = Unprogrammed (Cell logic state = 1).
2. SFST[7:5] = Security Lock Decoding Bits (SECD)
1,2
1
SB3
1
Security Status of:
Block 1Block 0
Security TypeSFST[7:5]SB1SB2
external program memory are disabled from fetching code bytes from
internal memory, EA# is sampled and
latched on Reset, and further programming of the flash is disabled.
P
U
P
Hard LockHard LockLevel 2 plus Verify disabled, both
P
blocks locked.
Block 1 ma y prog ram Blo ck 0 an d vice
versa.
P
U
U
Hard LockSoftLockLevel 2 plus Verify disabled. Code in
P
Block 1 may program Block 0.
Lock, but MCU will start code execution from the internal memory regardless of EA#.
A system reset initializes the MCU and begins program
execution at program memor y location 0000H. The r eset
input for the device is the RST pin. In order to reset the
device, a logic level high must be applied to the RST pin for
at least two machine cycle s (24 clo cks), after the oscil lator
becomes stable. ALE, PSE N# are weakly pulled hi gh dur ing reset. During reset, ALE and PSEN# output a high level
in order to perform a prop er reset. This level must not be
affected by external element. A system reset will not affect
the 1 KByte of on-chip RAM while the device is running,
however, the contents of the on-chip RAM during power up
are indeterminate. Following reset, all Special Function
Registers (SFR) return to their reset values outlined in
Tables 3-5 to 3-9.
10.1 Power-On Reset
At initial power up, the port pins will be in a random state
until the oscill ator has star ted and the internal reset algorithm has weakly pulled all pins high. Powering up the
device without a valid reset could cause the MCU to
start executing instructions from an indeterminate
location. Such undefined states may inadvertently corrupt the code in the flash.
When power is applied to the device, the RST pin must be
held high long enoug h for the oscilla tor to st art up (usual ly
sev eral milliseco nds f or a lo w freq uency crystal), i n addition
to two machine cycles for a valid Power-On Reset. An
example of a method to extend the RST signal is to implement a RC circuit by connecting the RST pin to V
through a 10 µF capac itor and to VSS through an 8.2KΩ
resistor as shown in Figure 10-1. Note that if an RC circuit
is being used, provisi ons should be made to ensure the
rise time does not exceed 1 millisecond and the oscil-
V
DD
lator start-up time does not exceed 10 milliseconds.
For a low frequency oscillator wit h slow start-up tim e the
reset signal must be extended in order to a ccount for the
slow start-up ti me. This method maintains the necessar y
relationship between V
and RST to avoid programming
DD
at an indeterm inate locati on, which may cause corr uption
in the code of the fl ash. For more information on sy stem
level design techniques, please r ev iew D esign Considerations for the SST FlashFlex51 Family Microcontroller
Application Note.
DD
V
DD
10µF
8.2K
FIGURE 10-1: P
+
-
C
2
C
1
OWER-ON RESET CIRCUIT
RST
SST89E5x4/V5x4
XTAL2
XTAL1
V
DD
555 ILL F20.0
10.2 Software Reset
The software reset is executed by changing SFCF[1]
(SWR) from “0” to “1”. A software reset will reset the program counter to address 0000H. All SFR registers will be
set to their reset values, except SFCF[1] (SWR), WDTC[2]
(WDTS), and RAM data will not be altered.
10.3 Brown-out Detection Reset
The device includes a Brown-out detection circuit to protect
the system from severe V
fluctuations. For Brown-out
DD
voltage parameters, please refer to Tables 11-3 and 11-4.
Brown-out interr upt ca n be ena bled by setting th e EBO bi t
in IEA register (address E8H, bit 3). If EBO bit is set and a
Brown-out conditi on occurs, a Brown-out interr upt will be
generated to execute the program at location 0 04BH. It is
required that the EB O bit be cleare d by software after the
Brown-out interrupt is serviced. Clearing EBO bit when the
Brown-out condition is active will properly reset the device.
If Brown-out interrupt is not enabled, a Brown-out conditi on
will reset the program to resume execution at location 0000H.
10.4 Interrupt Priority and Polling
Sequence
The device suppor ts eight interrupt so urces under a four
level priority scheme. Table 10-1 summarizes the polling
sequence of the supported interrupts. Note that the SPI
serial interface and the UART share the same interrupt
vector.
The device provides three power saving modes of operation for applications where p ower consumption is c ritical.
The three power saving modes are: Idle, Power Down and
Standby (Stop Clock).
10.5.1 Idle Mode
Idle mode is entered setting the IDL bit in the PCON register. In Idle mode, the program counter (PC) is stopped. The
NTERRUPT POLLING SEQUENCE
Vector
Address
Interrupt
Enable
The device exits Power Down mode through either an
enabled external level sensitive interrupt or a hardware
reset. The star t of the int errup t clears the PD bit a nd exits
Power Do wn. Holding the external interrupt pin low restarts
the oscillator, the signal must hol d low at least 1024 c lock
cycles before bringing back high to complete the exit. After
exit the interrupt service routine program execution
resumes beginning at the instruction immediately following
the instruction which invoked Power Down mode. A hardware reset starts the device similar to power-on reset.
Interrupt
Priority
Arbitration
Ranking
Wake-Up
Power Down
system clock continues to run and all interrupts and peripherals remain active. The on-chip RAM and the special function registers hold their data during this mode.
To exit properly out of Power Down, the reset or external
interrupt should not be executed before the V
restored to its normal operating vo ltage. Be sure to hold
The device exits Idle mo de through either a s ystem interrupt or a hardware reset. Exiting Idle mode via system
interrupt, the start of the interrupt clears the IDL bit and
voltage long enough at its normal operating level for
V
DD
the oscillator to restart and stabilize (normally less than
10 ms).
exits Idle mode. After exit the Interrupt Service Routine, the
interrupted program resumes execution beginning at the
instruction immediately following the instruction which
invoked the Idle mode. A ha rdware r ese t starts the device
similar to a power-on reset.
10.5.2 Power Down Mode
The Power Down mode is entered by setting the PD bit in
the PCON register. In the Power Down mode, the clock is
stopped and external interrupts are active for level sensitive
interrupts only. T o retain the on-chip RAM and all of the special function registers’ values, the minim um V
level is 2.0V.
DD
10.5.3 Standby Mod e (Stop Clock)
Standby mode is similar to Power Down mode, except that
Power Down mode is initiated by a software command and
Standby mode is in itiated by extern al hardware gating off
the external clock to the device.The on-chip SRAM and
SFR data are maintained in Standby mode. The device
resumes oper a tio n at t he n ext instruction when the clock is
reapplied to the part.
Table 10-2 outlines the different power-saving modes,
including entry and exit procedures and MCU functionality.
External hardware gates OFF
the external clock input to the
MCU. This gating should be
synchronized with an input
clock transition (low-to-high or
high-to-low).
Software
(Set PD bit in
PCON)
CLK is running.
Interrupts, serial port and timers/counters are active. Program Counter is stopped.
ALE and PSEN# signals at a
HIGH level during Idle. All
registers remain unchanged.
CLK is stopped. On-chip
SRAM and SFR data is maintained. ALE and PSEN# signals at a LOW level during
Power Down. External Interrupts are only active for level
sensitive interrupts , if
enabled.
CLK is frozen. On-chip SRAM
and SFR data is maintained.
ALE and PSEN# are maintained at the levels prior to
the clock being frozen.
Enabled interrupt or hardware reset.
Start of interrupt clears IDL bit and
exits Idle mode, after the ISR RETI
instruc tion, program r esumes execution beginning at the instruction following the one that invoked Idle mode. A
user could consider placing two or
three NOP instructions after the
instruction that invokes idle mode to
eliminate any problems. A hardware
reset restarts t he device similar t o a
power-on rese t.
Enabled external level sensitive interrupt or hardware reset. Start of interrupt clears PD bit and exits Power
Down mode, after the ISR RETI
instruction program resumes execution
beginning at the instruction following
the one that invoked Power Down
mode. A user could consider placing
two or three NOP instructions after th e
instruction that invokes Power Down
mode to eliminate any problems. A
hardware reset restarts the de vice s imilar to a power-on reset.
Gate ON external clock. Program execution resumes at the instruction following the one during which the clock
was gated off.
Shown in Figure 10 -2 are the i nput a nd out put of an internal inverting am plifier ( XTAL1, XTAL2 ), whic h can be configured for use as an on-chip oscillator.
When driving the device from an external clock source,
XTAL2 sho uld be left di sconnected and XTAL1 should be
driven.
At star t-up, the external oscillat or may encoun ter a high er
capacitive load at XTAL1 due to interaction between the
amplifier and its feedback capacitance. However, the
capacitance will not exceed 15 pF once the external signal
meets the V
and VIH specifications.
IL
10.7 Recommended Capacitor Values for
Crystal Oscillator
Crystal manufacturer, supply voltage, and other factors
may cause circuit perfor mance to differ from one application to another. C1 and C2 shou ld be adjusted appropr iately for each design. The table be low, sh ows the typical
values for C1 and C2 at a given fr equen cy. If following the
satisfactory selection of all external components, the circuit
is still over driven, a series resistor, Rs, may be added.
RECOMMENDEDVALUESFORCRYSTALOSCILLATOR
FrequencyC1 and C2RS (Optional)
< 8MHz90-110pF100Ω
8-12MHz18-22pF200Ω
>12MHz18-22pF200Ω
More specific information about on-chip oscillator design
can be found in FlashFlex 51 Oscillator Circuit Design Con-siderations Application Note.
Absolute Maximum Stress Ratings (Applied conditions greater than those listed under “Absolute Maximum
Stress Ratings” may cause pe r manent dama ge to the device. This is a stres s rating only and funct ional operatio n
of the device at these conditions or conditions greater tha n those defined in the ope rational 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.
Input Leakage Current (Port 0)0.45 < VIN < VDD-0.3±10µA
RST Pull-down Resistor225kΩ
Pin Capacitance
Power Supply Current
6
7
In-Application Mode70mA
Active Mode22mA
Idle Mode6.5mA
Standby (Stop Clock) ModeT
= 0°C to +70°C70µA
amb
T
= -40°C to +85°C88µA
amb
Power Down ModeMinimum VDD = 2V
= 0°C to +70°C40µA
T
amb
T
= -40°C to +85°C50µA
amb
1. Under steady state (non-transient) conditions, IOL must be externally limited as follows:
Maximum I
Maximum I
Maximum I
exceeds the test condition, VOH may exceed the related specification. Pins are not guaranteed to sink current greater than the
If I
OL
listed test conditions.
2. Capacitive loading on P orts 0 & 2 may cause spurious noise to be superimposed on the V
to external bus capacitance discharging into the Port 0 & 2 pins when the pins make 1-to-0 transitions during bus operations. In the
worst cases (capacitive loading > 100pF), the noise pulse on the ALE pin may exceed 0.8V. In such cases, it may be desirable to
qualify ALE with a Schmitt Trigger, or use an address latch with a Schmitt Trigger STROBE input.
3. Load capacitance for Port 0, ALE & PSEN#= 100pF, load capacitance for all other outputs = 80pF.
4. Capacitive loading on Ports 0 & 2 may cause the V
on ALE and PSEN# to momentarily fall below the VDD - 0.7 specification when
OH
the address bits are stabilizing.
5. Pins of Ports 1, 2 & 3 source a transition current when they are being externally driven from 1 to 0. The transition current reaches its
maximum value when V
is approximately 2V.
IN
6. Pin capacitance is characterized but not tested. EA# is 25pF (max).
7. See Figures 11-1, 11-2, 11-3 and 11-4 fo r test conditions. Minimum V
TABLE 11-5: AC E LECTRICAL CHARACTERISTICS (CONTINUED) (2 OF 2)
= 0°C TO +70°C OR -40°C TO +85°C, VDD = 2.7-3.6V @25MHZ, 4.5-5.5V @ 40MHZ, VSS = 0
T
amb
Oscillator
25MHz40MHzVariable
SymbolParameter
T
QVWH
T
RLAZ
T
WHLH
Data Valid to WR# High
RD# Low to Address Float000ns
RD# to WR# High to ALE High43123T
Min Max Min MaxMinMax
4337T
1257T
1040T
- 70 (3V)ns
CLCL
- 50 (5V)ns
CLCL
- 25 (3V)T
CLCL
- 15 (5V)T
CLCL
+ 25 (3V) ns
CLCL
+ 15 (5V)ns
CLCL
11.5 AC Characteristics
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: AddressQ: Output data
C: ClockR: RD# signal
D: Input dataT: Time
H: Logic level HIGHV: Valid
I:Instruction (program memory contents)W: WR# signal
L: Logic level LOW or ALEX: No longer a valid logic level
P: PSEN#Z: High Impedance (Float)
Units
T11-5.0 555
For example:
T
= Time from Address Valid to ALE Low
AVLL
= Time from ALE Low to PSEN# Low
T
LLPL
V
IHT
V
ILT
AC Inputs during testing are driven at V
V
(0.45V) for a Logic "0". Measurement reference points for inputs and
ILT
outputs are at V
HT
FIGURE 11-5: AC T
V
HT
V
LT
(VDD -0.5V) for Logic "1" and
IHT
(0.2VDD + 0.9) and VLT (0.2VDD - 0.1)
Note: VHT- V
VLT- V
V
IHT-VINPUT
V
ILT
ESTING INPUT/OUTPUT, FLOAT WAVEFORM
555 ILL F26a.0
Test
HIGH
Test
LOW
HIGH Test
- V
LOW Test
INPUT
V
+0.1V
LOAD
V
LOAD
V
-0.1V
LOAD
For timing purposes a port pin is no longer floating when a 100 mV
change from load voltage occurs, and begins to float when a 100 mV
change from the loaded VOH/VOL level occurs. IOL/I