English
Language : 

MC908JL8CDWE Datasheet, PDF (156/212 Pages) Freescale Semiconductor, Inc – Microcontrollers
Input/Output (I/O) Ports
11.3 Port B
Port B is an 8-bit special function port that shares all of its port pins with the analog-to-digital converter
(ADC) module, see Chapter 10
11.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:
Read:
Write:
Reset:
Alternative Functions:
$0001
Bit 7
6
5
4
3
2
PTB7
PTB6
PTB5
PTB4
PTB3
PTB2
ADC7
ADC6
ADC5
Unaffected by reset
ADC4
ADC3
ADC2
Figure 11-7. Port B Data Register (PTB)
1
PTB1
ADC2
Bit 0
PTB0
ADC0
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.
ADC7–ADC0 — ADC channels 7 to 0
ADC7–ADC0 are pins used for the input channels to the analog-to-digital converter module. The
channel select bits, ADCH[4:0], in the ADC status and control register define which port pin will be used
as an ADC input and overrides any control from the port I/O logic. See Chapter 10 Analog-to-Digital
Converter (ADC).
11.3.2 Data Direction Register B (DDRB)
Data direction register B 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.
Address:
Read:
Write:
Reset:
$0005
Bit 7
6
5
4
3
2
1
DDRB7 DDRB6 DDRB5 DDRB4 DDRB3 DDRB2 DDRB1
0
0
0
0
0
0
0
Figure 11-8. Data Direction Register B (DDRB)
Bit 0
DDRB0
0
DDRB[7:0] — Data Direction Register B Bits
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
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 11-9 shows the
port B I/O logic.
MC68HC908JL8/JK8 • MC68HC08JL8/JK8 • MC68HC908KL8 Data Sheet, Rev. 3.1
156
Freescale Semiconductor