Font Size: a A A

Design And Implementation Of RS485 Wireless Wiring System Based On Modbus Protocol

Posted on:2010-11-02Degree:MasterType:Thesis
Country:ChinaCandidate:D LiFull Text:PDF
GTID:2178360272497372Subject:Software engineering
Abstract/Summary:PDF Full Text Request
With the continuous development and improvement of wireless technology,wireless technology has been applied to almost every comer of our society.Because wireless transmission has the advantages that the wire transmission can not compare with such as no need wiring and easy to move,there will be a great convenience when wireless transmission was used to replace the traditional with-wire transmission.Using wire transmission will have many restrictions in wiring. When using wire communications,a data line is needed to connect the two communications devices.However,the implementation of wiring like this is very difficult in many cases,because the data line may need to pass through a very complex environment,for example,high temperature,corrosion,abrasion,etc.Then wiring should bypass these environments or the data lines should put on a variety of "protective clothing." In another case,if a project is needed to be transformed,the position of communications equipment need to be changed,the layout of wiring had to be rescheduled.That is very troublesome,and sometimes it is also very difficult or even impossible to achieve,for example,may encounter the situation mentioned above,or will affect the original layout of the decoration.Therefore,let a portion of wiring become wireless, which is to make the connections using wireless technology in the place where it is difficult to connect using wire.This will greatly improve the flexibility of wiring,and then it can easily cope with a variety of complex environments.RS485-bus communication,with its advantages such as simplicity and flexibility,simple hardware interface,higher Cost-effective and higher transfer distance,low error rate,good anti-interference ability,is widely used in the industrial control,especially in small and medium-sized data acquisition control system.Modbus communication protocol is often within the formation of RS485 networks.Modbus protocol has become a common industry standard, because of its openness,scalability and standardization.Using this protocol,control equipment productions of different vendors can simply and reliably connect to each other,and make up industrial networks,and then can be systematically centralized monitor.This makes it one of the most popular protocols in industrial control industry.RS485/MODBUS is a popular way to make up networks.Basing on RS485/Modbus wiring,this article put forward a wireless wiring solution.In this solution,master-chip MSP430F149,radio frequency chip CC2420 and RS485 interface MAX485 chip were used to form a embedded system - wireless forwarder/receiver.The wireless forwarder/receivers connecting on a part of RS485 bus receive wire data from RS485 bus,and forward the data wirelessly;the wireless forwarder/receivers connecting on other part of RS485 bus receive the wireless data,and forward the data to the RS485,in such way the two part of RS485 bus will connect to each other.The wireless forwarder/receivers on the one hand are transparent to the host PC or device on the RS485 bus,just providing data forwarding services; on the other hand,The wireless forwarder/receivers can check the data and can response to the commands from the host.PC,so the host PC can control the direction of wireless data transmission,and can query the working states of the wireless forwarder/receivers.By controlling the direction of wireless transmission,PC host can decide which wireless forwarder/receivers the data should be send to,which is that the PC can decide a certain part of RS485 bus can connect to which part of RS485 bus.In this way,let a part of the RS485 bus become wireless according to the solution in this article,will not only bring about greater flexibility in wiring,but also allows the host PC to control and manage more devices.Therefore, this article has a great deal of practical significance.In this paper,the main research work and the results is showed in the following aspects:(1) Have put forward a feasible wireless wiring solution.After introducing the shortcomings of traditional wiring and the advantages of wireless transmission,a RS485 wireless wiring solution based on Modbus protocol has been put forward. This solution not only can overcome the problem in traditional wiring but also enable the PC control and management more devices.And the idea used in this solution not only can be used on RS485 wiring,but also can be used on wiring of other kind of data line.(2) Have given out a solution of hardware system.First of all,the requirements of hardware functions have been analyzed.According to the functional requirements,a detailed analysis of the main control chip MSP430F149 and the CC2420 RF chip characteristics and interface have been given out.Finally,the circuits solutions of hardware system have been given out,in which the feasible connection among main control chip MSP430F149,MAX485 chip and CC2420 RF chip have been realized.This make the system can smoothly complete the functions:receiving RS485 wire data,processing this data, and forwarding the data wirelessly;receiving the wireless data,processing the data,and forward the data to RS485 bus.In addition,a reasonable circuit of power supply,the reset circuit,and the circuit of several light-emitting diodes has been given out,which increases the practicality of the system.This set of hardware system is high levels of reuse,can meet a lot of other applications.(3) Have given out a feasible solution of software system.Firstly,a reasonable protocol has been designed for the system.This protocol is gotten by a little expansion based on Modbus protocol,which pave the way for the communication functions such as forwarding data,address binding and so on.Secondly,the method of receiving and sending RS485 wire data is given out.First,the steps of driving MAX485 is given out.And then give out the initialization steps of serial bus mode of main control chip MSP430F149,and set the communication mode to serial asynchronous communication mode.Finally,give out the realization method of receiving and sending wire data,and also give out the data processing methods such as data checking method and data packaging and unpacking method and so on.Finally,the method of receiving and sending the wireless data is given out.First of all, given out the initial steps of serial bus interface module of main control chip,and set the communication module to SPI mode,which was used to control RF chip.And then give out the initial steps of CC2420 RF chip.Finally,receiving and sending wireless data method functions were given out.In the introduction of this solution,not only the working principle of the main control chip and the use method of serial communication module are included,but also include the operation method of CC2420 chip,including the registers access,command strobes access, FIFO buffer access,and data sending and receiving steps.
Keywords/Search Tags:wireless communication, wireless wiring, RS485, Modbus, MSP430
PDF Full Text Request
Related items