Datasheet

Table Of Contents
Port G
MC68HC908GR60A • MC68HC908GR48A • MC68HC908GR32A Data Sheet, Rev. 5
Freescale Semiconductor 149
12.9 Port G
Port G is an 8-bit special-function port that shares all eight of its pins with the analog-to-digital converter
(ADC) module.
12.9.1 Port G Data Register
The port G data register (PTG) contains a data latch for each of the eight port pins.
PTG7–PTG0 — Port G Data Bits
These read/write bits are software-programmable. Data direction of each port G pin is under the control
of the corresponding bit in data direction register G. Reset has no effect on port G data.
AD23–AD16 — Analog-to-Digital Input Bits
AD23–AD16 are pins used for the input channels to the analog-to-digital converter module. The
channel select bits in the ADC status and control register define which port G pin will be used as an
ADC input and overrides any control from the port I/O logic by forcing that pin as the input to the analog
circuitry.
NOTE
Care must be taken when reading port G while applying analog voltages to
AD23–AD16 pins. If the appropriate ADC channel is not enabled, excessive
current drain may occur if analog voltages are applied to the PTGx/ADx pin,
while PTG is read as a digital input during the CPU read cycle. Those ports
not selected as analog input channels are considered digital I/O ports.
Table 12-7. Port F Pin Functions
DDRF
Bit
PTF
Bit
I/O Pin
Mode
Accesses to DDRF Accesses to PTF
Read/Write Read WritE
0
X
(1)
1. X = Don’t care
Input, Hi-Z
(2)
2. Hi-Z = High impedance
DDRF7–DDRF0 Pin
PTF7–PTF0
(3)
3. Writing affects data register, but does not affect input.
1 X Output DDRF7–DDRF0 PTF7–PTF0 PTF7–PTF0
Address: $0441
Bit 7654321Bit 0
Read:
PTG7 PTG6 PTG5 PTG4 PTG3 PTG2 PTG1 PTG0
Write:
Reset: Unaffected by reset
Alternate Function: AD23 AD22 AD21 AD20 AD19 AD18 AD17 AD16
Figure 12-23. Port G Data Register (PTG)