文件名称:c51jing
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [WORD]
- 上传时间:
- 2012-11-26
- 文件大小:
- 4kb
- 下载次数:
- 0次
- 提 供 者:
- j*
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
实现pc机键盘(p/s2接口)与8位单片机连接使用
原理:键盘时钟接在p3.2口,既8051的外部中断int0上,键盘数据接到p1.0上
每次按键,键盘会向单片机发脉冲使单片机发生外部中断,数据有p1.0口一位一位传进来
传回的数据格式为:1位开始位(0),8位数据位(所按按键的通码,用来识别按键),1位校验位(奇校验)
1位结束位(1)
实现:将键盘发回的数据放到一个缓冲区里(数组),当按键结束后发生内部中断来处理所按的按键
缺点:由于51单片机的容量有限所以缓冲区不可以开的太大,这就导致可以记录键盘的按键次数过少,
也就是容错性一般。不过如果正常使用键盘是不会出错的
-achieve PCs keyboard (p/s2 Interface) with 8-bit microcontroller connectivity principles : Then in the keyboard clock p3.2 mouth, both of 8051 int0 external interrupts, p1.0 keyboard data received on each button, the keyboard will be made to pulse so SCM SCM external interrupt occurred, data p1.0 I come in a one-to-data formats : a starting place (0), 8 data bits (which keys on the general code, used to identify keys), a parity bit (odd check) at the end of one (1) To achieve : keyboard will be sent back data in a buffer (the array) When the button after internal disruption to address shortcomings on the button : As the 51 SCM buffer capacity is limited not so much open, This has led to record the number of keys of the keyboard is too small, that is fault-tolerant general. However, if the
原理:键盘时钟接在p3.2口,既8051的外部中断int0上,键盘数据接到p1.0上
每次按键,键盘会向单片机发脉冲使单片机发生外部中断,数据有p1.0口一位一位传进来
传回的数据格式为:1位开始位(0),8位数据位(所按按键的通码,用来识别按键),1位校验位(奇校验)
1位结束位(1)
实现:将键盘发回的数据放到一个缓冲区里(数组),当按键结束后发生内部中断来处理所按的按键
缺点:由于51单片机的容量有限所以缓冲区不可以开的太大,这就导致可以记录键盘的按键次数过少,
也就是容错性一般。不过如果正常使用键盘是不会出错的
-achieve PCs keyboard (p/s2 Interface) with 8-bit microcontroller connectivity principles : Then in the keyboard clock p3.2 mouth, both of 8051 int0 external interrupts, p1.0 keyboard data received on each button, the keyboard will be made to pulse so SCM SCM external interrupt occurred, data p1.0 I come in a one-to-data formats : a starting place (0), 8 data bits (which keys on the general code, used to identify keys), a parity bit (odd check) at the end of one (1) To achieve : keyboard will be sent back data in a buffer (the array) When the button after internal disruption to address shortcomings on the button : As the 51 SCM buffer capacity is limited not so much open, This has led to record the number of keys of the keyboard is too small, that is fault-tolerant general. However, if the
(系统自动生成,下载前可以参看下载内容)
下载文件列表
c51jing.doc