| Fieldbus has been the most important development trend in the field of process control system. CAN bus application is more and more popular in the world because of its good performance, high reliability, high efficiency, simplicity and low cost. However, the research and development on CAN in China is in the initial stage. In China, most industrial networksuses the interface of RS232or RS485, completing the communication through Modbus protocol or some other simple customized protocol by user. In view of current situation, this paper designs the protocol convertor of Modbus-CANbus by researching on the CAN protocol and Modbus protocol.Mobus-CANbus protocol converter is used to transfer data between RS485bus and CANbus. This converter supports Mobus RTU protocol. Mobus-CANbus protocol converter can easily realize the data transfer between two buses. In this way, it can solve the problem on the connection of different network terminal equipments. This converter provides users with a transparent serial communication protocol. It can directly change the information between two buses and directly embed the original application. It enables system design with a wider range of options and it can reach a more advanced level.Microcontroller C8051F040, CAN controller SJA1000, CAN driver with isolated CTM1050and isolated RS485electrical level conversion chip RSM485CHT are adopted in the hardware circuit of this paper. Based on the hardware circuit, this paper completes the receiving and sending messages of the CAN and Modbus, convert between the two messages.The main functions of the Modbus-CANbus protocol converter are to realize some commands of the Modbus protocol.Such as Modbus protocol3(Read Holding Registers), Modbus protocol6(preset single register), Modbus protocol16(Preset Multiple Registers). These three commands can interchange with CAN message frame (including data frames, remote frame, standard frame, expansion frame). When making communication, user not only can get information of RS485from the CANbus, but also can get CAN information from RS485bus. After debugging, the net designed in this paper is correct, which can complete the basic functions of the Mobus-CANbus protocol converter. |