English
Language : 

H8SX1657 Datasheet, PDF (715/892 Pages) Renesas Technology Corp – Renesas 32-Bit CISC Microcomputer H8SX Family / H8SX/1600 Series
Section 18 Flash Memory (0.18-µm F-ZTAT Version)
 Example of FMPDR parameter setting: When the storage destination for the program data
is flash memory, even if the programming 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 is executed. The entry point of the programming program is at the address which
is 16 bytes after #DLTOP (start address of the download destination specified by FTDAR).
Call the subroutine to execute programming 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 128 bytes at the
maximum must be allocated in RAM.
13. The return value in the programming program, the FPFR parameter is determined.
14. Determine whether programming of the necessary data has finished. If more than 128 bytes of
data are to be programmed, update the FMPAR and FMPDR parameters in 128-byte units, and
repeat steps 11 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. Programming end processing is executed.
The entry point of the programming library is at the address which is 16 bytes after the start
address of the download destination specified by FTDAR. Call the subroutine by using the
following steps.
MOV.L #H'F0F0F0F0,ER0
MOV.L #H'0F0F0F0F,ER1
MOV.L #DLTOP+16,ER2 ; Set entry address to ER2
JSR
@ER2
; Call programming end routine
 The general registers other than ER0 and ER1 are held in the programming end program.
 R0L is a return value of the FPFR parameter.
 Since the stack area is used in the programming end program, a stack area of 128 bytes at
the maximum must be allocated in RAM.
Rev. 2.00 Jun. 28, 2007 Page 691 of 864
REJ09B0341-0200