English
Language : 

Z8FMC16100 Datasheet, PDF (237/402 Pages) Zilog, Inc. – Z8 Encore-R Motor Control Flash MCUs
Z8FMC16100 Series Flash MCU
Product Specification
215
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 now resides at Register
File address FF9h.
4. Write 00h to the Flash Control Register to return the Flash Controller to its reset state.
Flash Write Protection Option Bit
The Flash Write Protect option bit can be enabled to block all program and erase opera-
tions from user code. Refer to the Option Bits chapter on page 223 for more information.
Byte Programming
When the Flash Controller is unlocked, Writes to Program Memory from user code will
program a byte into the Flash if the address is located in the unlocked page. An erased
Flash byte contains all ones (FFh). The programming operation can only be used to
change bits from one to zero. To change a Flash bit (or multiple bits) from zero to one
requires a Page Erase or Mass Erase operation.
Byte programming can be performed using the eZ8 CPU’s LDC or LDCI instructions.
Refer to the eZ8 CPU User Manual (UM0128) for a description of the LDC and LDCI
instructions.
While the Flash Controller programs Flash memory, the eZ8 CPU idles, but the system
clock and on-chip peripherals continue to operate. Interrupts that occur when a program-
ming operation is in progress are serviced after the programming operation is complete. To
exit programming mode and lock the Flash Controller, write 00h to the Flash Control
Register.
User code cannot program Flash Memory on a page that lies in a protected sector. When
user code writes memory locations, only addresses located in the unlocked page are pro-
grammed. Memory Writes outside of the unlocked page are ignored.
Caution: Each memory location must not be programmed more than twice before an erase is re-
quired.
The proper steps to program Flash memory from user code are:
1. Write 00h to the Flash Control Register to reset the Flash Controller.
2. Write the page of memory to be programmed to the Page Select Register.
3. Write the first unlock command 73h to the Flash Control Register.
4. Write the second unlock command 8Ch to the Flash Control Register.
5. rewrite the page written in Step 2 to the Page Select Register.
6. Write Program Memory using LDC or LDCI instructions to program Flash.
7. Repeat Step 6 to program additional memory locations on the same page.
PS024604-1005
PRELIMINARY
Byte Programming