“Industrial wireless communication technology is another industry research hotspot in the field of industrial automation after industrial Ethernet and industrial fieldbus technology. At present, the application of multi-standard and multi-protocol coexistence is increasing, and the gateway that acts as a protocol conversion bridge plays a key role. The two most popular local wireless technologies are undoubtedly Wi-Fi and Bluetooth. For control applications, such as sensor networks in factories, ZigBee may be a better choice. Equipped with a powerful processor, ZigBee can efficiently complete many complex applications under the constraints of low power consumption and low bandwidth.
Industrial wireless communication technology is another industry research hotspot in the field of industrial automation after industrial Ethernet and industrial fieldbus technology. At present, the application of multi-standard and multi-protocol coexistence is increasing, and the gateway that acts as a protocol conversion bridge plays a key role. The two most popular local wireless technologies are undoubtedly Wi-Fi and Bluetooth. For control applications, such as sensor networks in factories, ZigBee may be a better choice. Equipped with a powerful processor, ZigBee can efficiently complete many complex applications under the constraints of low power consumption and low bandwidth.
ZigBee has become one of the most concerned technologies in industrial wireless communication technology due to its low cost, low power consumption, flexible networking and many other advantages. ZigBee is a low-speed network with a transmission speed of 10KB/S to 250KB/S. Various interconnection methods make the networking method flexible and robust.
This article introduces a ZigBee industrial Ethernet gateway design based on AT91SAM9260, which realizes a transparent access between ZigBee and industrial Ethernet. The upper layer adopts the ZigBee protocol, which is applied to the Ethernet for short-distance wireless control, monitoring, and data transmission in industrial sites. Protocol conversion, and embedded WebServer to realize remote monitoring and remote data exchange system application block diagram of field instrument is shown in Figure 1. Users can directly access or modify instrument data through the embedded WebServer of ZigBee Ethernet gateway to realize remote monitoring of field instruments. Monitoring, remote diagnosis, etc. When the gateway is connected to GPRS or the Internet, you can access the data of industrial field instruments at any time no matter where you are, and realize the functions of remote configuration, remote diagnosis and remote operation of field instruments, so that the world’s Different sensor monitoring networks can share information.
1 Hardware Design
The gateway hardware is shown in Figure 2. The system takes AT91SAM9260 as the core. AT91SAM9260 is a high-performance ARM9 processor from ATMEL, with a main frequency of up to 200M, with Ethernet MAC, and extended Ethernet PHY module, ZigBee wireless communication module, Nand FLASH and SDRAM . In the picture, K9F2G08 is 256M Nand FLASH, and HY57V64162 is 64M SDRAM, which are directly connected with the address line, data line, chip select line, and read-write line of AT91SAM9260 without decoding.
DM9161 is an Ethernet PHY chip, 10M/100M compatible, and realizes Ethernet physical layer. CC2520 is TI’s second-generation ZigBee/IEEE 802.15.4 RF transceiver, with the best selectivity/coexistence and excellent performance in the industry today. Link budget function features, the goal is to meet the requirements of ZigBee/IEEE 802.15.4 and proprietary wireless systems in various applications, and provides extensive hardware support, including packet processing, data buffering, burst transmission, data encryption, data Authentication, idle channel evaluation, link quality indication and data packet timing information, etc., and data communication and control with AT91SAM9260 through SPI.
2 Software Design
The gateway software adopts embedded Linux-2.6.28 kernel, and adds ZigBee service in the upper layer application to realize the conversion between ZigBee and Ethernet protocol. Ethernet data packets are received through the UDP port, the frame header and tail are removed, the Zigbee short address is attached, and sent to CC2520 through the serial port, encapsulated as ZigBee packets. Address, append UDP frame header and footer, and then forwarded by the Ethernet port. The software design architecture is shown in Figure 3.
The software execution flow chart is shown in Figure 4. The underlying hardware initialization includes clock settings, GPIO management, serial port configuration, Ethernet interface MII configuration, and PHY chip settings, etc. Then the initial configuration of CC2520 wireless communication module conforms to ZigBee Protocol standard, after CC2520 is initialized and set, the module can realize transparent serial port transmission and carry out data exchange with ARM processor. In order to adapt to the development trend of short frame real-time and deterministic communication, Ethernet communication adopts UDP/IP protocol to start linux kernel multi-task scheduling management, and performs tasks such as serial port data transmission and reception, UDP reception and transmission, and embedded WebServer.
3 ZigBee and Ethernet protocol conversion software design
The TCP/IP protocol uses the MAC address to identify the hardware address and uses the ARP protocol to resolve the hardware address to the IP address. Therefore, the conversion from ZigBee to ARP address must be completed to ensure normal communication. Each node in ZigBee has its own MAC address. The format is composed of a 64-bit long address and a 16-bit short address. The article designs and implements the adaptation layer and ARP in the ZigBee protocol, and completes the mapping of the MAC address to the Ethernet IP address in ZigBee. The flow chart is shown in Figure 5. When the gateway receives a After the Ethernet data packet sent to the local IP normally, it is sent to the upper layer UDP (TCP) after the protocol judgment. Finally, the application program to the gateway processes the gateway application program after analysis and judgment to determine which node in the ZigBee network needs to be forwarded. The ARP address on the ZigBee side parses out the corresponding node MAC address in ZigBee, and sends the corresponding data packet to the node to complete a data communication.
Similarly, when ZigBee end receives the data packet, it will send the data packet to the corresponding node or device through the same analysis. Through the embedded WebServer, users can realize real-time access, modification and configuration of ZigBee node.
This article designs and develops an embedded ZigBee Ethernet gateway based on the AT91SAM9260 processor, which is used in the monitoring and control of physical quantities such as pressure, temperature, and flow in wireless communication. The data of field instruments can be accessed or modified at any time through Ethernet to realize remote control and remote diagnosis. More complex wireless applications have laid the foundation. Field applications show that the ZigBee Ethernet gateway products based on AT91SAM9260 have reliable performance and meet the current market demand.