摘要
本文通过对标准PS/2键盘协议的分析,用MCS-51单片机模拟键盘通信时序,实现单片机通过PS/2键盘接口与PC机进行数据通信。为此,本文设计了基于MCS-51单片机的模拟键盘模块,应用于条形码扫描系统,将条形码数据转换为键盘扫描码传输到PC机,从而在PC机上获得对应的ASCII码。实验表明了该模拟键盘接口设计具有较高的可行性和通用性。
In this paper, we firstly analyze the standard PS/2 keyboard protocol and the keyboard communication time sequence. To realize data communication between the MCS-51 and PC using the PS/2 keyboard interface, an imitated keyboard module based on MCS-51 is designed and applied in a bar code scanning system. The designed imitated keyboard module converts the bar code data into the keyboard scanning codes, and then sends them to PC, so that the corresponding ASCII codes can be obtained by PC for further processing. Experiment results show the feasibility and popularity of the designed imitated keyboard module.
出处
《中山大学研究生学刊(自然科学与医学版)》
2008年第3期50-61,共12页
Journal of the Graduates Sun YAT-SEN University(Natural Sciences.Medicine)