English
Language : 

Z8F0830HH020SG Datasheet, PDF (133/257 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore!® F0830 Series
Product Specification
115
FHSWP
0
0 or 1
Table 71. Flash Code Protection using the Flash Option Bits
FWP
0
1
Flash Code Protection Description
Programming and erasing disabled for all Flash program memory. In user code pro-
gramming, page erase and mass erase are all disabled. Mass erase is available
through the On-Chip Debugger.
Programming, page erase and mass erase are enabled for all of the Flash program
memory.
At reset, the Flash Controller is locked to prevent accidental program or erasure of Flash
memory. To program or erase Flash memory, first write the target page to the page select
register. Unlock the Flash Controller by making two consecutive writes to the Flash Con-
trol Register with the values 73H and 8CH, sequentially. The page select register must be
rewritten with the same page previously stored there. If the two page select writes do not
match, the controller reverts to a Locked state. If the two writes match, the selected page
becomes active. See Figure 19 for details.
After unlocking a specific page, you can enable either page program or erase. Writing the
value 95H causes a page erase only if the active page resides in a sector that is not pro-
tected. Any other value written to the Flash Control Register locks the Flash Controller.
Mass erase is not allowed in the user code, but is allowed through the debug port.
After unlocking a specific page, the user can also write to any byte on that page. After a
byte is written, the page remains unlocked, allowing for subsequent writes to other bytes
on the same page. Further writes to the Flash Control Register causes the active page to
revert to a Locked state.
Sector Based Flash Protection
The final protection mechanism is implemented on a per-sector basis. The Flash memories
of Z8 Encore! devices are divided into maximum number of eight sectors. A sector is one-
eighth of the total size of Flash memory, unless this value is smaller than the page size, in
which case the sector and page sizes are equal. On Z8 Encore! F0830 Series devices, the
sector size is varied according to the Z8 Encore! F0830 Series Flash Memory Configura-
tion shown in Table 69 on page 108 and in Figures 14 through 18, which follow the table
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,
PS025113-1212
Operation