Input/Output (I/O) Ports (PORTS)
Figure 10-7 shows the port B I/O logic.
READ DDRB ($0005)
WRITE DDRB ($0005)
DDRBx
PTBx
RESET
WRITE PTB ($0001)
READ PTB ($0001)
PTBx
Figure 10-7. Port B I/O Circuit
When bit DDRBx is a logic 1, reading address $0001 reads the PTBx data latch.
When bit DDRBx is a logic 0, reading address $0001 reads the voltage level on the
pin. The data latch can always be written, regardless of the state of its data
direction bit. Table 10-2 summarizes the operation of the port B pins.
Table 10-2. Port B Pin Functions
Accesses
Accesses to PTB
DDRB
Bit
to DDRB
Read/Write
DDRB[7:0]
DDRB[7:0]
PTB Bit
I/O Pin Mode
Read
Pin
Write
X(1)
X
Input, Hi-Z(2)
Output
PTB[7:0](3)
PTB[7:0]
0
1
PTB[7:0]
1. X = don’t care
2. Hi-Z = high impedance
3. Writing affects data register, but does not affect input.
Data Sheet
116
MC68HC908MR32 • MC68HC908MR16 — Rev. 6.0
Input/Output (I/O) Ports (PORTS) MOTOROLA