摘要
在利用单片机和无线数传模块进行无线数据通信时 ,通常的办法是通过单片机的串行I/O口来完成数据的串行通信。然而此方法存在许多不足之处 ,如差错检测能力差、帧格式不灵活等。针对低速通信的场合 ,提出了一种通过单片机和无线数传模块以软件方式实现对传输数据编码、解码的原理和方法。数据的编码采用了曼彻斯特编码格式 ,每帧数据包括同步头、有效数据位和冗余校验位三部分。解码包括同步头和数据位的判定及循环冗余校验。在数据位的判定中提出了用软件实现“测三取二”的判定方法。该判定方法不但可以提高采样的准确度 ,而且还具有一定的滤波功能。实验结果表明 ,与单片机的串口通信相比 ,该编解码方法具有抗干扰能力强。
When utilizing single-chip microcomputer and wireless data-transmission module to implement wireless data communication, single-chip microcomputer's serial I/O port is usually used to realize serial data communication. However, there are many shortcomings in it, such as that its ability in checking error is poor and the form of frame is not flexible and so on. A kind of data coding-decoding theory and method ,by using software in single-chip computer and communication module ,was proposed for low-speed communication situations . Manchester code was used in data coding, each frame of data included synchronous head, valid data bits and cyclic redundancy parity bits. Decoding process included synchronous head, data bits determination and CRC checking. In data bits determination, a method to realize 'drawing two from measured three' by software was put forward. This method can not only improve sampling accuracy but also filter noise. The results of experiments show that compared with serial I/O port communication of single-chip microcomputer, this kind of coding-decoding method has many advantages such as strong anti-interference ability and data communication flexibility etc.
出处
《抚顺石油学院学报》
2002年第3期59-62,共4页
Journal of Fushun Petroleum Institute