Advance Information MC68HC908MR16/MC68HC908MR32 — Rev. 4.0
312 Input/Output (I/O) Ports MOTOROLA
Input/Output (I/O) Ports
15.4 Port B
Port B is an 8-bit, general-purpose, bidirectional I/O port that shares its
pins with the analog-to-digital convertor (ADC) module.
15.4.1 Port B Data Register
The port B data register (PTB) contains a data latch fo r each of the eigh t
port B pins.
PTB[7:0] — Port B Data Bits
These read/write bits are software-programmable. Data direction of
each port B pin is under the control of the corresponding bit in data
direction register B. Reset has no effect on port B data.
15.4.2 Data Direction Register B
Data direction register B (DDRB) determines whethe r each po rt B pin is
an input or an output. Writing a logic 1 to a D DRB bit enable s the out put
buffer for the corresponding port B pin; a logic 0 disables the output
buffer.
Address: $0001
Bit 7654321Bit 0
Read: PTB7 PTB6 PTB5 PTB4 PTB3 PTB2 PTB1 PTB0
Write:
Reset: Unaffected by reset
Figure 15-5. Port B Data Register (PTB)
Address: $0005
Bit 7654321Bit 0
Read: DDRB7 DDRB6 DDRB5 DDRB4 DDRB3 DDRB2 DDRB1 DDRB0
Write:
Reset:00000000
Figure 15-6. Data Direction Register B (DDRB)