The LonWorks technique, one of the most popular field bus, has high reliability, security, interaction operation and flexible networking. It has been used in automation field such as industry, building, household, energy, and so on. Connecting the field bus to the Ethernet can meet the shortage such as short transmission distance of LonWorks and achieve remote monitoring. At the same time, it can achieve information integration and integration of management and control.This paper designs and implements an embedded gateway between LonWorks and Ethernet. The gateway, using double CPU technology, uses PL3120 power line smart transceiver as the interface to LonWorks network, and PIC18F66J60 MCU with Ethernet module to Ethernet. The SPI interface is used to realize communication between the two chips. In order to achieve bidirectional communication between the two processor chips, we add a three handshake signals based on general SPI interface. Data transmission between gateway and Ethernet is implemented by transplanting Microchip TCP/IP protocol stack, while communication with the node in the LonWorks network implemented by LonTalk protocol embedded in PL3120.The gateway designed has less chips, simple circuit, small volume, powerful function and low cost. The experiment showed that the embedded gateway could realize the communication between LonWorks network and Ethernet. |