
Rev.2.10 Apr 14, 2006 page 262 of 378
REJ09B0124-0210
M16C/6N Group (M16C/6NK, M16C/6NM) 21. Flash Memory Version
21.1.1 Boot Mode
The MCU enters boot mode when a hardware reset occurs while an “H ” signal is applied to pins CNVSS
and P5_0 and an “L ” signal is applied to the P5_5 pin. A program in the boot ROM area is executed.
In boot mode, the FMR05 bit in the FMR0 register selects access to the boot ROM area or the user ROM area.
The rewrite control program for standard serial I/O mode is stored in the boot ROM area before shipment.
The boot ROM area can be rewritten in parallel I/O mode only. If given rewrite control program using
erase-write mode (EW0 mode) is written in the boot ROM area, the flash memory can be rewritten
according to the system implemented.
21.2 Functions to Prevent Flash Memory from Rewriting
The flash memory has the ROM code protect function for parallel I/O mode and the ID code check function
for standard serial I/O mode and CAN I/O mode to prevent the flash memory from reading or rewriting.
21.2.1 ROM Code Protect Function
The ROM code protect function inhibits the flash memory from being read or rewritten during parallel I/O
mode. Figure 21.2 shows the ROMCP Register. The ROMCP register is located in the user ROM area.
The ROM code protect function is enabled when the ROMCR bits are set to other than 11b. In this case,
set the bit 5 to bit 0 to 111111b.
When exiting ROM code protect, erase the block including the ROMCP register by CPU rewrite mode,
standard serial I/O mode, or CAN I/O mode.
21.2.2 ID Code Check Function
Use the ID code check function in standard serial I/O mode and CAN I/O mode. The ID code sent from the
serial programmer is compared with the ID code written in the flash memory for a match. If the ID codes
do not match, commands sent from the serial programmer are not accepted. However, if the four bytes of
the reset vector are FFFFFFFFh, ID codes are not compared, allowing all commands to be accepted.
The ID codes are 7-byte data stored consecutively, starting with the first byte, into addresses 0FFFDFh,
0FFFE3h, 0FFFEBh, 0FFFEFh, 0FFFF3h, 0FFFF7h, and 0FFFFBh. The flash memory must have a
program with the ID codes set in these addresses.
Figure 21.3 shows the Addresses for ID Code Stored.
Comentários a estes Manuais