
337
(b)Mode 7
Setting a PGDDR bit to 1 makes the corresponding pin an output port, while clearing the bit to
0 makes the pin an input port.
(2) Port G Data Register (PGDR)
7
—
Undefined
—
6
—
Undefined
—
5
—
Undefined
—
4
PG4DR
0
R/W
3
PG3DR
0
R/W
0
PG0DR
0
R/W
2
PG2DR
0
R/W
1
PG1DR
0
R/W
Bit
:
Initial value :
R/W
:
PGDR is an 8-bit readable/writable register that stores output data for the port G pins (PG4 to
PG0).
Bits 7 to 5 are reserved; these bits cannot be modified and will return an undefined value if read.
PGDR is initialized to H'00 (bits 4 to 0) by a power-on reset and in hardware standby mode. It
retains its previous state after a manual reset and in software standby mode.
(3) Port G Register (PORTG)
7
—
Undefined
—
6
—
Undefined
—
5
—
Undefined
—
4
PG4
—*
R
3
PG3
—*
R
0
PG0
—*
R
2
PG2
—*
R
1
PG1
—*
R
Bit
:
Initial value :
R/W
:
Note: * Determined by the state of pins PG4 to PG0.
PORTG is an 8-bit read-only register that shows the pin states. It cannot be written to. Writing of
output data for the port G pins (PG4 to PG0) must always be performed on PGDR.
Bits 7 to 5 are reserved; these bits cannot be modified and will return an undefined value if read.
If a port G read is performed while PGDDR bits are set to 1, the PGDR values are read. If a port
G read is performed while PGDDR bits are cleared to 0, the pin states are read.
After a power-on reset and in hardware standby mode, PORTG contents are determined by the pin
states, as PGDDR and PGDR are initialized. PORTG retains its previous state after a manual reset
and in software standby mode.