English
Language : 

M16C1N Datasheet, PDF (201/238 Pages) Renesas Technology Corp – RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/10 SERIES
M16C/1N Group
19. Flash Memory Version
(4) Program
This command writes data to the flash memory in 1 word (2 byte) units.
Write 'xx4016' in the first bus cycle and write data to the write address in the second bus cycle, and an
auto program operation (data program and verify) will start. Make sure the address value specified in
the first bus cycle is the same even address as the write address specified in the second bus cycle.
Check the FMR0 register's FMR00 bit to see if auto programming has finished. The FMR00 bit is "0"
during auto programming and set to "1" when auto programming is completed.
Check the FMR0 register's FMR06 bit after auto programming has finished, and the result of auto
programming can be known (refer to 19.5.6 Full Status Check).
Figure 19.9 shows an example of program flowchart.
Writing over already programmed addresses is inhibited.
Also, block 0 to 3 do not accept the program command while the FMR 1 register's FMR 16 bit is "0"
and the FMR0 register's FMR02 bit is "0" (Inhibit rewriting.)
To execute another command immediately after the program command, use the same write address
that was specified in the second bus cycle of the program command for the address value to be
specified in the first bus cycle of the next command.
In EW1 mode, do not execute this command on any address at which the rewrite control program is
located.
In EW0 mode, the microcomputer goes to read status register mode at the same time auto program-
ming starts, making it possible to read the status register. The status register bit 7 (SR7) is cleared to
"0" at the same time auto programming starts, and set back to "1" when auto programming finishes. In
this case, the microcomputer remains in read status register mode until a read command is written
next. The result of auto programming can be known by reading the status register after auto program-
ming has finished.
Start
Write the command code ’xx4016’
to the write address (Note 1)
Write data to the write address
(Note 1)
NO
FMR00=1?
YES
Full status check (Note 2)
Program
completed
Note 1: Write the command code and data at even number.
Note 2: See Figure 19.12 Full status check flowchart, handling each error generated.
Figure 19.9 Program flowchart
Rev.1.00 Oct 20, 2004 page 189 of 222
REJ09B0007-0100Z