Datasheet

Section 20 Flash Memory (0.18-μm F-ZTAT Version)
Rev.6.00 Mar. 18, 2009 Page 755 of 980
REJ09B0050-0600
(2) Programming Procedure in User Program Mode
The procedures for download, initialization, and programming are shown in figure 20.11.
Select on-chip program
to be downloaded and
specify download
destination by FTDAR
Set FKEY to H'A5
Set SCO to 1 and
execute download
DPFR = 0?
Yes
No
Download error processing
Set the FPEFEQ, FUBRA
parameter
Yes
End programming
procedure program
FPFR = 0?
No
Disable interrupts and bus
master operation
other than CPU
Clear FKEY to 0
Programming
JSR FTDAR setting + 16
Yes
FPFR = 0?
No
Clear FKEY and
programming
error processing
Yes
FPFR = 0?
No
Clear FKEY and
programming
error processing
Yes
Required data
programming is
completed?
No
Set FKEY to H'5A
Clear FKEY to 0
1.
2.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
17.
16.
Programming finished
processing
JSR FTDAR setting + 16
15.
a
a
3.
Download
Initialization
Programming
Initialization
JSR FTDAR setting + 32
Initialization error processing
Set parameters to ER1
and ER0
(FMPAR and FMPDR)
Start programming
procedure program
Figure 20.11 Programming Procedure
The procedure program must be executed in an area other than the flash memory to be
programmed. Especially the part where the SCO bit in FCCS is set to 1 for downloading must be
executed in the on-chip RAM.