
Keyboard Interrupt Module (KBI)
MC68HC08KH12A Data Sheet, Rev. 1.1
160
Freescale Semiconductor
15.5.2 Port-F Keyboard Initialization
When a keyboard interrupt pin is enabled, it takes time for the internal pullup to reach a logic 1. Therefore
a false interrupt can occur as soon as the pin is enabled.
To prevent a false interrupt on keyboard initialization:
1.
Mask keyboard interrupts by setting the IMASKF bit in the keyboard status and control register.
2.
Write to DDRFx bits to make the port pin an input pin.
3.
Enable the KBI pins by setting the appropriate KBFIEx bits in the keyboard interrupt enable
register.
4.
Write to the ACKF bit in the keyboard status and control register to clear any false interrupts.
5.
Clear the IMASKF bit.
An interrupt signal on an edge-triggered pin can be acknowledged immediately after enabling the pin. An
interrupt signal on an edge- and level-triggered interrupt pin must be acknowledged after a delay that
depends on the external load.
15.5.3 Port-F Keyboard Interrupt Registers
15.5.3.1 Port-F Keyboard Status and Control Register
Flags keyboard interrupt requests.
Acknowledges keyboard interrupt requests.
Masks keyboard interrupt requests.
Controls keyboard interrupt triggering sensitivity.
Bits [7:4] — Not used
These read-only bits always read as logic 0s.
KEYFF — Port-F Keyboard Flag Bit
This read-only bit is set when a keyboard interrupt is pending on port-F. Reset clears the KEYFF bit.
1 = Keyboard interrupt pending
0 = No keyboard interrupt pending
ACKF — Port-F Keyboard Acknowledge Bit
Writing a logic 1 to this write-only bit clears the keyboard interrupt request on port-F. ACKF always
reads as logic 0. Reset clears ACKF.
IMASKF — Port-F Keyboard Interrupt Mask Bit
Writing a logic 1 to this read/write bit prevents the output of the keyboard interrupt mask from
generating interrupt requests on port-F. Reset clears the IMASKF bit.
1 = Keyboard interrupt requests masked
0 = Keyboard interrupt requests not masked
Address: $0040
Bit 7
6
5
4
3
2
1
Bit 0
Read:
0
0
0
0
KEYFF
0
IMASKF
MODEF
Write:
ACKF
Reset:
0
0
0
0
0
0
0
0
=Unimplemented
Figure 15-9. Port-F Keyboard Status and Control Register (KBFSCR)