English
Language : 

HD64F3642AHV Datasheet, PDF (149/551 Pages) Renesas Technology Corp – Old Company Name in Catalogs and Other Documents
Section 6 ROM
6.7 Programming and Erasing Flash Memory
The on-chip flash memory of the H8/3644F, H8/3643F, and H8/3642AF is programmed and
erased by software, using the CPU. There are five flash memory operating modes: program mode,
erase mode, program-verify mode, erase-verify mode, and prewrite-verify mode. Transitions to
these modes can be made by setting the P, E, PV, and EV bits in the flash memory control register
(FLMCR).
The flash memory cannot be read while being programmed or erased. Therefore, the program that
controls flash memory programming and erasing should be located and executed in on-chip RAM
or external memory. A description of each mode is given below, with recommended flowcharts
and sample programs for programming and erasing.
See section 6.9, Flash Memory Programming and Erasing Precautions, for additional notes on
programming and erasing.
6.7.1 Program Mode
To write data into the flash memory, follow the programming algorithm shown in figure 6.13. This
programming algorithm enables data to be written without subjecting the device to voltage stress
or impairing the reliability of the programmed data.
To write data, first set the blocks to be programmed with erase block registers 1 and 2 (EBR1,
EBR2), and write the data to the address to be programmed, as in writing to RAM. The flash
memory latches the programming address and programming data in an address latch and data
latch. Next set the P bit in FLMCR, selecting program mode. The programming time is the time
during which the P bit is set. Make a setting so that the total programming time does not exceed 1
ms. Programming for too long a time, due to program runaway for example, can damage the
device. Before selecting program mode, set up the watchdog timer so as to prevent
overprogramming.
For details of the programming procedure, see section 6.7.3, Programming Flowchart and Sample
Program.
Rev. 6.00 Sep 12, 2006 page 127 of 526
REJ09B0326-0600