English
Language : 

Z8F0830HH020SG Datasheet, PDF (134/257 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore!® F0830 Series
Product Specification
116
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.
Observe the following procedure to setup the Flash Sector Protect Register from user
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 setting a bit in the Sector Protect Register,
the bit cannot be cleared by the user.
Byte Programming
Flash memory is enabled for byte programming after unlocking the Flash Controller and
successfully enabling either mass erase or page erase. When the Flash Controller is
unlocked and mass erase is successfully enabled, all of the program memory locations are
available for byte programming. In contrast, when the Flash Controller is unlocked and
page erase is successfully enabled, only the locations of the selected page are available for
byte programming. An erased Flash byte contains all 1’s (FFH). The programming opera-
tion 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 commands.
Byte programming can be accomplished using the On-Chip Debugger’s write memory
command or eZ8 CPU execution of the LDC or LDCI instructions. Refer to the eZ8 CPU
Core User Manual (UM0128), which is available for download on www.zilog.com, for the
description of the LDC and LDCI instructions. While the Flash Controller programs the
Flash memory, the eZ8 CPU idles, but the system clock and on-chip peripherals continue
to operate. To exit programming mode and lock the Flash, write any value to the Flash
Control Register, except the mass erase or page erase commands.
Caution: The byte at each address within Flash memory cannot be programmed (any bits written
to 0) more than twice before an erase cycle occurs.
PS025113-1212
Operation