MC9S08RC/RD/RE/RG Data Sheet, Rev. 1.11
Freescale Semiconductor
123
Chapter 9
Keyboard Interrupt (S08KBIV1)
The MC9S08RC/RD/RE/RG has two KBI modules. One has eight keyboard interrupt inputs that share
port A pins. The other KBI module has four inputs that are shared on the upper four pins of port C. See the
Pins and Connections chapter for more information about the logic and hardware aspects of these pins.
Port A is an 8-bit port that is shared between the KBI1 keyboard interrupt inputs and general-purpose I/O.
The eight KBI1PEn control bits in the KBI1PE register allow selection of any combination of port A pins
to be assigned as KBI1 inputs. Any pins that are enabled as KBI1 inputs will be forced to act as inputs and
the remaining port A pins are available as general-purpose I/O pins controlled by the port A data (PTAD),
data direction (PTADD) and pullup enable (PTAPE) registers. The eight PTAPEn control bits in the
PTAPE register allow the user to select whether an internal pullup device is enabled on each port A pin
that is congured as a port input or a KBI1 input.
KBI1 inputs can be congured for edge-only sensitivity or edge-and-level sensitivity. Bits 3 through 0 of
port A are falling-edge/low-level sensitive and bits 7 through 4 can be congured for
rising-edge/high-level or for falling-edge/low-level sensitivity.
Port C is an 8-bit port with its lower four pins shared between the KBI2 keyboard interrupt inputs and
general-purpose I/O. The four KBI2PEn control bits in the KBI2PE register allow selection of any
combination of the lower four port C pins to be assigned as KBI2 inputs. Any pins that are enabled as KBI2
inputs will be forced to act as inputs and the remaining port C pins are available as general-purpose I/O
pins controlled by the port C data (PTCD), data direction (PTCDD) and pullup enable (PTCPE) registers.
The eight PTCPEn control bits in the PTCPE register allow the user to select whether an internal pullup
device is enabled on each port C pin that is congured as a port input or a KBI2 input.
Any enabled keyboard interrupt can be used to wake the MCU from wait, standby (stop3), partial
power-down (stop2) or power-down modes (stop1). In either stop1 or stop2 mode, an input functions as a
falling edge/low-level wakeup, therefore it should be congured to use falling-edge sensing if the MCU
will be used in stop1 or stop2 modes.
Either KBI1 or KBI2 can be used to wake the MCU from wait or standby (stop3). Only KBI1 can be used
to wake the MCU from partial power down (stop2) or power down (stop1). When using KBI1 to wake up
from stop2 or stop1, the pins must be congured to use falling-edge/low-level sensing (KBEDG = 0). The
KBF bits for both KBI modules must be cleared before entering stop mode, regardless of whether the
interrupt is enabled.
NOTE
The voltage measured on the pulled up PTA0 pin will be less than VDD. The
internal gates connected to this pin are pulled all the way to VDD. All other
pins with enabled pullup resistors will have an unloaded measurement of
VDD.