
Section 19 Flash Memory (0.18-
m F-ZTAT Version)
Rev. 1.00 Mar. 02, 2006 Page 622 of 798
REJ09B0255-0100
In the download processing, all interrupts are not accepted. However, interrupt requests
except for NMI are held. Therefore, when execution returns to the user procedure program,
the interrupts will occur.
When the level-detection interrupt requests are to be held, interrupts must be input until the
download is ended.
Since a stack area of 128 bytes at the maximum is used, the stack area must be allocated
before setting the SCO bit to 1.
(d) Clear FKEY to H'00 for protection.
(e) Check the value of the DPFR parameter to confirm the download result.
Check the value of the DPFR parameter (single byte of start address of the download
destination specified by FTDAR). If the value is H'00, download has been performed
normally. If the value is not H'00, the source that caused download to fail can be
investigated by the description below.
If the value of the DPFR parameter is the same as before downloading (e.g. H'FF), the
address setting of the download destination in FTDAR may be abnormal. In this case,
confirm the setting of the TDER bit in FTDAR.
If the value of the DPFR parameter is different from before downloading, check the SS bit
and FK bit in the DPFR parameter to ensure that the download program selection and
FKEY setting were normal, respectively.
(f) Set the operating frequency to the FPEFEQ parameter for initialization.
The current frequency of the CPU clock is set to the FPEFEQ parameter (general register
ER0).
The settable range of the FPEFEQ parameter is 8 to 20 MHz. When the frequency is set out of
this range, an error is returned to the FPFR parameter of the initialization program and
initialization is not performed. For details on the frequency setting, see the description in
19.3.2 (2) (a), Flash programming/erasing frequency control parameter (FPEFEQ: general
register ER0 of CPU).
(g) Initialization
When a programming program is downloaded, the initialization program is also downloaded to
the on-chip RAM. There is an entry point for the initialization program in the area from the
start address of a download destination specified by FTDAR
+ 32 bytes. The subroutine is
called and initialization is executed by using the following steps.
MOV.L
#DLTOP+32,ER2
;
Set entry address to ER2
JSR
@ER2
;
Call initialization routine
NOP
The general registers other than R0L are saved in the initialization program.