Datasheet
Section 21 Flash Memory (0.18-μm F-ZTAT Version)
Rev.7.00 Mar. 18, 2009 page 902 of 1136
REJ09B0109-0700
12. Programming
There is an entry point of the programming program in the area from the start address specified
by FTDAR + 16 bytes of the on-chip RAM. The subroutine is called and programming is
executed by using the following steps.
MOV.L #DLTOP+16,ER2; Set entry address to ER2
JSR @ER2; Call programming routine
NOP
⎯ The general registers other than ER0 and ER1 are held in the programming program.
⎯ R0L is a return value of the FPFR parameter.
⎯ Since the stack area is used in the programming program, a stack area of a maximum 128
bytes must be allocated in RAM
13. The return value in the programming program, FPFR (general register R0L) is determined.
14. Determine whether programming of the necessary data has finished.
If more than 128 bytes of data are to be programmed, specify FMPAR and FMPDR in 128-
byte units, and repeat steps 12 to 14. Increment the programming destination address by 128
bytes and update the programming data pointer correctly. If an address which has already been
programmed is written to again, not only will a programming error occur, but also flash
memory will be damaged.
15. Execution of Programming Finished Processing
The entry point of the programming library is in the area beginning at the download
destination start address specified by FTDAR plus 16 bytes. Subroutine calls should therefore
be performed as follows.
MOV.L #H'F0F0F0F0,ER0;
MOV.L #H'0F0F0F0F,ER2;
MOV.L #DLTOP+16,ER2; Set entry address to ER2
JSR @ER2; Call programming finished routine
⎯ Data is stored in a general register other than ER0, ER1 by the programming finished
program.
⎯ R0L is the return value of the FPFR parameter.
⎯ The programming finished program uses the stack area, so a maximum 128-byte stack area
should be reserved in RAM beforehand.










