摘要
为了在不增加CPU工作负担的前提下,实现标准键盘和矩阵键盘双键盘同时工作,提出了一种基于复杂可编逻辑器件(CPLD)的矩阵键盘扫描方案,实现了在矩阵键盘状态控制下CPLD自动完成键盘扫描、编码、输出的功能,CPU通过定时器中断服务程序定时查询矩阵键盘状态,并将按键值直接送入键盘缓冲区,供其他程序使用。给出了CPLD部分模块的VHDL语言实现和仿真波形。在矩阵键盘的扫描、编码、输出完全不需CPU控制的前提下,实现标准键盘和矩阵键盘双键盘同时使用。
In order to have the advantages of using standard keyboard and the matrix keyboard simultaneously and reducing the CPU workloads, a new keyboard scanning method based on CPLD is proposed, under the control of the keyboard states, the function of the matrix keyboard automatically scan code and output based on CPLD are implemented, CPU checks the matrix keyboard status through the timer interrupt service routine and sends the key value into the keyboard buffer directly for other program using. All of modules in the design are programmed and simulated by VHDL language. This design has the advantages of using standard keyboard and the matrix keyboard simultaneously and reducing the CPU workloads on the premise of keyboard scanning, coding and output without CPU control.
出处
《电子设计工程》
2010年第10期169-175,共7页
Electronic Design Engineering