NEC PD754144 User Manual page 86

4-bit single-chip microcontrollers
Table of Contents

Advertisement

Set the write time to 18 × 2
Example
data (0AH) at 08H of memory bank 4.
SET1
SEL
MOV
MOV
SKF
BR
SEL
MOV
MOV
CLR1
WAIT;
SKF
BR
CLR1
Caution The development tool simulates writing data to EEPROM by writing the data to RAM. Therefore,
it seems as if EEPROM was normally written even if the wait time <A> is not long enough.
However, data cannot be written correctly to the device unless the wait time <A> is long enough
(4.0 ms MIN., 10.0 ms MAX.) (the contents written to the EEPROM are undefined). After writing
the data, clear EWE to 0.
Cautions on EEPROM writing are shown below. Be sure to read them before writing to EEPROM. When performing
consecutive writing, write once after the current write operation is finished. Set EWTC4 to EWTC6 so that data can
be written to the EEPROM once within the following time.
• With µ PD754144 ... 18 × 2
• With µ PD754244 ... 4.0 ms MIN., 10.0 ms MAX.
Clear EWE to 0 after writing.
Writing can be completed and time can be managed in the following ways.
(1) Using write end interrupt
After one data item is written, wait for generation of a write end interrupt, while performing processing other
than writing. When a write end interrupt is generated, start the next write operation.
(2) Using write status flag
Execute polling on the write status flag and wait until it becomes 0.
When the write status flag becomes 0, it indicates the write end, and so start the next write operation.
(3) Using timer
Use the timer counter or basic interval timer to wait
(4) Using software
Use the software timer to wait
Note Make sure that a wait time longer than the write time specified by EWTC4 to EWTC6 elapses. If EWE is
cleared within the time set by EWTC4 to EWTC6, the contents written to the EEPROM are undefined.
86
CHAPTER 5 EEPROM
8
/f
and after checking the EEPROM write status flag (EWST), write 8-bit
X
MBE
MB15
XA, #01011000B
EWC, XA
EWST
A1
MB4
XA, #0AH
08H, XA
MBE
EWST
<A>
WAIT
EWE
8
/f
(4.6 ms: f
= 1.0 MHz)
CC
CC
Note
Note
for the write time set by EWTC4 to EWTC6.
User's Manual U10676EJ3V0UM
; Selection of bank 15
; Write enable
; Set the write time to 18 × 2
; Write
for the write time set by EWTC4 to EWTC6.
8
/f
X

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd754244

Table of Contents