Hitachi H8/3062 Hardware Manual page 516

Single-chip microcomputer
Hide thumbs Also See for H8/3062:
Table of Contents

Advertisement

Start
Set SWE bit in FLMCR
Wait (x) µsec
Store 32-byte write data in write data area
and reprogram data area
Programming operation counter n ← 1
Consecutively write 32-byte data in
reprogram data area in RAM to flash memory
Enable WDT
Set PSU bit in FLMCR
Wait (y) µsec
Set P bit in FLMCR
Wait (z) µsec
Clear P bit in FLMCR
Wait (α) µsec
Clear PSU bit in FLMCR
Wait (β) µsec
Disable WDT
Set PV bit in FLMCR
Wait (γ) µsec
Set verify start address
Programming end flag ← 0
H'FF dummy write to verify address
Wait (ε) µsec
Read verify data
Programming OK?
OK
Reprogram data computation
Transfer computation result to reprogram
data area
Increment verify address
32-byte
No
data verification completed?
Yes
Clear PV bit in FLMCR
Wait (η) µsec
Programming end flag = 0?
Yes
Clear SWE bit in FLMCR
End of programming
Figure 17.11 Program/Program-Verify Flowchart (32-byte Programming)
*1
*6
*2
*6
Start of programming
*6 *7
End of programming
*6
*6
*6
*6
*3
NG
Programming end
flag ← 1 (unfinished)
*4
*5
*6
No
Yes
Clear SWE bit in FLMCR
Programming failure
Notes: 1. Programming should be performed in the erased state.
(Perform 32-byte programming on memory after all 32 bytes
have been erased.)
2. Data transfer is performed by byte transfer (word transfer is not
possible), with the write start address at a 32-byte boundary.
The lower 8 bits of the first address written to must be H'00,
H'20, H'40, H'60, H'80, H'A0, H'C0, or H'E0. A 32-byte data
transfer must be performed even if writing fewer than 32 bytes;
in this case, H'FF data must be written to the extra addresses.
3. Verify data is read in 16-bit (word) units. (Byte-unit reading is
also possible.)
4. Reprogram data is determined by the computation shown in the
table below (comparison of data stored in the program data
area with verify data). Programming of reprogram data 0 bits is
executed in the next programming loop. Therefore, even bits for
which programming has been completed will be programmed
again if the result of the subsequent verify operation is NG.
5. An area for storing write data (32 bytes) and an area for storing
reprogram data (32 bytes) must be provided in RAM. The
contents of the latter are rewritten in accordance with the
reprogramming data computation.
6. The values of x, y, z, α, β, γ, ε, η, and N are shown in section
22.2.6, Flash Memory Characteristics.
7. The value of z depends on the number of reprogramming loops
(n). Details are given in section 20.2.6, Flash Memory
Characteristics.
Write
Verify
Reprogram
Data
Data
Data
0
0
1
0
1
0
1
0
1
1
1
1
Reprogram
n ← n + 1
*6
No
n > N?
Comments
Programming completed
Programming incomplete; reprogram
Still in erased state; no action
RAM
Program data storage
area (32 bytes)
Reprogram data storage
area (32 bytes)
499

Advertisement

Table of Contents
loading

Table of Contents