RL78/G15 CHAPTER 19 FLASH MEMORY
R01UH0959EJ0110 Rev.1.10 Page 669 of 765
Mar 7, 2023
19.6 Self-Programming
The RL78 microcontroller supports a self-programming function that can be used to rewrite the code flash memory via a
user program. Because this function allows a user application to rewrite the code flash memory by using the flash self-
programming library, it can be used to upgrade the program in the field.
Caution 1. To prohibit an interrupt during self-programming, in the same way as in the normal operation
mode, execute the flash self-programming library in the state where the IE flag is cleared (0) by the
DI instruction.
Since the CPU is stopped while rewriting the flash memory, an interrupt cannot be accepted during
this period.
Caution 2. The high-speed on-chip oscillator should be kept operating during self-programming. If it is kept
stopping, the high-speed on-chip oscillator clock should be operated (HIOSTOP = 0). The flash
self-programming code should be executed after 30 μs have elapsed.
19.6.1 Registers controlling self-programming
●
Flash address pointer registers (FLAPH, FLAPL)
●
Flash end address specification registers (FLSEDH, FLSEDL)
●
Flash write buffer registers (FLWHH, FLWHL, FLWLH, FLWLL)
●
Flash programming mode control register (FLPMC)
●
Flash memory sequencer initial setting register (FSSET)
●
Flash memory sequencer control register (FSSQ)
●
Flash memory sequencer status registers (FSASTH, FSASTL)