This document explains the usage of the KBI (Keyboard Interrupt) function for the SMC SM59R series microcontrollers, including register settings, interrupt…
This application note details the KBI (Keyboard Interrupt) function available in the SMC SM59R series microcontrollers. It covers the specific models supported, the hardware architecture involving eight I/O pins, and the associated registers for configuration and interrupt handling. The document explains how to configure the interrupt enable bits, level selection, and de-bounce mechanisms to handle keyboard inputs or other applications.
The guide provides practical implementation examples using both C and Assembly languages. It includes initialization routines to set up the KBI function, enable interrupts, and configure de-bounce timing. Additionally, it lists the specific interrupt vector address (0x5B) and the interrupt request register flags required to service the KBI interrupt in the main program loop. This manual is written in Chinese.
| Number of KBI I/O pins | 8 |
|---|---|
| Interrupt Vector Address | 0x5B |
| De-bounce time (default) | 320 ms |
| De-bounce time (01 setting) | 160 ms |
| De-bounce time (10 setting) | 80 ms |
| De-bounce time (11 setting) | 40 ms |
The KBI function is supported by models SM59R16A2, SM59R08A2, SM59R16A5, SM59R09A5, SM59R05A5, SM59R16A3, SM59R09A3, SM59R05A3, SM59R04A2, SM59R04A1, SM59R03A1, SM59R02A1, SM59R09A2, SM59R04A1, SM59R03A1, SM59R02A1.
There are 8 independent flags, labeled KBF.0 through KBF.7, corresponding to the 8 I/O pins.
The KBI interrupt flag must be cleared by software after the interrupt service routine is executed.