![](http://datasheet.mmic.net.cn/30000/M38869MCA-XXXHP_datasheet_2360498/M38869MCA-XXXHP_282.png)
2-166
3886 Group User’s Manual
APPLICATION
2.15 Flash memory
2.15.6 CPU reprogramming mode
In the CPU reprogramming mode, issuing software commands through the Central Processing Unit (CPU)
can reprogram the built-in flash memory. Accordingly, the contents of the built-in flash memory can be
reprogrammed with the microcomputer itself mounted on board, without using the EPROM programmer.
Store the reprogramming control program to the built-in flash memory in advance. The built-in flash memory
cannot be read in the CPU reprogramming mode. Accordingly, after transferring the reprogramming control
program to the internal RAM, execute it on the RAM.
The following commands can be used in the CPU reprogramming mode: read, program, program verify,
erase, erase verify, and reset. For details concerning each command, refer to “CHAPTER 1 Flash memory
mode 3 (CPU reprogramming mode)”.
(1)
CPU reprogramming mode beginning/release procedures
Operation procedure in the CPU reprogramming mode for the built-in flash memory is described
below.
As for the control example, refer to “2.15.7 (2) Control example in the CPU reprogramming mode.”
[Beginning procedure]
Apply 0 V to the CNVSS/VPP pin for reset release.
After CPU reprogramming mode control program is transferred to internal RAM, jump to this
control program on RAM. (The following operations are controlled by this control program).
Set “1” to the CPU reprogramming mode select bit (bit 0 of address 0FFE16).
Apply VPPH to the CNVSS/VPP pin.
Wait until CNVSS/VPP pin becomes 12 V.
Read the CPU reprogramming mode monitor flag (bit 2 of address 0FFE16) to confirm that the
CPU reprogramming mode is valid.
Flash memory operations are executed by writing software-commands to the flash command
register (address 0FFF16).
Note: The following procedures are also necessary.
Control for data which is input from the external (serial I/O etc.) and to be programmed
to the flash memory.
Initial setting for ports, etc.
Writing to the watchdog timer
[Release procedure]
Apply 0 V to the CNVSS/VPP pin.
Wait until CNVSS/VPP pin becomes 0 V.
Set the CPU reprogramming mode select bit (bit 0 of address 0FFE16) to “0”.