English
Language : 

Z8F1680SH020SG Datasheet, PDF (293/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
268
Table 133. Flash Code Protection Using the Flash Option Bit
FWP
0
1
Flash Code Protection Description
Programming and erasing disabled for all of Flash Program Memory. In user code programming,
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 Flash Program Memory.
20.2.3.2. Flash Code Protection Using the Flash Controller
At Reset, the Flash Controller locks to prevent accidental program or erasure of the con-
tents of Flash memory. Follow the steps below to unlock the Flash Controller from user
code:
1. Write the Page Select Register with the target page.
2. Write the first unlock command 73H to the Flash Control Register.
3. Write the second unlock command 8CH to the Flash Control Register.
4. Rewrite the Page Select Register 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. For details, see the flowchart in
Figure 54 on page 266.
Note: Byte Programming, Page Erase and Mass Erase will not be allowed if the FWP bit is
cleared or if the page resides in a protected block.
After unlocking a specific page, Byte Programing or Page Erase can be performed. At the
conclusion of a Page Erase, the Flash Controller is automatically locked. To lock the Flash
Controller after Byte Programming, write to the Flash Control Register with any value
other than the Page Erase or Mass Erase comands.
20.2.3.3. 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 a maximum number of 8 sectors. A sector is 1/8 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 the Z8 Encore! XP F1680 Series devices, the sector
size is 3 KB, 2 KB or 1 KB depending on available on-chip Flash size of 24 KB, 16 KB and
8 KB.
PS025015-1212
PRELIMINARY
Flash Memory