摘要
1—WIRE总线是利用一根数据线进行双向数据传输的通信协议。一般的设备或控制器都不带有1—WIRE接口,因此设计了一个接口电路,利用PC机串行口,以电平转换芯片MAX233A将232电平转换成TTL电平,连接RS232串行口与1—WIRE总线,并且采用直接从串口取电的方法为整个电路供电,以简化硬件电路;在软件上采用波形模拟的方法,即通过改变串行通信的波特率与数据位个数来输出不同宽度的脉冲,达到利用串行口输出与1-WIRE总线要求一致的操作时隙,驱动1-WIRE总线设备进行通信。最后编写了最基本的一些驱动程序。此设计为不同通信协议的转换提供了新的思路。
1—WIRE Bus has a single data line which can communicate with a microprocessor, but microprocessor usually don′t have 1WIRE interface. This paper introduces an interface based on PC UART and MAX233A which converted RS 232 voltage to TTL voltage, and the interface gets the power directly from PC UART so that simplified the whole electric circuit. Beside the circuit, the software adopts the wave simulation to communication, which changes rate and the number of data bits to get different width waveformsas same as 1—wire′s time slot, and sends out this waveforms. At last, the paper gives out some basic program as the example. The design offers a new method of changing different communication agreement.
出处
《现代电子技术》
2005年第14期8-9,12,共3页
Modern Electronics Technique
基金
南京信息工程大学学校青年科研基金资助