English
Language : 

MC68HC08XL36 Datasheet, PDF (277/362 Pages) Freescale Semiconductor, Inc – HCMOS Microcontroller Unit
Freescale Semiconductor, Inc.
Input/Output Ports
Port B
DDRB7–DDRB0 — Data Direction Register B Bits
These read/write bits control port B data direction. Reset clears
DDRB7–DDRB0, configuring all port B pins as inputs.
1 = Corresponding port B pin configured as output
0 = Corresponding port B pin configured as input
NOTE: 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 7 shows the port B I/O logic.
READ DDRB ($0005)
WRITE DDRB ($0005)
RESET
DDRBx
WRITE PORTB ($0001)
PBx
PBx
READ PORTB ($0001)
Figure 7. Port B I/O Circuit
When bit DDRBx is a logic 1, reading address $0001 reads the PBx 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 3 summarizes the operation of
the port B pins.
Table 3. Port B Pin Operation
Data Direction Bit
I/O Pin Mode
0
Input, high-impedance
1
Output
1. Writing affects data register, but does not affect input.
Access to Data Bit
Read
Pin
Write
Latch(1)
Latch
Latch
7-ports_a
MOTOROLA
Input/Output Ports
For More Information On This Product,
Go to: www.freescale.com
MC68HC08XL36
277