English
Language : 

MC68HC08AZ32A Datasheet, PDF (157/312 Pages) Motorola, Inc – HCMOS Microcontroller Unit
Port B
13.3 Port B
Port B is an 8-bit special function port that shares all of its pins with the analog-to- digital converter (ADC).
13.3.1 Port B Data Register (PTB)
The port B data register contains a data latch for each of the eight port B pins.
Address: $0001
Bit 7
Read:
PTB7
Write:
Reset:
Alternative Functions: ATD7
6
PTB6
ATD6
5
PTB5
ATD5
4
3
PTB4
PTB3
Unaffected by reset
ATD4
ATD3
2
PTB2
ATD2
1
PTB1
ATD1
Bit 0
PTB0
ATD0
Figure 13-5. Port B Data Register (PTB)
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.
ATD[7:0] — ADC Channels
NOTE
PTB7/ATD7–PTB0/ATD0 are eight of the analog-to-digital converter (ADC)
channels. The ADC channel select bits, CH[4:0], determine whether the
PTB7/ATD7–PTB0/ATD0 pins are ADC channels or general-purpose I/O
pins. If an ADC channel is selected and a read of the corresponding bit in
the port B data register occurs, the data will be 0 if the data direction for this
bit is programmed as an input. Otherwise, the data will reflect the value in
the data latch. Data direction register B (DDRB) does not affect the data
direction of the port B pins that are being used by the ADC. However, the
DDRB bits always determine whether reading port B returns the states of
the latches or a 0.
13.3.2 Data Direction Register B (DDRB)
Data direction register B determines whether each port B pin is an input or an output. Writing 1 to a DDRB
bit enables the output buffer for the corresponding port B pin; a 0 disables the output buffer.
Address: $0005
Bit 7
6
5
4
3
2
1
Read:
Write:
Reset:
DDRB7
0
DDRB6
0
DDRB5
0
DDRB4
0
DDRB3
0
DDRB2
0
DDRB1
0
Figure 13-6. Data Direction Register B (DDRB)
Bit 0
DDRB0
0
MC68HC08AZ32A Data Sheet, Rev. 2
Freescale Semiconductor
157