English
Language : 

MC9S08GB60 Datasheet, PDF (145/290 Pages) Motorola, Inc – Microcontrollers
Chapter 9 Keyboard Interrupt (KBI) Module
9.1 Introduction
The MC9S08GB/GT has one KBI module with eight keyboard interrupt inputs that share port A pins. See
Chapter 2, “Pins and Connections” for more information about the logic and hardware aspects of these
pins.
9.1.1 Port A and Keyboard Interrupt Pins
MCU Pin:
PTA7/
KBI1P7
PTA6/ PTA5/ PTA4/ PTA3/
KBI1P6 KBI1P5 KBI1P4 KBI1P3
Figure 9-1. Port A Pin Names
PTA2/
KBI1P2
PTA1/
KBI1P1
PTA0/
KBI1P0
The following paragraphs discuss controlling the keyboard interrupt pins.
Port A is an 8-bit port which is shared among the KBI keyboard interrupt inputs and general-purpose I/O.
The eight KBIPEn control bits in the KBIPE register allow selection of any combination of port A pins to
be assigned as KBI inputs. Any pins which are enabled as KBI 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.
KBI inputs can be configured for edge-only sensitivity or edge-and-level sensitivity. Bits 3 through 0 of
port A are falling-edge/low-level sensitive while bits 7 through 4 can be configured for
rising-edge/high-level or for falling-edge/low-level sensitivity.
The eight PTAPEn control bits in the PTAPE register allow you to select whether an internal pullup device
is enabled on each port A pin that is configured as an input. When any of bits 7 through 4 of port A are
enabled as KBI inputs and are configured to detect rising edges/high levels, the pullup enable bits enable
pulldown rather than pullup devices.
An enabled keyboard interrupt can be used to wake the MCU from wait or standby (stop3).
9.2 Features
The keyboard interrupt (KBI) module features include:
• Keyboard interrupts selectable on eight port pins:
— Four falling-edge/low-level sensitive
— Four falling-edge/low-level or rising-edge/high-level sensitive
— Choice of edge-only or edge-and-level sensitivity
— Common interrupt flag and interrupt enable control
— Capable of waking up the MCU from stop3 or wait mode
MC9S08GB/GT Data Sheet, Rev. 2.3
Freescale Semiconductor
145