Input/Output (I/O) Ports
MC68HC08KH12A Data Sheet, Rev. 1.1
138
Freescale Semiconductor
12.7 Port F
Port F is an 8-bit general-purpose bidirectional I/O port that shares its pins with the keyboard interrupt
module (KBI). All Port F pins have built-in schmitt triggered input and software configurable pull-up.
12.7.1 Port F Data Register (PTF)
The port F data register contains a data latch for each of the eight port F pins.
PTF[7:0] — Port F Data Bits
These read/write bits are software programmable. Data direction of each port F pin is under the control
of the corresponding bit in data direction register F. Reset has no effect on port F data.
The port-F keyboard interrupt enable bits, KBFIE7—KBFIE0, in the port-F keyboard interrupt enable
register (KBFIER), enable the port F pins as external interrupt pins. See
Chapter 15 Keyboard Interrupt
Module (KBI)
.
The PFPE[7:0] bits in the port F keyboard pull-up enable register enable individual pull-ups on port F pins
if the respective pin is configured as an input. (See
15.5.3.3 Port-F Pull-up Enable Register
.)
12.7.2 Data Direction Register F (DDRF)
Data direction register F determines whether each port F pin is an input or an output. Writing a logic one
to a DDRF bit enables the output buffer for the corresponding port F pin; a logic zero disables the output
buffer.
DDRF[7:0] — Data Direction Register F Bits
These read/write bits control port F data direction. Reset clears DDRF[7:0], configuring all port F pins
as inputs.
1 = Corresponding port F pin configured as output
0 = Corresponding port F pin configured as input
NOTE
Avoid glitches on port F pins by writing to the port F data register before
changing data direction register F bits from 0 to 1.
Address: $0009
Bit 7
6
5
4
3
2
1
Bit 0
Read:
PTF7
PTF6
PTF5
PTF4
PTF3
PTF2
PTF1
PTF0
Write:
Reset:
Unaffected by reset
Alternate Function:
KBF7
KBF6
KBF5
KBF4
KBF3
KBF2
KBF1
KBF0
Figure 12-19. Port F Data Register (PTF)
Address: $000B
Bit 7
6
5
4
3
2
1
Bit 0
Read:
DDRF7
DDRF6
DDRF5
DDRF4
DDRF3
DDRF2
DDRF1
DDRF0
Write:
Reset:
0
0
0
0
0
0
0
0
Figure 12-20. Data Direction Register F (DDRF)