English
Language : 

Z8F041APB020SC Datasheet, PDF (183/276 Pages) Zilog, Inc. – Z8 Encore XP-R 4K Series High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® 4K Series
Product Specification
164
Byte Write
To write a byte to the NVDS array, the user code must first push the address, then the data
byte onto the stack. The user code issues a CALL instruction to the address of the byte-
write routine (0x10B3). At the return from the sub-routine, the write status byte resides in
working register R0. The bit fields of this status byte are defined in Table 106. The con-
tents of the status byte are undefined for write operations to illegal addresses. Also, user
code should pop the address and data bytes off the stack.
The write routine uses 13 bytes of stack space in addition to the two bytes of address and
data pushed by the user. Sufficient memory must be available for this stack usage.
Because of the flash memory architecture, NVDS writes exhibit a non-uniform execution
time. In general, a write takes 251μs (assuming a 20MHz system clock). Every 400 to 500
writes, however, a maintenance operation is necessary. In this rare occurrence, the write
takes up to 61ms to complete. Slower system clock speeds result in proportionally higher
execution times.
NVDS byte writes to invalid addresses (those exceeding the NVDS array size) have no
effect. Illegal write operations have a 2μs execution time.
Table 106. Write Status Byte
BITS
FIELD
DEFAULT
VALUE
7
6
5
4
3
2
1
0
Reserved
RCPY
PF
AWE
DWE
0
0
0
0
0
0
0
0
Reserved—Must be 0.
RCPY—Recopy Subroutine Executed
A recopy subroutine was executed. These operations take significantly longer than a
normal write operation.
PF—Power Failure Indicator
A power failure or system reset occurred during the most recent attempted write to the
NVDS array.
AW—Address Write Error
An address byte failure occurred during the most recent attempted write to the NVDS
array.
DWE—Data Write Error
A data byte failure occurred during the most recent attempted write to the NVDS
array.
PS022815-0206
Non-Volatile Data Storage