![](http://datasheet.mmic.net.cn/30000/M32196F8UFP_datasheet_2359476/M32196F8UFP_175.png)
INTERNAL MEMORY
6
6-25
32192/32195/32196 Group Hardware Manual
Rev.1.10 REJ09B0123-0110 Apr.06.07
6.6 Programming the Internal Flash Memory
6.6.1 Outline of Internal Flash Memory Programming
To program or erase the internal flash memory, there are following two methods to choose depending on the
situation:
(1) When the flash write/erase program does not exist in the internal flash memory
(2) When the flash write/erase program already exists in the internal flash memory
For (1), set the FP pin = "H," MOD0 = "H" and MOD1 = "L" to enter boot mode. In this case, the CPU starts
running the boot program upon exiting the reset state.
The boot program transfers the flash write/erase program into the internal RAM. After the transfer, jump to a
location in the RAM and use the RAM-resident program to set the Flash Control Register 1 (FCNT1) FENTRY
bit to "1" to make the internal flash memory ready for programming/erase operation (i.e., placed in boot mode
+ flash E/W enable mode).
When the above is done, use the flash write/erase program that has been transferred into the internal RAM to
program or erase the internal flash memory.
For (2), set the FP pin = "H," MOD0 = "L" and MOD1 = "L" to enter single-chip mode. Transfer the flash write/
erase program from the internal flash memory in which it has been prepared into the internal RAM. After the
transfer, jump to the RAM and use the program transferred into the RAM to set the Flash Control Register 1
(FCNT1) FENTRY bit to "1" to make the internal flash memory ready for programming/erase operation (i.e.,
placed in single-chip mode + flash E/W enable mode).
When the above is done, use the flash write/erase program that has been transferred into the internal RAM to
program or erase the internal flash memory. Or flash E/W enable mode can be entered from external extension
mode by setting the FP pin = "H," MOD0 = "L" and MOD1 = "H."
During flash E/W enable mode (FP pin = "H", FENTRY = "1"), the EIT vector entry for External Interrupt (EI) is
relocated to the start address (H’0080 4000) of the internal RAM. During normal mode, it is located in the flash
area (H’0000 0080).
To use an external interrupt (EI) in flash E/W enable mode, write at the beginning of the internal RAM an
instruction for branching to the external interrupt (EI) handler that has been transferred into the internal RAM.
Furthermore, because the IVECT register which is read out in the external interrupt (EI) handler has stored in
it the flash memory address of the ICU vector table, make sure the ICU vector table to be used during flash E/
W enable mode is prepared in the internal RAM so that the value of the IVECT register will be converted into
the internal RAM address of the ICU vector table (for example, by adding an offset) before performing branch
processing.
When started by boot mode, internal RAM value is indefinite after started by boot mode in order to "Flash
writing/erasing program" is transferred to internal RAM.