XC68HC08KH12 Motorola, XC68HC08KH12 Datasheet - Page 189

no-image

XC68HC08KH12

Manufacturer Part Number
XC68HC08KH12
Description
MICROCONTROLLER
Manufacturer
Motorola
Datasheet
12.4.2 Data Direction Register B (DDRB)
MC68HC(7)08KH12
MOTOROLA
NOTE:
Rev. 1.0
Address:
Data direction register B determines whether each port B pin is an input
or an output. Writing a logic one to a DDRB bit enables the output buffer
for the corresponding port B pin; a logic zero disables the output buffer.
DDRB[7:0] — Data Direction Register B Bits
Avoid glitches on port B pins by writing to the port B data register before
changing data direction register B bits from 0 to 1.
Figure 12-6
Reset:
Read:
Write:
These read/write bits control port B data direction. Reset clears
DDRB[7:0], configuring all port B pins as inputs.
1 = Corresponding port B pin configured as output
0 = Corresponding port B pin configured as input
DDRB7
READ DDRB ($0005)
WRITE DDRB ($0005)
WRITE PTB ($0001)
READ PTB ($0001)
$0005
Bit 7
0
Figure 12-5. Data Direction Register B (DDRB)
shows the port B I/O logic.
DDRB6
6
0
Figure 12-6. Port B I/O Circuit
I/O Ports
RESET
DDRB5
5
0
DDRB4
DDRBx
PTBx
4
0
DDRB3
3
0
DDRB2
2
0
Advance Information
DDRB1
1
0
I/O Ports
DDRB0
Bit 0
Port B
0
PTBx
189

Related parts for XC68HC08KH12