MC908QL4 FREESCALE [Freescale Semiconductor, Inc], MC908QL4 Datasheet - Page 115

no-image

MC908QL4

Manufacturer Part Number
MC908QL4
Description
M68HC08 Microcontrollers
Manufacturer
FREESCALE [Freescale Semiconductor, Inc]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
MC908QL4MDT
Manufacturer:
FREESCALE
Quantity:
10
Part Number:
MC908QL4MDT
Manufacturer:
FREESCALE
Quantity:
20 000
Company:
Part Number:
MC908QL4MDW1
Quantity:
11
12.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 1
to a DDRB bit enables the output buffer for the corresponding port B pin; a 0 disables the output buffer.
DDRB[7:0] — Data Direction Register B Bits
When DDRBx is a 1, reading PTB reads the PTBx data latch. When DDRBx is a 0, reading PTB reads
the logic level on the PTBx pin. The data latch can always be written, regardless of the state of its data
direction bit.
Freescale Semiconductor
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
Reset:
Read:
Write:
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.
port B I/O logic.
READ DDRB
WRITE DDRB
WRITE PTB
READ PTB
DDRB7
Bit 7
0
Figure 12-6. Data Direction Register B (DDRB)
DDRB6
6
0
RESET
Figure 12-7. Port B I/O Circuit
MC68HC908QL4 Data Sheet, Rev. 7
DDRB5
5
0
DDRB4
DDRBx
NOTE
PTBx
4
0
DDRB3
3
0
Figure 12-7
DDRB2
2
0
PTBPUEx
DDRB1
1
0
shows the
PULLUP
DDRB0
Bit 0
PTBx
0
Port B
115

Related parts for MC908QL4