
6
INTERNAL MEMORY
6-32
32185/32186 Group Hardware Manual
Rev.1.10 REJ09B0235-0110 May 15, 07
6.6 Programming Internal Flash Memory
(1) Flash E/W enable mode
Flash E/W enable mode is a mode in which the internal flash memory can be programmed or erased. In
flash E/W enable mode, no programs can be executed in the internal flash memory. Therefore, the neces-
sary program must be transferred into the internal RAM before entering flash E/W enable mode, so that it
can be executed in the internal RAM.
(2) Entering flash E/W enable mode
Flash E/W enable mode can only be entered when operating in single-chip, external extension or boot
mode. Furthermore, it is only when the FP pin = "H" and the Flash Control Register 1 (FCNT1) FENTRY bit
= "1" that flash E/W enable mode can be entered. Flash E/W enable mode cannot be entered when operat-
ing in processor mode or the FP pin = "L."
(3) Detecting the MOD0 and MOD1 pin levels
The MOD0 and MOD1 pin levels ("H" or "L") can be known by checking the P8 Data Register (Port Data
Register, H’0080 0708) MOD0DT and MOD1DT bits.
P8 Data Register (P8DATA)
<Address: H’0080 0708>
123456
b7
b0
P87DT
P86DT
P85DT
P84DT
P83DT
P82DT
MOD1DT
MOD0DT
????????
<Upon exiting reset: Undefined>
b
Bit Name
Function
R
W
0
MOD0DT (P80DT)
0: MOD0 pin = "L"
R
–
MOD0 data bit
1: MOD0 pin = "H"
1
MOD1DT (P81DT)
0: MOD1 pin = "L"
R
–
MOD1 data bit
1: MOD1 pin = "H"
2
P82DT
At read
R
W
Port P82 data bit
Depends on how the Port Direction Register is set
3
P83DT
If direction bit = "0" (input mode)
Port P83 data bit
0: Port input pin = "L"
4
P84DT
1: Port input pin = "H"
Port P84 data bit
If direction bit = "1" (output mode) (Note 1)
5
P85DT
0: Port output latch = "0" / Port pin level = "L"
Port P85 data bit
1: Port output latch = "1" / Port pin level = "H"
6
P86DT
At write
Port P86 data bit
Write to the port output latch
7
P87DT
Port P87 data bit
Note 1: To select the port data to read, use the Port Input Special Function Control Register’s port input data select bit (PISEL).