
Keyboard Interrupt Module (KBI)
MC68HC08KH12A Data Sheet, Rev. 1.1
156
Freescale Semiconductor
15.4.2 Port-E 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 IMASKE bit in the keyboard status and control register.
2.
Write to DDREx bits to make port pin an input pin.
3.
Enable the KBI pins by setting the appropriate KBEIEx bits in the keyboard interrupt enable
register.
4.
Write to the ACKE bit in the keyboard status and control register to clear any false interrupts.
5.
Clear the IMASKE 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.4.3 Port-E Keyboard Interrupt Registers
15.4.3.1 Port-E 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.
KEYEF — Port-E Keyboard Flag Bit
This read-only bit is set when a keyboard interrupt is pending on port-E. Reset clears the KEYEF bit.
1 = Keyboard interrupt pending
0 = No keyboard interrupt pending
ACKE — Port-E Keyboard Acknowledge Bit
Writing a logic 1 to this write-only bit clears the keyboard interrupt request on port-E. ACKE always
reads as logic 0. Reset clears ACKE.
IMASKE — Port-E 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-E. Reset clears the IMASKE bit.
1 = Keyboard interrupt requests masked
0 = Keyboard interrupt requests not masked
Address: $000E
Bit 7
6
5
4
3
2
1
Bit 0
Read:
0
0
0
0
KEYEF
0
IMASKE
MODEE
Write:
ACKE
Reset:
0
0
0
0
0
0
0
0
=Unimplemented
Figure 15-6. Port-E Keyboard Status and Control Register (KBESCR)