![ROHS MC9S08QE128 Reference Manual Download Page 143](http://html1.mh-extra.com/html/rohs/mc9s08qe128/mc9s08qe128_reference-manual_1478520143.webp)
Chapter 7 Keyboard Interrupt (S08KBIV2)
MC9S08QE128 MCU Series Reference Manual, Rev. 2
Freescale Semiconductor
143
edge is detected when the input signal is seen as a logic 0 during one bus cycle and then a logic 1 during
the next cycle.
7.4.1
Edge Only Sensitivity
A valid edge on an enabled port pin will set KBF in KBIxSC. If KBIE in KBIxSC is set, an interrupt
request will be presented to the CPU. Clearing of KBF is accomplished by writing a 1 to KBACK in
KBIxSC.
7.4.2
Edge and Level Sensitivity
A valid edge or level on an enabled port pin will set KBF in KBIxSC. If KBIE in KBIxSC is set, an
interrupt request will be presented to the CPU. Clearing of KBF is accomplished by writing a 1 to KBACK
in KBIxSC provided all enabled port inputs are at their deasserted levels. KBF will remain set if any
enabled port pin is asserted while attempting to clear by writing a 1 to KBACK.
7.4.3
Pull-Up/Pull-Down Resistors
The keyboard interrupt pins can be configured to use an internal pull-up/pull-down resistor using the
associated I/O port pull-up enable register. If an internal resistor is enabled, the KBIxES register is used to
select whether the resistor is a pull-up (KBEDGn = 0) or a pull-down (KBEDGn = 1).
7.4.4
Keyboard Interrupt Initialization
When an interrupt pin is first enabled, it is possible to get a false interrupt flag. To prevent a false interrupt
request during pin interrupt initialization, the user should do the following:
1. Mask interrupts by clearing KBIE in KBIxSC.
2. Select the pin polarity by setting the appropriate KBEDGn bits in KBIxES.
3. If using internal pull-up/pull-down device, configure the associated pull enable bits in KBIxPE.
4. Enable the interrupt pins by setting the appropriate KBIPEn bits in KBIxPE.
5. Write to KBACK in KBIxSC to clear any false interrupts.
6. Set KBIE in KBIxSC to enable interrupts.
Summary of Contents for MC9S08QE128
Page 2: ......
Page 4: ......
Page 320: ...Development Support MC9S08QE128 MCU Series Reference Manual Rev 2 320 Freescale Semiconductor ...