
Input/Output (I/O) Ports
Data Sheet
MC68HC08AS32A — Rev. 1
162
Input/Output (I/O) Ports
MOTOROLA
pin. The data latch can always be written, regardless of the state of its data
direction bit.
Table 12-3
summarizes the operation of the port C pins.
12.5 Port D
Port D is an 8-bit special-function I/O port that shares all of its pins with the
analog-to-digital converter (ADC).
12.5.1 Port D Data Register
The port D data register contains a data latch for the seven port D pins.
PTD[6:0] — Port D Data Bits
PTD[6:0] are read/write, software programmable bits. Data direction of PTD[6:0]
pins are under the control of the corresponding bit in data direction register D.
ATD[14:8] — ADC Channel Status Bits
PTD6/ATD14/TCLK–PTD0/ATD8 are seven of the 15 analog-to-digital
converter channels. The ADC channel select bits, CH[4:0], determine whether
the PTD6/ATD14/TCLK–PTD0/ATD8 pins are ADC channels or
general-purpose I/O pins. If an ADC channel is selected and a read of this
Table 12-3. Port C Pin Functions
DDRC
Bit
PTC
Bit
I/O Pin
Mode
Accesses
to DDRC
Accesses to PTC
Read/Write
Read
Write
[7] = 0
PTC2
Input, Hi-Z
DDRC[7]
0
PTC2
[7] = 1
PTC2
Output, MCLK
DDRC[7]
Data Latch
—
0
X
Input, Hi-Z
DDRC[4:0]
Pin
PTC[4:3, 1:0]
(1)
1
X
Output
DDRC[4:0]
PTC[4:0]
PTC[4:3, 1:0]
X = Don’t Care
Hi-Z = High Impedance
1. Writing affects data register, but does not affect input.
Address:
$0003
Bit 7
6
5
4
3
2
1
Bit 0
Read:
0
PTD6
PTD5
PTD4
PTD3
PTD2
PTD1
PTD0
Write:
Reset:
Unaffected by Reset
Alternate
Functions:
ATD14/
TCLK
ATD13
ATD12
ATD11
ATD10
ATD9
ATD8
= Unimplemented
Figure 12-11. Port D Data Register (PTD)
F
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
n
.