PSD provides an integrated solution to 16-bit MCU
based applications that includes configurable
memories, PLD logic and I/O:
■ Dual Bank Flash Memories
– 4 Mbit of Primary Flash Memory (8 uniform
sectors, 32K x 16)
– 256 Kbit Secondary Flash Memory with 4
sectors
– Concurrent operation: read from one memory
while erasing and writing the other
■ 64 Kbit SRAM (Battery Backed)
■ PLD with macrocells
– Over 3000 Gates of PLD: CPLD and DPLD
– CPLD with 16 Output Macrocells (OMCs) and
24 Input Macrocells (IMCs)
– DPLD – user defined in ternal chip select de-
coding
■ Seven l/O Ports with 52 I/O pins
– 52 individually conf igurable I / O port p ins that
can be used for the following functions:
– MCU I/Os
–PLD I/Os
– Latched MCU address output
– Special function l/Os
– l/O ports may be configured as open-drain
outputs
■ In-System Programming (ISP) with JTAG
– Built-in JTAG compliant serial port allows full-
The PSD family of memory systems for microcontrollers (MCUs) brings In-System-Programmability
(ISP) to Flash memory and programmable logic.
The result is a simple and flexible solution for embedded designs. PSD dev ices combine many of
the peripheral functions found in MCU based applications.
PSD devices integrate an optimized Macrocell logic architecture. The Macrocell was creat ed to address the unique requirements of embedded
system designs. It allows direct connection between the system address/data bus, and the internal PSD registers, to simplify communication
between the MCU and other supporting devices.
The PSD family offers two methods to program the
PSD Flash me mory while the PSD is soldered t o
the circuit board: In-System Programming (ISP)
via JTAG, and In-Application Programming (IAP).
In-System Programming (ISP) via JTAG
An IEEE 1149.1 compliant JTAG In-System Programming (ISP) interface is inclu ded on the P SD
enabling the entire device (Flash m emo ries, PLD,
configuration) to be rapidly programmed while soldered to the circuit board. This requires no MCU
participation, which means the PSD can be programmed anytime, even when completely blank.
The innovative JTAG interface to Flash memories
is an industry first, solving key problems faced by
designers and manufacturing houses, such as:
V
SS
AI04916
First time programming. How do I get firmware
into the Flash memory the very first time? JTAG is
the answer. Program the blank PSD with no MCU
involvement.
Inventory build-up of pre-programme d devices. How do I maintain an ac curate count of pre-
programmed Flash memory and PLD devices
based on customer demand? How many and what
version? JTAG is the answer. Build your hardware
with blank PSDs soldered directly to the board and
then custom program just before they are shipped
to the customer. No more labels on chips, and no
more wasted inventory.
Expensive sockets. How do I eliminate the need
for expensive and unreliable sockets? JTAG is the
answer. Solder the PSD directly to the circuit
board. Program first time and subsequent times
with JTAG. No need to handle devices and b end
the fragile leads.
Two independent Flash memory arrays are included so that the MCU can execute code from one
while erasing and programming the o the r. Robu st
product firmware updates in the filed a re possible
over any communication channel (CAN, Ethernet,
UART, J1850, etc) using this unique architecture.
Designers are relieved of these problems:
Simultaneous rea d and write to Flash memory. How can the MCU program the same memory
from which it executing code? It canno t. The P S D
allows the MCU to operate the two Flash me mory
blocks concurrently, reading code from one while
erasing and programming the other during IAP.
Complex memory mapping. How can I map
these two memories efficiently? A program mable
6/89
Decode PLD (DPLD) is embedded in the PSD.
The concurrent PSD memories can be mapped
anywhere in MCU address space, segment by
segment with extermely hi gh address resolution.
As an option, the secondary Flash memory can be
swapped out of the system memory map when
IAP is complete. A built-in page register breaks the
MCU add re ss limit.
Separate Program and Data space. How can I
write to Flash memory while it res ide s in Program
space during field firmware updates? My
80C51XA will not allow it. The PSD provides
means to reclassify Flash m em ory as Data space
during IAP, then back to Program space when
complete.
PSD4235G2V
PSDsoft Express
PSDsoft Express, a software development tool
from ST, guides you through the design process
step-by-step making it possible to complete an
embedded MCU design capable of ISP/IAP in just
hours. Select your MCU and PSDsoft Express
takes you through the remainder of the design with
point and click entry, covering PSD selection, pin
Figure 4. PSD Block Diagram
)
PE6
(
VSTDBY
PA0 – PA7
UNIT
POWER
MANGMT
4 MBIT PRIMARY
FLASH MEMORY
16 SECTORS
4 SECTORS
FLASH MEMORY
(BOOT OR DATA)
256 KBIT SECONDARY
PORT
PROG.
BACKUP SRAM
64 KBIT BATTERY
definitions, programmable logic inputs and outpus,
MCU memory map definition, ANSI-C code generation for your MCU, and merging your MCU firmware with the PSD design. When complete, two
different device programmers are supported directly from PSDsoft Express: FlashLINK (JTAG)
and PSDpro.
A
PORT
PB0 – PB7
PORT
PROG.
B
PORT
PC0 – PC7
PORT
PROG.
PORT
C
PORT F
PD0 – PD3
PORT
PROG.
D
PORT
PROG.
JTAG
SERIAL
PE0 – PE7
PORT
CHANNEL
E
PORT
PORT A & B
8 EXT CS TO PORT C or F
16 OUTPUT MACROCELLS
(CPLD)
FLASH ISP CPLD
82
F
PORT
PORT
PROG.
PF0 – PF7
ADDRESS/DATA/CONTROL BUS
PLD
BUS
INPUT
EMBEDDED
PAGE
REGISTER
ALGORITHM
8
SECTOR
SELECTS
)
(
FLASH DECODE
PROG.
MCU BUS
CNTL0,
CNTL1,
CNTL2
DPLD
PLD
INTRF.
SECTOR
SELECTS
82
RUNTIME CONTROL
AND I/O REGISTERS
SRAM SELECT
PERIP I/O MODE SELECTS
CSIOP
ADIO
PORT
AD0 – AD15
Note: Additio nal address li nes can be brou ght in to the devi ce via Port A, B, C, D or F.
PORT A ,B & C
24 INPUT MACROCELLS
MACROCELL FEEDBACK OR PORT INPUT
CLKIN
G
PORT
PORT
PROG.
PG0 – PG7
CLKIN
LOADER
& FLASH MEMORY
PLD, CONFIGURATION
GLOBAL
SECURITY
CONFIG. &
CLKIN
AI04990
7/89
PSD4235G2V
PSD ARCHITECTURAL OVERVIEW
PSD devices contain several major functional
blocks. Figur e 4 shows the architect ure of the PSD
device family. The functions of each block are described briefly in the following sections. Many of
the blocks perform multiple functions and are user
configurable.
Memory
Each of the memory blocks is briefly discussed in
the following paragraphs. A more detailed discus-
sion can be found in the section entitled “Memory
Blocks“ on page 20.
The 4 Mbit primary Flash memory is the main
memory of the P SD. It is divided into 8 eq uallysized sectors that are individually selectable.
The 256 K bit s econdary Flash mem ory i s divided
into 4 equally-sized sectors. Each sector is individually selectable.
The 64 Kbit SRAM is intended for use as a
scratch-pad memory or as an extension to the
MCU SRAM. If an external battery is connected to
the PSD’s Voltage Stand-by (VSTBY, PE6) signal,
data is retained in the event of power failure.
Each memory block can be located in a different
address space as defined by the user. The access
times for all memory types includes the address
latching and DPLD decoding time.
PLDs
The device contains two PLD blocks, the Decode
PLD (DPLD) and the Complex PLD (CPLD), as
shown in Table 2, each optimized for a different
function. The functional partitioning of the PLDs
reduces power consumption, optim izes cost/performance, and eases design entry.
The DPLD is used to decode addresses and to
generate Sector Select signals for the PSD internal memory and regis ters. Th e DPLD has combinatorial outputs, while the CPLD can implement
more general user-defined logic functions. The
CPLD has 16 Output Macrocells (OMC) and 8
combinatorial outputs. The PSD also has 24 Input
Macrocells (IMC) that can be configured as inputs
to the PLDs. The PLDs receive their inputs from
the PLD Input Bus and are di fferentiated by their
output destinations, number of product terms, and
Macrocells.
The PLDs consume minimal power. The speed
and power consumption of the PLD i s controlled
by the Turbo bit in PMMR0 and other bits in
PMMR2. These registers are set by the MCU at
run-time. There is a slight penalty to PLD propagation time when not in the Turbo mode.
I/O Po r t s
The PSD has 52 I/O pins divided among seven
ports (Port A, B, C, D, E, F and G). Each I/O pin
can be individually configured for different func-
tions. Ports can be configured as standard MCU I/
O ports, PLD I/O, or latched address outputs for
MCUs using multiplexed address/data buses
The JTAG pins can be e nabled on Port E for InSystem Programming (ISP).
Table 2. PLD I/O
NameInputsOutputs
Decode PLD (DPLD)821743
Complex PLD (CPLD)8224150
Product
Terms
MCU Bus Interface
The PSD easily interfaces easily with most 16-bit
MCUs, either with multiplexed or non-multiplexed
address/data buses. The device is configured to
respond to the MCU’s control pins, which are also
used as inputs to the PLDs.
ISP via JTAG Port
In-System Programming (ISP) can be pe rformed
through the JTAG signals on Port E. This serial interface allows complete programming of the entire
PSD device. A blank device can be completely
programmed. The JTAG signals (TMS, TCK,
TSTAT, TERR
, TDI, TDO) can be multiplexed with
other functions on Port E. Table 3 indicates the
JTAG pin assignments.
In-System Progr a mming ( ISP)
Using the JTAG signals on Port E, the entire PSD
device (memory, logic, configuration) can be programmed or erased without the use of the MCU.
Table 3. JTAG SIgnals on Port E
Port E PinsJTAG Signal
PE0TMS
PE1TCK
PE2TDI
PE3TDO
PE4TSTAT
PE5TERR
In-Application Programming (IAP)
The primary Flash memory can also be programmed, or re-programmed, in-system by the
MCU executing the programming algorithms out of
the secondary Flash memory, or SRAM. The secondary Flash memory can be programmed the
same way by executing out of the primary Flash
memory. Table 4 indicates which programming
methods can program different functional blo cks
of the PSD.
8/89
PSD4235G2V
Page Re gi st er
The 8-bit Page Register expands the address
range of the MCU by up to 256 times. The paged
address can be used as part of the address space
to access external memory and peripherals, or internal memory and I/O. The Page Register can
also be used to change the address mapping of
the Flash memory blocks into different memory
spaces for IAP.
Power Management Unit (PMU)
The Power Management Unit (PMU) gives the
user control of the power consumption on selected
functional blocks based on system req uirements.
The PMU includes an Automatic Power-down
(APD) Unit that turns off device functions during
MCU inactivity. The APD Unit has a Power-down
mode tha t helps redu ce pow er co nsumption.
The PSD also has some bits that are configured at
run-time by the MCU to reduce power consumption of the CPLD. The Turbo bit in PMMR0 can be
reset to 0 and the CPLD l atches its outputs and
goes to Stand-by mode until the next transition on
its inputs.
Additionally, bits in PMMR2 can be set by the
MCU to block signals from entering the CPLD t o
reduce power consumption. See th e section enti-
tled “Power Management” on page 59 for more details.
Table 4. Methods of Programming Different Functional Blocks of the PSD
The PSD family is supported by PSDsoft Express,
a Windows-based software development tool
(Windows-95, Windows-98, Windows-2000, Windows-NT). A PSD design is quickly and easily produced in a point and click environment. The
designer does not need to enter Hardware Description Language (HDL) equations, unless desired, to define PSD pin functions and memory
map information. The general design flow is
shown in Figure 5. PSDsof t Express is available
from our web site (the address is given on the back
Figure 5. PSDsoft Express Developmen t Tool
Choose MCU and PSD
Automatically configures MCU
bus interface and other
PSD attributes
Define PSD Pin and
Node Functions
Point and click definition of
PSD pin functions, internal nodes,
and MCU system memory map
page of this data sheet) or other distribution channels.
PSDsoft Express directly supports two low cost
device programmers form ST: PSDpro and
FlashLINK (JTAG). Both of these programmers
may be purchased through your local distributor/
representative, or directly from our web site using
a credit card. The PSD is also supported by t hid
party device programmers. See our web site for
the current list.
Define General Purpose
Logic in CPLD
Point and click definition of combinatorial and registered logic in CPLD.
Access HDL is available if needed
Merge MCU Firmware
with PSD Configuration
A composite object file is created
containing MCU firmware and
PSD configuration
*.OBJ FILE
PSD Programmer
PSDPro, or
FlashLINK (JTAG)
MCU FIRMWARE
HEX OR S-RECORD
FORMAT
*.OBJ FILE
AVAILABLE
FOR 3rd PARTY
PROGRAMMERS
(CONVENTIONAL or
JTAG-ISC)
C Code Generation
GENERATE C CODE
SPECIFIC TO PSD
FUNCTIONS
USER'S CHOICE OF
MICROCONTROLLER
COMPILER/LINKER
AI04919
10/89
PIN DESCRIPTION
Table 5 describes the signal names and signal
functions of the PSD. Those that have multiple
names or functions are defined using PSDsoft Express.
Table 5. Pin Description (for the TQFP package)
Pin NamePinTypeDescription
This is the lower Address/Data port. Connect your MCU address or address/data bus
according to the following rules:
1. If your MCU has a multiplexed address/data bus where the data is multiplexed with
the lower address bits, connect AD0-AD7 to this port.
ADIO0ADIO7
ADIO8ADIO15
CNTL059I
CNTL160I
CNTL240I
Reset
3-7
10-12
13-20 I/O
39I
I/O
2. If your MCU does not have a multiplexed address/data bus, connect A0-A7 to this
port.
3. If you are using an 80C51XA in burst mode, connect A4/D0 through A11/D7 to this
port.
ALE or AS latches the address. The PSD drives data out only if the read signal is active
and one of the PSD functional blocks has been selected. The addresses on this port
are passed to the PLDs.
This is the upper Address/Data port. Connect your MCU address or address/data bus
according to the following rules:
1. If your MCU has a multiplexed address/data bus where the data is multiplexed with
the upper address bits, connect A8-A15 to this port.
2. If your MCU does not have a multiplexed address/data bus, connect A8-A15 to this
port.
3. If you are using an 80C51XA in burst mode, connect A12/D8 through A19/D15 to this
port.
ALE or AS latches the address. The PSD drives data out only if the read signal is active
and one of the PSD functional blocks has been selected. The addresses on this port
are passed to the PLDs.
The following control signals can be connected to this pin, based on your MCU:
– active Low, Write Strobe input.
1. WR
– active High, read/active Low write input.
2. R_W
3. WRL
– active Low, Write to Low-byte.
This pin is connected to the PLDs. Therefore, these signals can be used in decode and
other logic equations.
The following control signals can be connected to this pin, based on your MCU:
1. RD
– active Low, Read Strobe input.
2. E – E clock input.
– active Low, Data Strobe input.
3. DS
– active Low, Strobe for low data byte.
4. LDS
This pin is connected to the PLDs. Therefore, these signals can be used in decode and
other logic equations.
Read or other Control input pin, with multiple configurations. Depending on the MCU
interface selected, this pin can be:
1. PSEN
mode).
2. BHE – High-byte enable, 16-bit data bus.
3. UDS
4. SIZ0 – Byte enable input.
5. LSTRB – Low Strobe input.
This pin is also connected to the PLDs.
Active Low input. Resets I/O Ports, PLD Macrocells and some of the Configuration
Registers and JTAG registers. Must be Low at Power-up. Reset also aborts any Flash
memory Program or Erase cycle that is currently in progress.
– Program Select Enable, active Low in code fetch bus cycle (80C51XA
– active Low, Strobe for high data byte, 16-bit data bus mode.
PSD4235G2V
11/89
PSD4235G2V
Pin NamePinTypeDescription
These pins make up Port A. These port pins are configurable and can have the
following functions:
1. MCU I/O – standard output or input port.
2. CPLD Macrocell (McellA0-McellA7) outputs.
3. Latched, transparent or registered PLD inputs (can also be PLD input for address
A16 and above).
These pins make up Port B. These port pins are configurable and can have the
following functions:
1. MCU I/O – standard output or input port.
2. CPLD Macrocell (McellB0-McellB7) outputs.
3. Latched, transparent or registered PLD inputs (can also be PLD input for address
A16 and above).
PA0-PA751-58
PB0-PB761-68
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
PC0-PC741-48
PD079
PD180
PD21
PD32
PE071
PE172
PE273
I/O
CMOS
or
Slew
Rate
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
These pins make up Port C. These port pins are configurable and can have the
following functions:
1. MCU I/O – standard output or input port.
2. External Chip Select (ECS0-ECS7) outputs.
3. Latched, transparent or registered PLD inputs (can also be PLD input for address
A16 and above).
PD0 pin of Port D. This port pin can be configured to have the following functions:
1. ALE/AS input – latches address on ADIO0-ADIO15.
input – latches address on ADIO0-ADIO15 on the rising edge.
2. AS
3. MCU I/O – standard output or input port.
4. Transparent PLD input (can also be PLD input for address A16 and above).
PD1 pin of Port D. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Transparent PLD input (can also be PLD input for address A16 and above).
3. CLKIN – clock input to the CPLD Macrocells, the APD Unit’s Power-down counter,
and the CPLD AND Array.
PD2 pin of Port D. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Transparent PLD input (can also be PLD input for address A16 and above).
3. PSD Chip Select Input (CSI
I/O. When High, the PSD memory blocks are disabled to conserve power. The falling
edge of this signal can be used to get the device out of Power-down mode.
PD3 pin of Port D. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Transparent PLD input (can also be PLD input for address A16 and above).
3. WRH
PE0 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. TMS Input for the JTAG Serial Interface.
PE1 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. TCK Input for the JTAG Serial Interface.
PE2 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. TDI input for the JTAG Serial Interface.
– for 16-bit data bus, write to high byte, active low.
). When Low, the MCU can access the PSD memory and
12/89
Pin NamePinTypeDescription
PE374
PE475
PE576
PE677
PE778
PF0-PF731-38
PG0-PG721-28
V
CC
9, 29,
69
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
I/O
CMOS
or
Open
Drain
PE3 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. TDO output for the JTAG Serial Interface.
PE4 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. TSTAT output for the JTAG Serial Interface.
4. Ready/Busy
PE5 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. TERR
PE6 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. VSTBY – SRAM stand-by voltage input for SRAM battery backup.
PE7 pin of Port E. This port pin can be configured to have the following functions:
1. MCU I/O – standard output or input port.
2. Latched address output.
3. Battery-on Indicator (VBATON). Goes High when power is being drawn from the
external battery.
These pins make up Port F. These port pins are configurable and can have the following
functions:
1. MCU I/O – standard output or input port.
2. External Chip Select (ECS0-ECS7) outputs, or inputs to CPLD.
3. Latched address outputs.
4. Address A1-A3 inputs in 80C51XA mode (PF0 is grounded)
5. Data bus port (D0-D7) in a non-multiplexed bus configuration.
6. Peripheral I/O mode.
7. MCU reset mode.
These pins make up Port G. These port pins are configurable and can have the
following functions:
1. MCU I/O – standard output or input port.
2. Latched address outputs.
3. Data bus port (D8-D15) in a non-multiplexed bus configuration.
4. MCU reset mode.
Supply Voltage
output for parallel In-System Programming (ISP).
active Low output for the JTAG Serial Interface.
PSD4235G2V
GND
8, 30,
49,
50, 70
Ground pins
13/89
PSD4235G2V
PSD REGISTER DESCRIPTION AND ADDRESS OFFSETS
Table 6 shows the offset addresses to the PSD
registers relative to the CSIOP base address. The
CSIOP space is the 256 bytes of address that is allocated by the user to the internal PS D registers.
Table 6. Register Address Offset
Register Name
Data In00 01 10 11 30 4041Reads Port pin as input, MCU I/O input mode
Control32 4243
Data Out04 05 1415344445
Direction06 07 1617364647Configures Port pin as input or output
Drive Select08 09 1819384849
Input Macrocell0A 0B 1AReads Input Macrocells
Enable Out0C 0D 1C4C
Output
Macrocells A
Output
Macrocells B
Mask
Macrocells A
Mask
Macrocells B
Flash Memory
Protection
Flash Boot
Protection
JTAG Enable C7 Enables JTAG Port
PMMR0 B0 Power Management Register 0
P ort A Port B Port C P ort D Port E Port F Port
20
21
22 Blocks writing to the Output Macrocells A
23 Blocks writing to the Output Macrocells B
Table 6 provides brief descriptions of the registers
in CSIOP space. The following sections give a
more detailed description.
1
Other
G
Selects mode between MCU I/O or Address
Out
Stores data for output to Port pins, MCU I/O
output mode
Configures Port pins as either CMOS or
Open Drain on some pins, while selecting
high slew rate on other pins.
Reads the status of the output enable to the
I/O Port driver
Read – reads output of Macrocells A
Write – loads Macrocell Flip-flops
Read – reads output of Macrocells B
Write – loads Macrocell Flip-flops
C0 Read only – Primary Flash Sector Protection
Read only – PSD Security and Secondary
C2
Flash memory Sector Protection
Description
PMMR2 B4 Power Management Register 2
Page E0 Page Register
VM E2
Memory_ID0F0
Memory_ID1F1
Note: 1. Other registers that are not part of the I/O ports.
14/89
Places PSD memory areas in Program and/
or Data space on an individual basis.
Read only – SRAM and Primary memory
size
Read only – Secondary memory type and
size
PSD4235G2V
REGISTER BIT DEFINITION
All the registers of the PSD are included here, for
reference. Detailed descriptions of these registers
can be found in the following sections.
Table 7. Data-In Registers – Ports A, B, C, D, E, F, G
Port pin <i> 0 = Port pin <i> is configured for CMOS Output driver (default).
Port pin <i> 1 = Port pin <i > i s configured for Open Drai n output driver.
McellA<i>_P rot 0 = Allow MCellA<i> flip-flop to be loaded by MCU (default).
McellA<i>_Prot 1 = Prevent MCellA <i > f l i p-flop from being loaded by M CU.
Sec<i>_Prot 1 = Secondary Flash memory Se ct or <i> is write protected.
Sec<i>_Prot 0 = Secondary Flash memory Sector <i> is not wri te protected.
Security_Bit 0 = Security Bit in device has not been set.
Security_Bit 1 = Security Bit in device has been set.
Table 21. JTAG Enable Register
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
not usednot usednot usednot usednot usednot usednot usedJTAGEnable
Note: Bit Definitions :
JTAGEnable 1 = JTAG Port is enabled.
JTAGEnable 0 = JTAG Port is disabled.
Configure Page input to PLD. Default is PGR7-PGR0=0.
17/89
PSD4235G2V
Table 23. PMMR0 Register
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
not used
(set to 0)
Note: The bits of this register are cleared to zero f ol l owing Power-up. Sub sequent Reset (Reset) pulses do not cl ear the registers.
Note: Bit Definitions :
APD Enable0 = A utomatic Po wer-down (A PD) is disabled.
PLD Turbo0 = PLD Turbo is on.
PLD Array CLK 0 = CLKIN to the PLD AND array is conne cted. Every CLKIN change powers up the PLD wh en T urbo bit is off .
PLD MCells CLK 0 = CLKIN to the PLD Macro cells is conn ected.
Table 24. PMMR2 Register
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
not used
(set to 0)
1 = Automatic Power-d own (APD) is enabled.
1 = PLD Turb o i s of f , s aving powe r.
1 = CLKIN to the PLD AND arr ay is disconnected, sav i ng power.
1 = CLKIN to the PLD Macrocells is disconnected, saving power.
PLD
MCells CLK
PLD
Array CLK
PLD
Turbo
not used
(set to 0)
APD
Enable
not used
(set to 0)
not used
(set to 0)
Note: For Bit 4, Bit 3, Bit 2: See Table 34 f or the signal s t hat are blocked on pins CNTL0-CNTL2 .
Note: Bit Definitions :
PLD Array Addr 0 = Address A7-A0 are connected to the P LD array.
PLD Array CNTL20 = CNTL2 input to th e P LD AND array i s connected.
PLD Array CNTL10 = CNTL1 input to th e P LD AND array i s connected.
PLD Array CNTL00 = CNTL0 input to th e P LD AND array i s connected.
PLD Array ALE 0 = ALE input to th e PLD AND array is connec ted.
PLD Array WRH 0 = WRH/DBE input to the PLD AND array is connected.
PLD
Array WRH
1 = Address A7-A0 are bloc ked from the PLD array, sav i ng power.
(Note: in XA mode, A3-A0 come from PF3-PF0, and A7-A4 come from ADIO7-AD IO4)
1 = CNTL2 input to the PLD AN D array is disconnected, saving pow er.
1 = CNTL1 input to the PLD AN D array is disconnected, saving pow er.
1 = CNTL0 input to the PLD AN D array is disconnected, saving pow er.
1 = ALE input t o th e PLD AND array is disconnected, sav i ng power.
1 = WRH/DB E input to the PL D A ND array is disc onnected, saving power.
PLD
Array ALE
PLD Array
CNTL2
PLD Array
CNTL1
PLD Array
CNTL0
not used
(set to 0)
PLD
Array Addr
Table 25. VM Register
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
Peripheral
mode
Note: On reset, Bit1-Bit4 are loaded to configurations that are selected by the user in PSDsoft Express. Bit0 and Bit7 are always cleared on
reset. Bit0-Bit4 are active only when the device is configured in Philips 80C51XA mode.
Note: Bit Definitions :
SR_code0 = PSEN
Boot_code0 = PSEN
FL_code0 = PSEN
Boot_data0 = RD
FL_data0 = RD
Peripheral mode 0 = Periphe ral m ode of Port F is di sabled.
not used
(set to 0)
1 = PSEN
1 = PSEN
1 = PSEN
1 = RD
1 = RD
1 = Peripheral mode of Port F is enabled.
not used
(set to 0)
cannot access SRAM in 80C51XA modes.
can access SR A M in 80C51XA modes.
cannot access Secondary NVM in 80C51XA modes.
can access Secondary NVM in 80C51 XA modes.
cannot access Primary Flash memory in 80C51XA modes.
can access Pr i m ary Flash memory in 80C51XA modes.
cannot access Secondary NVM in 80C51XA modes.
can access Secondary NVM in 80C51 XA modes.
cannot access Primary Flash me mory in 80C51XA modes .
can access P ri m ary Flash memory in 80C51XA modes .
1h = Primary Flash memory size is 256 Kbit
2h = Primary Flash memory size is 512 Kbit
3h = Primary Flash memory size is 1 Mbi t
4h = Primary Flash memory size is 2 Mbi t
5h = Primary Flash memory size is 4 Mbi t
6h = Primary Flash memory si ze is 8 Mbit
1h = SRAM size is 16 Kbit
2h = SRAM size is 32 Kbit
3h = SRAM size is 64 Kbit
4h = SRAM size is 128 Kbit
5h = SRAM size is 256 Kbit
not used
(set to 0)
Note: Bit Definitions :
B_siz e[3:0]0h = There is no Secondary NVM
B_type [1:0]0h = Secondary NVM is Flash memory
not used
(set to 0)
1h = Secondary NV M size is 128 Kbi t
2h = Secondary NVM size is 256 Kbit
3h = Secondary NV M size is 512 Kbi t
1h = Secondary NVM is EEPROM
B_type 1B_type 0B_size 3B_size 2B_size 1B_size 0
19/89
PSD4235G2V
DETAILED OPERATION
As shown in Figure 4, the PSD consists of six major types of functional blocks:
■ Memory Blo c k s
■ PLD Bl o c ks
■ MCU Bus Interface
■ I/O Por ts
■ Power Management Unit (PMU)
■ JTAG-ISP Interface
The functions of ea ch block are described i n the
following sections. Many of the blocks perform
multiple functions, and are user configurable.
– Primary Flash memory
– Secondary Flash memory
–SRAM
The Memory Select signals for these blocks origi-
nate from the Decode PLD (DPLD) an d are userdefined in PSDsoft Express.
Table 28 sumamarizes the sizes and organisations of the memory blocks.
(x16)
Sector Select
Signal
SRAM Size
(x16)
SRAM Select
Signal
432KFS4
532KFS5
632KFS6
732KFS7
Totals512KByte8 Sectors32KByte4 Sectors8KByte
20/89
PSD4235G2V
Primary Flash Memory and Secondary Flash
memory Description. The pri mary Flash memo-
ry is divided even ly into 8 sec tors. The secondary
Flash memory is divided evenly into 4 sectors.
Each sector of either memory block can be s eparately protected from Program and Erase cycles.
Flash memory may be erased on a sector-by-sector basis, and programmed word-by-word. Flash
sector erasure may be suspended while data is
read from other sectors o f the block and th en resumed after reading.
During a Program or Erase cycle in Flash memory,
the status can be output on the Ready/Busy
pin
(PE 4). This pi n is se t up us i ng PSDsoft Expres s.
Memory Block Select Signals. The DPLD gen-
erates the Select signals for all the internal memo-
ry blocks (see the section entitled “PLDs”, on page
31). Each of the sectors of the primary Flash memory has a Select signal (FS0-FS7) which can contain up to three product terms. Each of the sectors
of the secondary Fl ash memo ry has a Select signal (CSBOOT0-CSB OOT3) which c an contain up
to three product terms. Having three product terms
for each Select signal allows a giv en sector to be
mapped in different areas of system memory.
When using a M CU with separate Program and
Data space (80C51XA), these flexible Select signals allow dynamic re-mapping of sectors from
one memory space to the other bef ore and after
IAP. The SRAM block has a single Select signal
(RS0).
Ready/Busy
output the Ready/Busy
(PE4). This signal can be used to
status of the PSD. The out-
put is a 0 (Busy) when a Flash memory block is be-
or
ing written to,
when a Flash memory block is
being erased. The output is a 1 (Read y) when no
Write or Erase cycle is in progress.
Memory Operation. The primary Flash memory
and secondary Flash memory are addressed
through the MCU Bus Interface. The MCU can access these memories in one of two ways:
■ The MCU can execute a typical bus Write or
Read
operation
just as it would if accessing a
RAM or ROM device using standard bus cycles.
■ The MCU can execute a specific instruction that
consists of several Write and Read operations.
This invo lv es writ in g specific da ta pat t er ns to
special addresses within the Flash memory to
invoke an embedded algorithm. These
instructions are summarized in Table 29.
Typically, the MCU can read Flash memory using
Read operations, just as it would read a ROM device. However, Flash memory can only b e erased
and programmed u sing specific instructions. For
example, the MCU cannot write a single byte directly to Flash memory as one would write a byte
to RAM. To program a word int o Flash memory,
the MCU must execute a Program instruction, then
test the status of the Programming event. This status test is achieved by a Read operation or polling
Ready/Busy
(PE4).
Flash memory can also be read by using special
instructions to retrieve particular F lash device information (sector protect status and ID).
21/89
PSD4235G2V
Table 29. Instructions
6
7,13
FS0-FS7 or
CSBOOT0-
CSBOOT3
1
1
1
1
1
1
1
1
1
1
1
Cycle 1Cycle 2Cycle 3Cycle 4Cycle 5Cycle 6Cycle 7
“Read”
RD @ RA
AAh@
XAAAh
AAh@
XAAAh
AAh@
XAAAh
AAh@
XAAAh
AAh@
XAAAh
55h@
X554h
55h@
X554h
55h@
X554h
55h@
X554h
55h@
X554h
90h@
XAAAh
90h@
XAAAh
A0h@
XAAAh
80h@
XAAAh
80h@
XAAAh
Read ID
@ XX02h
Read 00h
or 01h @
XX04h
PD@ PA
AAh@
XAAAh
AAh@
XAAAh
55h@
X554h
55h@
X554h
30h@
SA
10h@
XAAAh
B0h@
XXXXh
30h@
XXXXh
F0h@
XXXXh
AAh@
XAAAh
A0h@
XXXXh
90h@
XXXXh
55h@
X554h
PD@ PA
00h@
XXXXh
20h@
XAAAh
, CNTL0)
Instruction
Read
5
14
Read Main Flash ID
Read Sector
Protection
6,8,13
Program a Flash
13
Word
Flash Sector Erase
Flash Bulk Erase
13
Suspend Sector
11
Erase
Resume Sector
12
Erase
6
Reset
Unlock Bypass1
Unlock Bypass
Program
9
Unlock Bypass
10
Reset
Note: 1. All bus cycles are write bus cycles, except the ones with the “Read” label
2. All values are in hexadecim al :
X = Don’t Care. Addresses of the form XXXXh, in thi s t able, must be even addres ses
RA = Address of the memory l ocation to be read
RD = Data read from loca ti on RA during t he Read cycle
PA = Address of the memory location to be programmed. Addresses are latched on the falling edge of Write Strobe (WR
PA is an even address for PSD in word programming mode.
PD = Data w ord to be programm ed at location PA. Data is la tc hed on the risi ng edge of Writ e Strobe (W R
SA = Addr ess of t he sect or to be erased or ve rified. Th e Sect or Sel ect (FS0- FS 7 or CSBOOT 0-C SBOOT3) of the se ctor t o be
erased, or verified, must be Active (High).
3. Sector Se l ect (FS0 to FS7 or CSBOOT0 to C SBOOT3) signals are active Hi gh, and are defi ned in PSDsoft Express .
4. Only ad dress bi ts A11-A0 are used in ins t ru c tion decoding .
5. No Unlock or instruction cycles are required when the devic e i s in the Read mode
6. The Reset instruction is required to return to the Read mode after reading the Flash ID, or after reading the Sector Protection Status ,
or if the Error Flag (DQ5/DQ13) bit goes High.
7. Additional sec tors to be erased must be wr i tt en at the end of the Sector Erase instru ct i on within 80 µs.
8. T he data is 00h f or an unprote cted sector, and 01h for a pr otected sec tor. In the fo urth cycle, th e Sector Sel ect is active, and
(A1,A0)= (1,0)
9. The Unlock Bypass instruction is required prior to the Unlock Bypass Program instruction.
10. T he Unlock B ypass Reset F l ash instru ct i on is requ i red to return to reading memory data whe n t he device i s in the Unlock Bypass
mode.
11. T he sy stem may perform Read and Program cycles in non-eras i ng sectors, rea d the Flash ID or read t he S ector Protec tion Status
when in t he S uspend Sec to r Erase mode. T he S uspend Sec t or Erase inst ruction is va lid only duri ng a Sector Era se cycle.
12. The Resume Sector Erase instruction is valid only during the Suspend Sector Erase mode.
13. T he MCU cannot inv oke the se in stru ction s wh ile exe cuti ng cod e from the sa me Fla sh me mory as that fo r whic h the ins truc tio n is
intended. The MCU must fetch, for example, the code from the secondary Flash memory when reading the Sector Protection Status
of th e pr i m ary Flash memory.
14. All write bus cycles in an instruction are byte write to an even address (XA4Ah or X554h). A Flash memory Program bus cycle writes
a word to an even address.
7
@
30h
next SA
, CNTL0).
22/89
PSD4235G2V
Instructions
An instruction consists of a sequence of specific
operations. Each received byte is sequentially decoded by the PSD and not executed as a standard
Write operation. The instruction is e xecuted when
the correct number of bytes are properly received
and the time between two consecutive bytes is
shorter than the time-out period. Some instructions are structured to include Read operations after the initial Write operations.
The instruction must be followe d exactly. Any invalid combination of instruction bytes or time-out
between two consecutive byte s while addressing
Flash memory resets the device logic into Read
mode (Flash memory is read like a ROM device).
The PSD supports the instructions sum ma riz ed in
Table 29:
■ Erase memory by chip or sector
■ Suspend or resume sector erase
■ Program a Word
■ Reset to Read mode
■ Read primary Flash Identifier value
■ Read Sector Protection Status
■ Bypass
These instructions are detailed in Table 29. For efficient decoding of the instructions, the first two
bytes of an instruction are the c oded cycles and
are followed by an instruction byte or confirmation
byte. The coded cycles consist of writing the data
AAh to address XAAAh during the first cycle and
data 55h to address X554h during the second cycle (unless the Bypass instruction feature is used,
as described later). Address signals A15-A12 are
Don’t Care during the instruction Write cycles.
However, the appropriate Sector Select signal
(FS0-FS7, or CSBOOT0-CSBOOT3) must be selected.
The primary and secondary Flash memories have
the same instruction set (except for Read Primary
Flash Identifier). The Sector Select signals determine which Flash memory is to receive and execute the instruction. The primary Flash memory is
selected if any one of its Sector Select signals
(FS0-FS7) is High, and the secondary Flash memory is selected if any one of its Sector Select signals (CSBOOT0-CSBOOT3) is High .
Power-up Condition. The PSD internal logic is
reset upon Power-up to the Read mode. Sector
Select (FS0-FS7 and CSBOOT0-CSBOOT3)
must be held Low, and Write Strobe (WR
/WRL,
CNTL0) High, during Power-up for maximum security of the data contents and to remove the possibility of data being written on the first edge of
Write Strobe (WR
initiation is locked when V
/WRL, CNTL0). Any Write cycle
is below V
CC
LKO
.
Reading Flash Memory
Under typical conditions, the MCU may read t he
primary Flash memory, or secondary Flash memory, using Read operations just as it would a ROM
or RAM device. Alternately, the MCU may use
Read operations to obtain status information
about a Program or Erase cycle that is currently in
progress. Lastly, the MCU may use instructions to
read special data from these memory blocks. The
following sections describe these Read functions.
Read Memory Contents. Prima ry Flash memo ry
and secondary Flash memory are placed in the
Read mode after Power-up, chip reset, or a Reset
Flash instruction (see Table 29). The MCU can
read the memory contents of the primary Flash
memory, or thesecondary Flash memory by using
Read operations any time the Read operation is
not part of an instruction.
Read Primary Flash Identifier. The primary
Flash memory identifier is read with an instruction
composed of 4 operations: 3 specific Write operations and a Read operation (see Table 29). The
identifier for the primary Flash memory is E8h. The
secondary Flash memory does not support this instruction.
Read Memory Sector Protection Status. The
Flash memory Sector Protection Status is read
with an instruction composed of four operations:
three specific Write operations and a Read operation (see Table 29). The Read operation produces
01h if the Flash memory sector is protected, or 00h
if the sector is not protected.
The sector protection status for all NVM blocks
(primary Flash memory, or secondary Flash memory) can be read by the MCU accessing the Flash
Protection and F lash Boot Protection registers in
PSD I/O space. See the section entitled “Flash
Memory Sector Protect”, on page 27, for register
definitions.
Reading the Erase/Program Status Bits. The
PSD provides several status bits to be used by the
MCU to confirm the completion of an Erase or Program cycle of Flash memory. These status bits
minimize the time that the MCU spends performing these tasks and are defined in Table 30. The
status byte resides in an even location, and can be
read as many times as needed. Also note that
DQ15-DQ8 is an even byte for Motorola MCUs
with a 16-bit data bus.
For Flash memory, the MCU can perform a Read
operation to obtain these status bits while an
Erase or Program instruction is being executed by
the embedded algorithm. See the section entit led
“Programming Flash Memory”, on page 25, for details.
23/89
PSD4235G2V
Table 30. Status Bits
DQ7DQ6DQ5DQ4DQ3DQ2DQ1DQ0
Data PollingToggle FlagError FlagX
Table 31. Status Bits for Motorola
DQ15DQ14DQ13DQ12DQ11DQ10DQ9DQ8
Erase Time-
out
XXX
Data PollingToggle FlagError FlagX
Note: 1. X = Not guaranteed value, can be rea d ei t her 1 or 0.
2. DQ15-DQ0 represent the Data Bus bi ts, D15-D0.
3. FS0-FS7/CSBOOT0-CSBOOT3 are active High.
Data Polling (DQ7) – DQ15 for Motorola.
When erasing or programm ing in Flash memory,
the Data Polling (DQ7/DQ15) bit outputs the complement of the bit being entered for programming/
writing on the DQ7/DQ15 bi t. Once the Program
instruction or the Write operation is completed, the
true logic value is read on the Dat a Polling (DQ7/
DQ15) bit (in a Read operation).
■ Data Polling is effective after the fourth Write
pulse (for a Program instruction) or after the
sixth Write pulse (for an Erase instruction). It
must be performed at the address being
programmed or at an address within the Flash
memory sector being erased.
■ During an Erase cycle, the Data Polling (DQ7/
DQ15) bit outputs a 0. After completion of the
cycle, the Data Polling (DQ7/DQ15) bit outputs
the last bit programmed (it is a 1 after erasing).
■ If the location to be programmed is in a
protected Flash memory sector, the instruction
is ignored.
■ If all the Flash memory sectors to be erased are
protected, the Data Polling (DQ 7/D Q15) bit is
reset to 0 for about 100 µs, and then returns to
the value from the previously addressed
location. No erasure is performed.
Toggle Flag ( DQ6 ) – DQ14 for Motorola. The
PSD offers an other way for determining when the
Flash memory Program cycle is completed. During
the internal Write operation a nd wh en ei the r F S 0FS7 or CSBOOT0-CSBOO T3 is true, the Toggle
Flag (DQ6/DQ14) bit toggles fro m 0 to 1 and 1 t o
0 on subsequent attempts to read any word of the
memory.
When the internal cycle is complete, the toggling
stops and the data read on the Data Bus D0-D7 is
the value from the addressed memory location.
The device is now accessibl e for a new Read or
Erase Time-
out
XXX
Write operation. The cycle is finished when two
successive Reads yield the same output data.
■ The Toggle Flag (DQ6/DQ14) bit is effective
after the fourth Write pulse (for a Program
instruction) or after the sixth Write pulse (for an
Erase instruction).
■ If the location to be programmed belongs to a
protected Flash memory sector, the instruction
is ignored.
■ If all the Flash memory sectors selected for
erasure are protected, the Toggle Flag (DQ6/
DQ14) bit toggles to 0 for about 100 µs and then
returns to the value from the previously
addressed location.
Error Flag (DQ5) – DQ13 for Motorola. During
a normal Program or Erase cycle, the Error Flag
(DQ5/DQ13) bit is reset to 0. This bit is set to 1
when there is a failure during a Flash memory Program, Sector Erase, or Bulk Erase cycle.
In the case of Flash memory programming, the Error Flag (DQ5/DQ13) bit indicates the attempt to
program a Flash memory bit, or bits, from the programmed state, 0, to the erased s tate , 1, wh ich is
not a valid operation. The Error Flag (DQ 5/DQ13)
bit may also indicate a Time-out condition while attempting to program a word.
In case of an error in a Flash memory Sector Erase
or Word Program cycle, the Flash memory sector
in which the error occurred or to which the programmed location belongs must no longer be
used. Other Flash memory sectors may still be
used. The Error Flag (DQ5/DQ13) bit is reset after
a Reset instruction. A Reset instruction is required
after detecting an error on the Error Flag (DQ5/
DQ13) bit.
Erase Time-out Flag (DQ3 ) – DQ11 for Motorola. The Erase Time-out Flag (DQ3/DQ11 ) bit re-
flects the time-out period allowed between two
consecutive Sector E rase instructions. The E ras e
Time-out Flag (DQ3/DQ11) bit is reset to 0 after a
24/89
PSD4235G2V
Sector Erase cycle for a period of 100 µs + 20%
unless an additional Sector Erase instruction is decoded. After this period, or when the additional
Sector Erase instruction is decoded, the Erase
Time-out Flag (DQ3/DQ11) bit is set to 1.
Programming Flash Memory
Flash memory mus t be erased prior to being programmed. The MCU may eras e Flas h m emory a ll
at once or by-sector. Although erasing Flash memory occurs on a sector or device basis, programming Flash memory occurs on a word basis.
The primary and secondary Flash memories require the MCU to send an instruction to program a
word or to eras e sectors (s ee Table 2 9).
Once the MCU issues a Flash memory Program or
Erase instruction, it must check the status bits for
completion. The embedded algorithms that are invoked inside the PSD s upport several means to
provide status to the MCU. Status may be checked
using any of three methods: Data Polling, Data
Toggle, or Ready/Busy
(PE4) signal.
Data Polling. Polling on the Data Polling (DQ7/
DQ15) bit is a method of check ing whe ther a Program or Erase cycle is in progress or has completed. Figure 6 shows the Data Polling algorithm.
When the MCU issue s a Program ins truction, the
embedded algorithm within the PSD begins. The
MCU then reads the location of the word to be programmed in Flash memory to check the status.
The Data Polling (DQ7/DQ15) bit becomes the
complement of the corresponding bit of the original
data word to be programmed. The MCU continues
to poll this location, comparing data a nd monitoring the Error Flag (DQ5/DQ13) bit. When the Data
Polling (DQ7 /DQ15) bit matches the c orresponding bit of the original data, and the Error Flag
(DQ5/DQ13) bit remains 0, the embedded algorithm is complete. If the Error Flag (DQ5/DQ13) bit
is 1, the MCU should test the Dat a Polling (DQ7/
DQ15) bit again since the Data Polling (DQ7/
DQ15) bit may have changed simultaneous ly with
the Error Flag (DQ5/DQ13) bit (see Figure 6).
The Error Flag (DQ5/DQ13) bit is set if either an internal time-out occurred while the embedded algorithm attempted to program the location or if the
MCU attempted to program a 1 to a bit that was not
erased (not erased is logic 0).
It is suggested (as with all Flash memories) to read
the location again after the embedded programming algorithm has completed, to compare the
word that was written to the Flash memory with the
word that was intended to be written.
When using the Data Polling method during an
Erase cycle, Figure 6 still applies. However, the
Data Polling (DQ7/DQ1 5) bit is 0 until the E rase
cycle is complete. A 1 on the Error Flag (DQ5/
DQ13) bit indicates a time-out condition on the
Erase cycle, a 0 indicates no error. The M CU can
read any even location within the sector being
erased to get the Data Polling (DQ7/DQ15) bit and
the Error Flag (DQ5/DQ13) bit.
PSDsoft Express generates ANSI C code functions that implement these Data Polling algorithms.
Figure 6. Dat a Po ll i ng F lo wc h a rt
START
READ DQ5 and DQ7
(DQ13 and DQ15)
at Valid Even Address
DQ7
No
(DQ15)
=
Data7
(Data15)
DQ5
(DQ13)
= 1
READ DQ7
(DQ15)
DQ7
(DQ15)
=
Data7
(Data15)
Program
or Erase
Cycle failed
Issue RESET
instruction
Yes
No
Yes
Yes
No
Program
or Erase
Cycle is
complete
AI04920
Data Toggle. Checking the Toggle Flag (DQ6/
DQ14) bit is another method of determining whether a Program or Erase cycle is in progress or has
completed. Figure 7 shows t he Data Toggle algorithm.
When the MCU issue s a Program ins truction, the
embedded algorithm within the PSD begins. The
MCU then reads the location to be programmed in
Flash memory to check the status. The Toggle
Flag (DQ6/DQ14 ) bit toggles ea ch time the MCU
25/89
PSD4235G2V
reads this location until the embedded algorithm is
complete. The MCU continues to read this location, checking the Toggle Flag (DQ6/DQ14) bit
and monitoring the Error Flag (DQ5/DQ13) bit.
When the Toggle Flag (DQ6 /DQ1 4) bit stops toggling (two consecutive reads yield the same v alue), and the Error Flag (DQ5/DQ13) bit remains 0,
the embedded a lgorithm is complete. If the Error
Flag (DQ5/DQ13) bit is 1, the MCU should test the
Toggle Flag (DQ6/DQ14) bit again, since the Toggle Flag (DQ6/DQ14) bit may have changed simultaneously with the Error Flag (DQ5/DQ13) bit (see
Figure 7).
Figure 7. Dat a Toggle Flow cha rt
START
READ DQ5 and DQ6
(DQ13 and DQ14)
at Valid Even Address
No
DQ6
(DQ14)
=
Toggle
DQ5
(DQ13)
= 1
READ DQ6
(DQ14)
DQ6
(DQ14)
=
Toggle
Program
or Erase
Cycle failed
Issue RESET
instruction
No
Yes
Yes
No
Yes
Program
or Erase
Cycle is
complete
AI04921
The Error Flag (DQ5/DQ13) bit is set if either an internal time-out occurred while the embedded algorithm attempted to program, or if the MCU
attempted to program a 1 to a bit that was not
erased (not erased is logic 0).
It is suggested (as with all Flash memories) to read
the location again after the embedded programming algorithm has completed, to compare the
word that was written to Flash memory with the
word that was intended to be written.
When using the Data Toggle method after an
Erase cycle, Figure 7 still applies. the Toggle Flag
(DQ6/DQ14) bit toggles until the Erase cycle is
complete. A 1 on the Error Flag (DQ5/DQ13) bit indicates a time-out condition on the Erase cycle, a
0 indicates no error. The MCU can read any even
location within the sector bei ng erased to get t he
Toggle Flag (DQ6/DQ14) bit and the Error Flag
(DQ5/DQ13) bit.
PSDsoft Express generates ANSI C code functions which implement these Data T oggling algorithms.
Unlock Bypass. The Unlock Bypass instruction
allows the system t o program words to the Flash
memories faster than using the standard Program
instruction. The Unloc k Bypass mode is ent ered
by first initiati ng two Unlo ck cycles. T his is fol lowed
by a third Write cycle cont aining the Unlock Bypass command, 20 h (as shown in T able 29). The
Flash memory then enters the Unlock Bypass
mode.
A two-cycle Unlock Bypass Program instruction is
all that is required to program i n this mode. The
first cycle in this instruction contains the Unlock
Bypass Program command , A0h. The second cycle contains the program address and data. A dditional data is programmed in the same manner.
This mode dispense with the initial two Unlock cycles required in the s tandard P rogram instruction,
resulting in faster total programming time.
During the unlock bypass mode, only the Unlock
Bypass Program and Unlock Bypass Reset instructions are valid.
To exit th e Un l o ck Bypass mode, the system must
issue the two-cycle Unlock Bypass Reset instruction. The first cycle must contain the data 90h; the
second cycle the data 00h. A ddresses are Don’t
Care for both cycles. The Flash memory then returns to Read mode.
tion uses six Write operat ion s followed by a Read
operation of the status register, as described in
Table 29. If any byte of t he Bulk Erase instruction
is wrong, the Bulk Erase instruction aborts and the
device is reset to the Read Memory mode.
During a Bulk Erase, the memory status may be
checked by reading the Error Flag (DQ5/DQ13)
bit, the Toggle Flag (DQ6/DQ14) bit, and the Data
Polling ( DQ 7/DQ15 ) b it, as de tailed in the sect ion
26/89
PSD4235G2V
entitled “Programming Flash Memory”, on page
25. The Error Flag (DQ5 /DQ13) bit returns a 1 if
there has been an Erase Failure (maximum number of Erase cycles have been exec ut ed ) .
It is not necessary to program the memory with
00h because the PSD automatically does this before erasing to 0FFh.
During execution of the Bulk Erase instruction, the
Flash memory does not accept any instructions.
Flash Sector Erase. The Sector Erase instruction uses six Write operations, as described in Table 29. Additional Flash Sector Erase confirm
commands and Flash m emory sector addresses
can be written subsequently to erase ot her Flash
memory sectors in parallel, wi thout further coded
cycles, if the additional commands are transmitted
in a shorter time than the time-out period of about
100 µs. The input of a new Sector Erase command
restarts the time-out period.
The status of the internal timer can be monitored
through the level of the Erase Time-out Flag (DQ3/
DQ11) bit. If the Erase Time-out Flag (DQ3/DQ11)
bit is 0, the Sector Erase instruc tion has be en received and the time-out p eriod is counting. If the
Erase Time-out Flag (DQ3/DQ11) bit is 1, the
time-out period has expired and the PSD is busy
erasing the Flash memory secto r(s). Before and
during Erase time-out, any i nstruction other than
Suspend Sector Erase and Resume Sector Erase,
abort the cycle that is currently in progress, and reset the device to Read mode. It is not necessary to
program the Flash memory sector with 00h as the
PSD does this automatically before erasing.
During a Sector Erase, the memory status may be
checked by reading the Error Flag (DQ5/DQ13)
bit, the Toggle Flag (DQ6/DQ14) bit, and the Data
Polling ( DQ 7/DQ 15) b it, as de tailed in the sec tion
entitled “Programming Flash Memory”, on page
25.
During execution of the Erase cycle, the Flash
memory accepts only Reset and Suspend Sector
Erase instructions. Erasure of one Flash memory
sector may be suspended, in order to read data
from another Flash memory sector, and t hen resumed .
Suspend Sector Erase. When a Sector Erase
cycle is in progress, the Suspend Sector Erase instruction can be used to suspend the cycle by writing 0B0h to any even address when an
appropriate Sector Select (FS0-FS7 or
CSBOOT0-CSBOOT3) is High. (See Table 29).
This allows reading of data from another Flash
memory sector after the Erase cycle has been
suspended. Suspend Sector Erase is accepted
only during the Flash Sector Erase instruction execution and defaults to Read mode. A Suspend
Sector Erase instruction executed during an Erase
time-out period, in addition to suspending the
Erase cycle, terminates the time out period.
The Toggle Flag (DQ6/DQ14) bit stops toggling
when the PSD internal logic is suspended. The
status of this bit must be m onit ored a t a n address
within the Flash memory sector being erased. The
Toggle Flag (DQ6/DQ14) bit stops toggling between 0.1 µs and 15 µs after the Suspen d Sector
Erase instruction has been executed. The PSD is
then automatically set to Read mode.
If an Suspend Sector Erase instruction was executed, the following rules apply:
– Attempting to read from a Flash memory se ctor
that was being erased outputs invalid data.
– Reading from a Flash memory sect or that was
not
being erased is valid.
– The Flash memory
only responds to Resume Sector Erase and Reset instructions (Read is an operation and is allowed).
– If a Reset instruction is received, data in the
Flash memory sector that was being erased is
invalid.
Resume Sector Erase. If a Suspend Sector
Erase instruction was previously executed, the
Erase cycle may be resumed with this instruction.
The Resume Sector Eras e instruction consists of
writing 030h to any even address while an appropriate Sector Select (FS0-FS7 or CSBOOT0CSBOOT3) is High. (See Table 29.)
Flash Memory Sector Protect
Each secto r o f Pri mary or Se co ndar y Flash memory can be separately p rotected against Program
and Erase cycles. Sector Protection provides additional data security be cause it disables all Program or Erase cycles. This mode can be activated
(or deactivated) through the JTAG-ISP Port or a
Device Programmer.
Sector protection can be selected for each sector
using the PSDsoft Express program. This automatically protects selected sectors when the device is programmed through the JTAG Port or a
Device Programmer. Flash memory sectors can
be unprotected to allow upda ting of t heir contents
using the JTAG Port or a Device Programmer. The
MCU can read (but cannot change) the sector protection bits.
Any attempt to program or erase a protected Flash
memory sector is ignored by the device. The Verify
operation results in a read of the protected data.
This allows a guarantee of the retention of the Protection status.
The sector protection status can be read by the
MCU through the Flash memory protection and
Secondary Flash memory prot ection registers (in
cannot
be programmed, and
27/89
Loading...
+ 62 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.