English
Language : 

MC68HC908EY16 Datasheet, PDF (120/278 Pages) Motorola, Inc – Microcontrollers
Input/Output (I/O) Ports (PORTS)
DDRC[4:0] — Data Direction Register C Bits
These read/write bits control port C data direction. Reset clears DDRC[4:0] and MCLKEN, configuring
all port C pins as inputs.
1 = Corresponding port C pin configured as output
0 = Corresponding port C pin configured as input
NOTE
Avoid glitches on port C pins by writing to the port C data register before
changing data direction register C bits from 0 to 1.
Figure 12-9 shows the port C I/O logic.
READ DDRC ($0006)
WRITE DDRC ($0006)
RESET
WRITE PTC ($0002)
DDRCx
PTCx
PTCx
READ PTC ($0002)
Figure 12-9. Port C I/O Circuit
When bit DDRCx is a 1, reading address $0002 reads the PTCx data latch. When bit DDRCx is a 0,
reading address $0002 reads the voltage level on the 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.
Table 12-3. Port C Pin Functions
DDRC
Bit
PTC
Bit
I/O Pin
Mode
Accesses to DDRC
Read/Write
0
2
Input, Hi-Z
DDRC[7]
1
2
Output
DDRC[7]
0
X
Input, Hi-Z
DDRC[4:0]
1
X
Output
DDRC[4:0]
X = don’t care
Hi-Z = high impedance
1. Writing affects data register, but does not affect input.
Accesses to PTC
Read
Write
Pin
PTC2
0
—
Pin
PTC[4:0](1)
PTC[4:0]
PTC[4:0]
12.5 Port D
Port D is a 2-bit special function port that shares its pins with the timer interface module (TIMA).
12.5.1 Port D Data Register
The port D data register contains a data latch for each of the two port D pins.
MC68HC908EY16 • MC68HC908EY8 Data Sheet, Rev. 10
120
Freescale Semiconductor