English
Language : 

Z8F1680SH020SG Datasheet, PDF (294/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
269
The Flash Sector Protect Register can be configured to prevent sectors from being pro-
grammed or erased. After a sector is protected, it cannot be unprotected by user code. The
Flash Sector Protect Register is cleared after reset and any previously written protection
values is lost. User code must write this register in their initialization routine if they want
to enable sector protection.
The Flash Sector Protect Register shares its Register File address with the Page Select
Register. The Flash Sector Protect Register is accessed by writing the Flash Control Regis-
ter with 5EH. After the Flash Sector Protect Register is selected, it can be accessed at the
Page Select Register address. When user code writes the Flash Sector Protect Register,
bits can only be set to 1. Thus, sectors can be protected, but not unprotected, via register
write operations. Writing a value other than 5EH to the Flash Control Register deselects
the Flash Sector Protect Register and reenables access to the Page Select Register. code:
1. Write 00H to the Flash Control Register to reset the Flash Controller.
2. Write 5EH to the Flash Control Register to select the Flash Sector Protect Register.
3. Read and/or write the Flash Sector Protect Register which is now at Register File
address FF9H.
4. Write 00H to the Flash Control Register to return the Flash Controller to its reset state.
The Sector Protect Register is initialized to 0 on Reset, putting each sector into an unpro-
tected state. When a bit in the Sector Protect Register is written to 1, the corresponding
sector can no longer be written or erased. After a bit of the Sector Protect Register has
been set, it can not be cleared except by a System Reset.
20.2.4. Byte Programming
Flash memory is enabled for byte programming on the active page after unlocking the
Flash Controller. Erase the address(es) to be programmed using either the Page Erase or
Mass Erase command prior to performing byte programming. An erased Flash byte
contains all 1s (FFH). The programming operation can only be used to change bits from 1
to 0. To change a Flash bit (or multiple bits) from 0 to 1 requires execution of either the
Page Erase or Mass Erase command.
Byte programming can be accomplished using the On-Chip Debugger’s Write Memory
command or eZ8 CPU execution of the LDC or LDCI instructions. For a description of the
LDC and LDCI instructions, refer to the eZ8 CPU Core User Manual (UM0128), available
for download at www.zilog.com. While the Flash Controller programs the contents of
Flash memory, the eZ8 CPU idles but the system clock and on-chip peripherals continue
to operate.
After a byte is written, the page remains unlocked, allowing for subsequent writes to other
bytes on the same page. To exit programming mode and lock Flash memory, write any
value to the Flash Control Register except the Mass Erase or Page Erase commands.
PS025015-1212
PRELIMINARY
Flash Memory