Create a Wireless-to-Ethernet Bridge
In many factories, there is a need for multi-function-capable, portable, and versatile handheld devices. Such handhelds should be able to report sensor data, and process set points, run rates, schedules and other operation- critical information effectively, from throughout the plant. Further, these handhelds need to display real-time data collected from the plant.
It is a designer’s challenge to cost-effectively embed the necessary intelligence into these classes of instruments, where wireless connectivity, computing power and portable-design requirements tend to put significant upward pressure on costs.
In this article you’ll learn how 16-bit microcontrollers (MCUs) support the functionality of a wireless-to-Ethernet bridge in a hypothetical factory handheld. Stepping through the design of this PDA type device show how you can use both Ethernet and wireless protocols, and how embedded technology choices affect that integration.
This handheld has low power consumption, high durability, and when, compared against the typically large size of industrial-quality handhelds, is more compact and portable. The system block diagram of the handheld reveals that the choice of an MCU determines the form factor and connectivity capabilities.
For example, because the handheld should be capable of running both Ethernet and wireless protocols to allow for connectivity anywhere in the plant, the instrument’s system design needs an MCU with enough processing power and memory capacity to handle both.
Next, you need to ensure that the chosen MCU offers the right mix of peripherals. The instrument design needs two serial peripheral interface (SPI) ports to communicate with both wireless and Ethernet transceivers. A parallel interface is also needed to drive an LCD and/or connect to a keypad. Since the instrument needs to be very compact, being able to multiplex these serial and parallel ports, while allowing for the flexible routing of signals, is critical.
|The instrument needs an MCU with enough processing power and memory capacity to handle both wireless and Ethernet protocols, and two SPI ports to communicate with both wireless and Ethernet transceivers.|
Wireless network standard
To allow the simplest portable design, the handheld device needs to interface with a base station, which will collect and process data and commands from all the portable devices. Communication with the base station will occur mainly via a wireless protocol, such as the free MiWi wireless protocol from Microchip Technology. This protocol was designed to support sensing and control applications, and is based on the IEEE 802.15.4 low-data-rate wireless personal area network (WPAN) standard.
The IEEE 802.15.4 wireless networking standard defines three frequency bands, with each having a fixed number of channels and corresponding maximum data rates: 2.4 GHz (16 channels and 250 kbps), 915 MHz (10 channels and 40 kbps), and 868 MHz (1 channel and 20 kbps).
Several device types are defined by the IEEE 802.15.4 standard. Among them, is the personal area network (PAN) coordinator. The PAN coordinator initiates the network, and then selects the channel and the PAN ID of the network. All other devices joining the PAN must submit a join request to the PAN coordinator. In this system, the base station will act as the PAN coordinator to handle all the traffic from the handhelds, which will be end nodes.
A simple networking protocol, such as the MiWi protocol, allows designers to quickly develop wireless solutions based on the IEEE 802.15.4 standard’s 2.4 GHz spectrum. (The MAC and PHY layers are based on the same IEEE 802.15.4 specification.) The network and application layers of the MiWi protocol provide the facilities to find, form and join a network, as well as to discover nodes on the network and route packets to and from them. At its maximum capacity, the MiWi protocol can handle 1,024 nodes on a network.
This type of handheld device should not be confused with a data acquisition (DAQ) system, which accumulates data from sensors in the plant. A DAQ system can be a device, such as a programmable logic controller (PLC), that interfaces through a LAN or any other industrial communication interface.
As seen in the system block diagram, the base station transfers data between the handhelds described in this article and the DAQ system. Our handheld instrument is a data delivery system where data is presented in a meaningful format, depending on the application requirement.
A base-station-centered system design can handle multiple simultaneous users of various levels. For instance, designers can categorize users into classes, allowing a few users to perform critical data handling, while restricting others to viewing general data.
Processing power and connectivity
Our handheld design features three means of communications: MiWi-protocol wireless connectivity to a base station; Ethernet connectivity; and a graphical interface. As part of this design, there would be a PC application that serves data to the base station (as well as any handhelds that are currently plugged in via Ethernet), so the base station can relay the data wirelessly via the MiWi protocol. In this case, the base station acts as a “MiWi router”.
As an alternative option, the base station can be configured to get data from Ethernet devices in the plant or from a database on the network, then relay the information via MiWi and Ethernet to the handhelds. The base station could also push software updates to the handhelds over the network.
Based on these design considerations, using a 16-bit MCU is logical because it meets processing power requirements and provides peripheral support. For portability, choose a 28-pin package. Such a device with the required peripherals allows a device to accommodate about six pushbuttons or a touchscreen with a couple of pushbuttons. Display data for a touchscreen can either be stored in the MCU’s flash memory, or an operator can use an external flash memory chip to store the graphics, which can then be referenced on the same parallel bus.
Exploit 16-bit MCUs
Some of the latest 16-bit MCUs have feature sets oriented to this kind of design. For example, the Microchip PIC24FJ64GA004 family of MCUs offers the high flexibility, small size, and low power consumption required for this type of Instrument. Features include the Parallel Master Port (PMP), which is a universal parallel data port with configurable control lines. This allows the PMP port to work with any parallel-port device and, hence, can drive any LCD with a parallel interface. The MCU’s peripheral pin select (PPS) allows mapping peripherals to I/O pins through software to reduce the number of I/O lines.
Most 16-bit MCUs enable energy-efficient handheld designs. For instance 16-bit MCUs often support three power-management modes: sleep mode where the MCU and the clocks are turned off; idle mode where MCU core is turned off but the peripherals are kept running; and doze mode, which allows the clock and peripherals to run at different speeds. Additionally, on-chip regulators can be turned on or off, allowing the MCUs to be powered using two AA batteries or a lithium coin cell.
This handheld design can be deployed in the field at a much lower cost than retrofitted industrial PDAs. Although much less sophisticated and lacking expensive proprietary IP, they are extremely functional devices that enhance productivity. Also, they can be designed from the ground up for industrial applications, instead of taking the guts out of a consumer electronics device and putting it in a sturdy shell.
Note: PIC and MiWi are registered trademarks of Microchip Technology Inc. All other trademarks are property of their respective companies.
|Brant Ivey is an applications engineer in the Advanced Microcontroller Architecture Division of Microchip Technology,|