Motorola MC68HC908MR32 사용자 설명서
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.
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 for each of the eight
port B pins.
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.
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 whether each port B pin is
an input or an output. Writing a logic 1 to a DDRB bit enables the output
buffer for the corresponding port B pin; a logic 0 disables the output
buffer.
an input or an output. Writing a logic 1 to a DDRB bit enables the output
buffer for the corresponding port B pin; a logic 0 disables the output
buffer.
Address:
$0001
Bit 7
6
5
4
3
2
1
Bit 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 7
6
5
4
3
2
1
Bit 0
Read:
DDRB7
DDRB6
DDRB5
DDRB4
DDRB3
DDRB2
DDRB1
DDRB0
Write:
Reset:
0
0
0
0
0
0
0
0
Figure 15-6. Data Direction Register B (DDRB)