English
Language : 

HD64F2168 Datasheet, PDF (688/874 Pages) Renesas Technology Corp – Renesas 16-Bit Single-Chip Microcomputer
 Example of the FMPDR setting
When the storage destination of the program data is flash memory, even if the program
execution routine is executed, programming is not executed and an error is returned to the
FPFR parameter. In this case, the program data must be transferred to the on-chip RAM
and then programming must be executed.
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
JSR
NOP
#DLTOP+16,ER2
@ER2
; Set entry address to ER2
; Call programming routine
 The general registers other than R0L 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 128 bytes at the
maximum 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. After programming finishes, clear FKEY and specify software protection.
If this LSI is restarted by a reset immediately after user MAT programming has finished,
secure the reset period (period of RES = 0) of 100 µs which is longer than normal.
Rev. 3.00, 03/04, page 648 of 830