English
Language : 

MC9S08RG60 Datasheet, PDF (117/232 Pages) Motorola, Inc – Microcontrollers
SoC Guide — MC9S08RG60/D Rev 1.10
8.6.2 Port B Registers (PTBD, PTBPE, and PTBDD)
Port B pins used as general-purpose I/O pins are controlled by the port B data (PTBD), data direction
(PTBDD), and pullup enable (PTBPE) registers.
PTBD
PTBPE
PTBDD
Bit 7
Read:
PTBD7
Write:
Reset: 0
6
PTBD6
0
5
PTBD5
0
4
PTBD4
0
3
PTBD3
0
2
PTBD2
0
1
PTBD1
0
Bit 0
PTBD0
0
Read:
PTBPE7 PTBPE6 PTBPE5 PTBPE4 PTBPE3 PTBPE2 PTBPE1 PTBPE0
Write:
Reset: 0
0
0
0
0
0
0
0
Read:
PTBDD7 PTBDD6 PTBDD5 PTBDD4 PTBDD3 PTBDD2 PTBDD1 PTBDD0
Write:
Reset: 0
0
0
0
0
0
0
0
Figure 8-7 Port B Registers
PTBDn — Port B Data Register Bit n (n = 0–7)
For port B pins that are inputs, reads return the logic level on the pin. For port B pins that are configured
as outputs, reads return the last value written to this register.
Writes are latched into all bits of this register. For port B pins that are configured as outputs, the logic
level is driven out the corresponding MCU pin.
Reset forces PTBD to all 0s, but these 0s are not driven out on the corresponding pins because reset
also configures all port pins as high-impedance inputs with pullups disabled.
PTBPEn — Pullup Enable for Port B Bit n (n = 0–7)
For port B pins that are inputs, these read/write control bits determine whether internal pullup devices
are enabled. For port B pins that are configured as outputs, these bits are ignored and the internal pullup
devices are disabled.
1 = Internal pullup device enabled.
0 = Internal pullup device disabled.
PTBDDn — Data Direction for Port B Bit n (n = 0–7)
These read/write bits control the direction of port B pins and what is read for PTBD reads.
1 = Output driver enabled for port B bit n and PTBD reads return the contents of PTBDn.
0 = Input (output driver disabled) and reads return the pin value.
Freescale Semiconductor
MC9S08RC/RD/RE/RG
117