Input/Output (I/O) Ports
Technical Data MC68HC908AB32 — Rev. 1.0
336 Input/Output (I/O) Ports MOTOROLA
DDRH[1:0] — Data Direction Register H Bits
These read/write bits control port H data direction. Reset clears
DDRH[1:0], configuring all port H pins as inputs.
1 = Corresponding port H pin configured as output
0 = Corresponding port H pin configured as input
NOTE:
Avoid glitches on port H pins by writing to the port H data register before
changing data direction register H bits from 0 to 1. Figure 17-27 shows
the port H I/O logic.
Figure 17-27. Port H I/O Circuit
When DDRHx is a logic 1, reading address $000B reads the PTHx data
latch. When DDRHx is a logic 0, reading address $000B reads the
voltage level on the pin. The data latch can always be written, regardless
of the state of its data direction bit.
Table 17-6 summarizes the operation of the port H pins.
Address: $000F
Bit 7 654321Bit 0
Read: 0 00000
DDRH1 DDRH0
Write:
Reset: 0 0000000
Figure 17-26. Data Direction Register H (DDRH)
READ DDRH ($000F)
WRITE DDRH ($000F)
RESET
WRITE PTH ($000B)
READ PTH ($000B)
PTHx
DDRHx
PTHx
INTERNAL DATA BUS
KBI