English
Language : 

MC9S08GT16A Datasheet, PDF (97/300 Pages) Freescale Semiconductor, Inc – Microcontrollers
Parallel Input/Output
6.5.6 Port G Registers (PTGD, PTGPE, PTGSE, and PTGDD)
Port G includes four general-purpose I/O pins that are shared with BKGD/MS function and the oscillator
or external clock pins. Port G pins used as general-purpose I/O pins are controlled by the port G data
(PTGD), data direction (PTGDD), pullup enable (PTGPE), and slew rate control (PTGSE) registers.
Port pin PTG0, while in reset, defaults to the BKGD/MS pin. After the MCU is exits reset, PTG0 can be
configured to be a general-purpose output pin. When BKGD/MS takes control of PTG0, the corresponding
PTGDD, PTGPE, and PTGPSE bits are ignored.
Port pins PTG1 and PTG2 can be configured to be oscillator or external clock pins. When the oscillator
takes control of a port G pin, the corresponding PTGD, PTGDD, PTGSE, and PTGPE bits are ignored.
Reads of PTGD will return the logic value of the corresponding pin, provided PTGDD is 0.
7
R
0
W
Reset
0
6
5
4
3
2
0
0
0
PTGD3
PTGD2
0
0
0
0
0
Figure 6-28. Port PTG Data Register (PTGD)
1
PTGD1
0
0
PTGD0
0
Table 6-21. PTGD Field Descriptions
Field
Description
3:0
PTGD[3:0]
Port PTG Data Register Bits — For port G pins that are inputs, reads return the logic level on the pin. For port
G pins that are configured as outputs, reads return the last value written to this register.
Writes are latched into all bits of this register. For port G pins that are configured as outputs, the logic level is
driven out the corresponding MCU pin.
Reset forces PTGD to all 0s, but these 0s are not driven out the corresponding pins because reset also
configures all port pins as high-impedance inputs with pullups disabled.
7
R
0
W
Reset
0
6
5
4
3
2
0
0
0
PTGPE3 PTGPE2
0
0
0
0
0
Figure 6-29. Pullup Enable for Port G (PTGPE)
1
PTGPE1
0
0
PTGPE0
0
Table 6-22. PTGPE Field Descriptions
Field
Description
3:0
Pullup Enable for Port G Bits — For port G pins that are inputs, these read/write control bits determine whether
PTGPE[3:0] internal pullup devices are enabled. For port G pins that are configured as outputs, these bits are ignored and
the internal pullup devices are disabled.
0 Internal pullup device disabled.
1 Internal pullup device enabled.
MC9S08GT16A/GT8A Data Sheet, Rev. 1
Freescale Semiconductor
97