
Section 19 Flash Memory (0.18-
m F-ZTAT Version)
Rev. 1.00 Mar. 02, 2006 Page 594 of 798
REJ09B0255-0100
2. Download of on-chip program
The on-chip program is automatically downloaded by setting the flash key code register
(FKEY) and the SCO bit in the flash code control status register (FCCS), which are
programming/erasing interface registers.
The flash memory MAT is replaced with the embedded program storage MAT during
downloading. Since the flash memory cannot be read during programming/erasing, the
procedure program that executes download to completion of programming/erasing must be
executed in a space other than flash memory (for example, on-chip RAM).
Since the result of download is returned to the programming/erasing interface parameter,
whether download has succeeded or not can be confirmed.
3. Initialization of programming/erasing
Set the operating frequency before execution of programming/erasing. This setting is
performed by using the programming/erasing interface parameter.
4. Execution of programming/erasing
For programming/erasing execution, set the FLSHE bit in STCR and the FWE pin to 1 to make
a transition to user program mode.
The program data/programming destination address is specified in 128-byte units for
programming. The block to be erased is specified in erase-block units for erasing.
Make these specifications by using the programming/erasing interface parameter, and then
initiate the on-chip program. The on-chip program is executed by using the JSR or BSR
instruction to execute the subroutine call of the specified address in the on-chip RAM. The
execution result is returned to the programming/erasing interface parameter.
The area to be programmed must be erased in advance when programming flash memory. All
interrupts must be disabled during programming and erasing. Interrupts must be masked within
the user system.
5. Consecutive execution of programming/erasing
When the 128-byte programming or one-block erasure does not end the processing, the
program address/data and erase-block number must be updated and consecutive
programming/erasing is required.
Since the downloaded on-chip program remains in the on-chip RAM even after the processing
ends, download and initialization are not required when the same processing is executed
consecutively.