27/89
PSD4235G2
entitled “Programming Flash Memory”, on page
25. The Error Flag (DQ5/DQ13) bit returns a 1 if
there has been an Erase Failure (maximum num-
ber of Erase cycles have been executed).
It is not necessary to program the memory with
00h because the PSD automatically does this be-
fore erasing to 0FFh.
During execution of the Bulk Erase instruction, the
Flash memory does not accept any instructions.
Flash Sector Erase.
The Sector Erase instruc-
tion uses six Write operations, as described in Ta-
ble 29. Additional Flash Sector Erase confirm
commands and Flash memory sector addresses
can be written subsequently to erase other Flash
memory sectors in parallel, without 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 instruction has been re-
ceived and the time-out period 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 sector(s). Before and
during Erase time-out, any instruction other than
Suspend Sector Erase and Resume Sector Erase,
abort the cycle that is currently in progress, and re-
set 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 (DQ7/DQ15) bit, as detailed in the section
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 then re-
sumed.
Suspend Sector Erase.
When a Sector Erase
cycle is in progress, the Suspend Sector Erase in-
struction can be used to suspend the cycle by writ-
ing 0B0h to any even address when an
appropriate
Sector
Select
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 ex-
ecution and defaults to Read mode. A Suspend
Sector Erase instruction executed during an Erase
(FS0-FS7
or
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 monitored at an address
within the Flash memory sector being erased. The
Toggle Flag (DQ6/DQ14) bit stops toggling be-
tween 0.1 μs and 15 μs after the Suspend Sector
Erase instruction has been executed. The PSD is
then automatically set to Read mode.
If an Suspend Sector Erase instruction was exe-
cuted, the following rules apply:
– Attempting to read from a Flash memory sector
that was being erased outputs invalid data.
– Reading from a Flash memory sector that was
not
being erased is valid.
– The Flash memory
cannot
be programmed, and
only responds to Resume Sector Erase and Re-
set instructions (Read is an operation and is al-
lowed).
– 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 Erase instruction consists of
writing 030h to any even address while an appro-
priate Sector Select (FS0-FS7 or CSBOOT0-
CSBOOT3) is High. (See Table 29.)
Flash Memory Sector Protect
Each sector of Primary or Secondary Flash mem-
ory can be separately protected against Program
and Erase cycles. Sector Protection provides ad-
ditional data security because it disables all Pro-
gram 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 auto-
matically protects selected sectors when the de-
vice is programmed through the JTAG Port or a
Device Programmer. Flash memory sectors can
be unprotected to allow updating of their contents
using the JTAG Port or a Device Programmer. The
MCU can read (but cannot change) the sector pro-
tection 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 Pro-
tection status.
The sector protection status can be read by the
MCU through the Flash memory protection and
Secondary Flash memory protection registers (in