Datasheet
Section 9 I/O Ports
Rev. 1.50 Sep. 18, 2007 Page 174 of 584
REJ09B0240-0150
Port G has the following registers.
• Port control register G (PCRG)
• Port data register G (PDRG)
• Port mode register G (PMRG)
9.11.1 Port Control Register G (PCRG)
PCRG selects inputs/outputs in bit units for pins to be used as general I/O ports of port G.
Bit Bit Name
Initial
Value R/W Description
7
6
5
4
3
2
1
0
PCRG7
PCRG6
PCRG5
PCRG4
PCRG3
PCRG2
PCRG1
PCRG0
0
0
0
0
0
0
0
0
W
W
W
W
W
W
W
W
When each of the port G pins functions as a general
I/O port, setting a PCRG bit to 1 makes the
corresponding pin an output port, while clearing the bit
to 0 makes the pin an input port.
9.11.2 Port Data Register G (PDRG)
PDRG is a general I/O port data register of port G.
Bit Bit Name
Initial
Value R/W Description
7
6
5
4
3
2
1
0
PG7
PG6
PG5
PG4
PG3
PG2
PG1
PG0
0
0
0
0
1
0
0
0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
PDRG stores output data for port G pins.
If PDRG is read while PCRG bits are set to 1, the
values stored in PDRG are read. If PDRG is read while
PCRG bits are cleared to 0, the pin states are read
regardless of the value stored in PDRG. However, if a
port G pin is specified as an analog input channel by
ADCSR or ADCR in the A/D converter, the bit is read
as 0 even when the PGRG bit is cleared.










