NXP microcontrollers (such as Kinetis and LPC series) feature a module related to keyboard input called KBI (Keyboard Interrupt Module), which implements most of its functions that can also be achieved by microcontrollers from other brands. The difference is that the latter consumes more software or hardware resources (besides the MCU), and to highlight versatility, it is not configured as a dedicated module. The KBI is a hardware peripheral specifically designed for keyboard scanning and low-power wake-up. The following describes the features of NXP‘s KBI module.
1. Multi-pin Support
Supports 8 to 16 independent pins (depending on the model), which can be configured in groups (e.g., 2 groups of 8 pins), with each group independently triggering interrupts.
2. Flexible Triggering Methods
Supports rising edge, falling edge, and both edges triggering, configurable through registers (such as KBIxSC).
3. Hardware Debouncing
The chip has a built-in digital filter (based on clock sampling) to eliminate key bounce (10-100μs adjustable), reducing software burden.
4. Low-Power Wake-Up
In low-power modes such as STOP/VLPR, the KBI pin signals can directly wake up the CPU, with a wake-up time of <10μs.
5. Interrupt or Event Triggering
Supports pin state change interrupts, and some models can trigger DMA or timer events (such as S32K series).
The above points are not particularly unique; besides hardware debouncing and event triggering functions, certain ports of Microchip’s PIC16F182X and PIC16F193X also possess these features, making them suitable for key functions. However, KBI is more suitable because this module has hardware enhancements that can save some software and hardware overhead.
Examples of Application Scenarios:
1. Matrix Keyboard Scanning
Hardware Optimization:
Row lines (Rows) are scanned by GPIO output signals.
Column lines (Cols) connect to KBI pins to detect key presses.
Advantages: Only column changes trigger interrupts, the CPU does not need to poll, reducing power consumption by over 90%.
2. Low-Power Device Wake-Up
Applicable Scenarios: Remote controls, IoT sensors.
Performance: Waking from STOP (or SLEEP) mode takes only 2-5μs (compared to software polling solutions of >100μs).
3. Security Monitoring
Emergency buttons and access control signals trigger the highest priority interrupts through KBI.
In summary, by effectively utilizing the KBI module, keyboard interface hardware and software design can be significantly simplified, and system power consumption optimized, making it particularly suitable for battery-powered interactive devices.
If readers wish to learn more, they can visit the link below.
https://www.nxp.com/docs/en/data-sheet/MC68HC908QY4.pdf