
www.national.com
26
again until programming is completed and the status bit is re-
set to 0.
The device hardware internally generates the voltages and
timing signals necessary for programming. No additional
power supply is required, nor any software required except to
check the status bit for completion of programming. The min-
imum time required to erase and reprogram a byte or word is
1.1 ms. The programmed values can be verified by using nor-
mal memory read operations. The prescaler output drives a
10-bit counter to generate timing pulses and there are five re-
load registers to produce various pulse widths.
If a reset occurs during a programming or erase operation,
the operation is terminated. The reset is extended until the
flash memory returns to the idle state. Therefore, the timing
logic and program or erase state machine is not cleared on
reset; they are cleared on power-up with the clear signal ac-
tive until the bus signals are in a known state.
The flash EEPROM data memory does not have permanent
read-protection or write-protection features like those avail-
able for the EEPROM program memory. However, the Data
Memory Write Key Register provides a way to “l(fā)ock” the data
written to the data memory.
9.3.3
Data Memory Control and Status Register
(DMCSR)
The DMCSR register is a byte-wide, read/write register used
with the flash EEPROM data memory or ISP flash EEPROM
program memory. When writing to this register, all reserved
bits must be written with 0 for the memory to operate proper-
ly. There are two status/control bits, as shown in the register
format below.
7
6
5
4
3
2
Reserved
ERASE DMBUSY ZEROWS
ZEROWS
Zero Wait-State Access. When cleared (0), the
flash EEPROM data memory will be read in two
cycles. When set (1), the flash EEPROM data
memory will be read in one cycle.
Data Memory Busy. This bit is automatically set
to 1 when the flash EEPROM data memory or
the ISP flash EEPROM program memory is
busy being programmed, and cleared to 0 at all
other times. (The MSTAT.PGMBUSY is also set
to 1 whenever the DMBUSY bit is set to 1.)
Erase ISP Flash Program Memory Page.
When set (1) a valid write to the ISP flash EE-
PROM program memory will erase the entire
ISP flash EEPROM program memory page
pointed to by the write address rather than per-
forming a write to the addressed memory loca-
tion. This bit should be cleared to 0 and remain
cleared after the write operation.
Upon reset, the DMCSR register is cleared to zero when the
flash memory on the chip is in the idle state.
DMBUSY
ERASE
9.3.4
The DMPSLR register is a byte-wide, read/write register that
selects the prescaler divider ratio for the EEPROM data
memory programming clock. Before you write to the data
Data Memory Prescaler Register (DMPSLR)
memory for the first time, you should program the DMPSLR
register with the proper prescaler value, an 8-bit value called
FTDIV. The device divides the system clock by (FTDIV+1) to
produce the data memory programming clock.
You should choose a value of FTDIV to produce a clock of the
highest possible frequency that is equal to or just less than
200 kHz. Upon reset, this register is programmed by default
with the value 63 hex (99 decimal), which is an appropriate
setting for a 20 MHz system clock.
9.3.5
Data Memory Start Time Reload Register
(DMSTART)
The DMSTART register is a byte-wide read/write register that
controls the program/erase start delay time. This value is
loaded into the lower 8 bits of the flash timing counter, and at
the same time, 00
2
is loaded into the upper 2 bits. Before you
write to the data memory for the first time, you should pro-
gram the DMSTART register with the proper prescaler value,
an 8-bit value called FTSTART. The flash timing counter gen-
erates a delay of (FTSTART + 1) prescaler output clocks. The
default value provides a delay time of 10ms when the pres-
caler output clock is 200kHz. Do not modify this register while
program/erase operation is in progress.
Upon reset, this register resets to 01
16
when the flash mem-
ory on the chip is in idle state.
9.3.6
Data Memory Transition Time Reload Register
(DMTRAN)
The DMTRAN register is a byte-wide read/write register that
controls some program/erase transition times. This value is
loaded into the lower 8 bits of the flash timing counter, and at
the same time, 00
2
is loaded into the upper 2 bits. Before you
write to the data memory for the first time, you should pro-
gram the DMTRAN register with the proper prescaler value,
an 8-bit value called FTTRAN. The flash timing counter gen-
erates a delay of (FTTRAN + 1) prescaler output clocks. The
default value provides a delay time of 5ms when the prescal-
er output clock is 200kHz. Do not modify this register while
program/erase operation is in progress.
Upon reset, this register resets to 00
16
when the flash mem-
ory on the chip is in idle state.
9.3.7
Data Memory Programming Time Reload
Register (DMPROG)
The DMPROG register is a byte-wide read/write register that
controls the programming pulse width. This value is loaded
into the lower 8 bits of the flash timing counter, and at the
same time, 00
2
is loaded into the upper 2 bits. Before you
write to the data memory for the first time, you should pro-
gram the DMPROG register with the proper prescaler value,
an 8-bit value called FTPROG. The flash timing counter gen-
erates a programming pulse width of (FTPROG + 1) prescal-
er output clocks. The default value provides a delay time of
30ms when the prescaler output clock is 200kHz. Do not
modify this register while program/erase operation is in
progress.
Upon reset, this register resets to 05
16
when the flash mem-
ory on the chip is in idle state.
1
0
Reserved