design and implementation of communication between mt500 serial touch screen and microcontroller
gan zhaohui, tong yun, hu xi
(information science & engineering institute, wuhan university of sci ence and
technology, wuhan 430081, china)
abstract:the basic thought and method of implementation of comm unication between microcontroller and mt500 serial touch screen were introduced. the hardware design and software programming were described.
key words:touch screen; microcontroller; communication; protoco l
1系统硬件设计
mt500系列触摸屏不能和单片机直接进行通讯,但是它提供了串行通讯接口及主从通信协议和其他设备通讯。主—从通信有两种接线方式,一种是一对一接线方式,另一种是一对多接线方式。由于篇幅的原因,下面只介绍一对一接线方式,一对多接线方式请参阅easybuilder500使用手册。
一对一接线方式如图1所示,接线图如图2。


mt500系列触摸屏上有二个d型接口:pc[rs-232]和plc[rs-232]口。pc[rs-232]口一般连接到计算机。mt5pc是电缆连接线,pc[rs-232]和plc[rs-485]共用一个c om口;在调试过程中建议使用mt5pc电缆连接线,该连接线把共用的com口分成两个独立的com口使用。mt500上的plc[rs-485]或plc[rs-232]口可连接到plc。
2系统软件设计
单片机通过主从协议和mt500系列触摸屏进行通讯。
下面是一对一接线方式通信协议的读写命令表。




mt500系列触摸屏的读写发送命令基本相似,发送命令中所有的位置都必须采用ascii码方式;mt500系列触摸屏和单片机的通讯方式为:9600波特率、1位起始位、8位数据位、无校验、1位停止位。下面给出的是mcs51系列单片机与mt500系列触摸屏通讯的读、写子程序。






3结束语
本文提出的方法已经在实际项目中应用,单片机采集的现场数据上传到mt500系列触摸屏上进行显示,单片机与mt500系列触摸屏之间的通讯十分稳定可靠,取得了令人满意的效果。本文提出的方法稍加修改就可以用于其他单片机和mt500系列触摸屏以及其他系列触摸屏的通讯连接,为系统集成提供了一个新的方法和思路。
参考文献
[1]甘朝晖,张震.计算机与松下fp1系列可编程控制器的通信[j].电气自动化,2002,(5):43-44.
[2]easybuilder500使用手册[z].eview hmitek公司,2002.