Datasheet
Section 20 Flash Memory (0.18-μm F-ZTAT Version)
Rev.6.00 Mar. 18, 2009 Page 760 of 980
REJ09B0050-0600
⎯ The general registers other than ER0, 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,ER1;
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.
⎯ Only perform programming finished processing once per block. Even if multiple 128-byte
programming operations have been performed to the same block, programming finished
processing should only be carried out once. (Due not perform programming finished
processing multiple times.) If it is necessary to reprogram blocks within a previously
programmed area on which programming finished processing has been performed, first
erase the blocks in question and then reprogram them.
⎯ Programming finished processing should be performed on all blocks containing areas that
have been programmed after initialization processing. For example, if programming
finished processing is to be carried out once after programming blocks EB1 to EB3,
programming finished processing should be performed individually on EB1, EB2, and
EB3.