The trend over the past 20 years in many industrial and automation systems has been to add increasing digital intelligence to individual nodes to make them more responsive. Systems can be made even more flexible by using distributed intelligence to incorporate them into a system of systems, also known as the “Internet of things.” Through networked control, it is possible to offer remote control over devices and have them work more intelligently to save energy and provide feedback on status and errors.
Using data collected from remote nodes, servers in the cloud can proactively schedule maintenance when alarms start to appear. The servers can also make devices work together for a more energy-efficient or cost-effective solution through the use of enhanced control algorithms that react not just to data from one device but perform sensor fusion to use inputs from a number of them.
Since its introduction in the 1970s, and subsequent update to use low-cost twisted-pair cabling in the 1980s, Ethernet has become the dominant wired-networking technology and the substrate for many Internet Protocol (IP) networks that combine to form the global Internet. The global popularity of these two standards in telecom and datacom applications has encouraged users in the industrial sector to embrace them. Increasing cost-pressure and the need for compatibility in data-exchange processes makes the combination of Ethernet and IP compelling.
As well as industrial control, city-wide networks are beginning to appear that bring together an array of intelligent devices that monitor the status of streetlights and security gates as well as capturing video from closed-circuit TV cameras. Large-scale trials have begun of these networks through projects such as SmartSantander where sensors can even detect whether parking spaces are empty or not.
Figure 1: The SmartSantander project uses information relayed by sensor nodes and gateways to generate interactive maps of the city center, showing the status of streetlamps and parking spaces, among other things.
To provide information to the servers in these networks, it is possible to fit a minimal webserver implementation into a relatively small piece of memory. Alternatively, the device can implement common web-service protocols such as SOAP. It is possible to find extremely small web-service libraries and even the larger embedded-oriented libraries are less than half a megabyte.¹ The message size tends to increase using protocols such as SOAP versus proprietary messaging protocols, but can still be handled by comparatively resource-constrained processors.
Figure 2: A study showing the relative overhead of SOAP and IP on the data size of responses from a smart sensor.¹
To reduce cost of the overall system of systems, a common approach is to employ service gateways. These gateways use a standard Internet connection on one side, often through an Ethernet port, with the other side used for a simpler, low-cost industrial network. Power can be delivered to these gateways using the Power over Ethernet standard, making it much easier to plug devices into a network and have them boot up immediately without having to deploy a separate power connection.
A further aid to configuration is the Dynamic Host Configuration Protocol (DHCP), which allows the node to obtain automatically the IP addresses that it needs to operate as a peer on a TCP/IP network. This reduces the configuration and installation overhead for systems based on the device. Using DHCP together with the Trivial File Transfer Protocol (TFTP) makes it possible to load new boot code into the device on initialization, allowing for very low installation and maintenance costs. The device simply has to be connected to an Ethernet cable for it to obtain an address from a local DHCP server and then download boot code.
Figure 3: The sequence of events involved in the acquisition of a network address using the DHCP protocol. The sequence starts with a request made by the device. The server responds by offering an unused address which, if accepted by the device, the server will acknowledge, allowing the device to use that IP address.
To support the evolution of distributed control, MPU and MCU vendors are adding network interfaces to their products. Many of these devices have an Ethernet Media Access Controller (MAC) on-chip.
The MAC takes care of the processing needed to detect which packets on the Ethernet network should be captured for use by the processor as well as sending out packets to a server or another node. A further device, the Physical Layer Interface (PHY) is needed to attach the MCU to the network. To ease integration, almost all MACs use the Media Independent Interface (MII) protocol to communicate with the PHY. This allows the use of different PHYs to suit different environmental characteristics. For example, in safety-critical environments, the PHY may be configured to support fiber-optic communication rather than the conventional electrical signaling interface.
Ethernet support is not confined to high-end 32-bit devices. A growing number of 8-bit devices that offer Ethernet interfaces are appearing, some of them adding hardware support to streamline packet transfers and allow very low-cost network support for industrial products and sensor gateways.
The DSC80C400 made by Maxim Integrated Products is a highly integrated 8051-based MCU that includes both a CAN interface for automotive and industrial networks and a 10/100 Mb/s Ethernet MAC. To provide full networking support, the ROM has a full TCP/IP v4/v6 stack and operating system that supports up to 32 simultaneous TCP/IP connections. The stack includes support for DHCP as well as TFTP to allow self-configuration and remote boot when the device connects to the network.
The MCU is able to sustain data rates of up to 5 Mb/s through the Ethernet port when running TCP/IP at its maximum clock frequency of 75 MHz.
Although the core architecture is that of the 8-bit workhorse the 8051, the DS80C400 contains features that make it suitable as a central controller in a tiered network, providing gateway functions for devices communicating on real-time networks such as CAN or serial buses to an enterprise network or the Internet. Access to large data buffers in external memory is provided through the use of a 24-bit addressing scheme together with four dedicated data pointers that can automatically increment and decrement as data is transferred to and from memory.
The Zilog Acclaim EZ80F91 uses a similar approach for handling data packets as they move between memory and the on-chip Ethernet MAC. Pointers manage the reading and writing of packet data, offloading the CPU from the burden. An arbiter controls access to the Ethernet MAC peripheral’s memory block.
As well as the Ethernet MAC, the Acclaim includes I²C, SPI and UART serial ports for connection to a variety of peripherals so that the MCU can be used as a gateway for sensor and actuator systems to the Internet. The processor architecture is based on the eZ80 instruction set.
A number of 32-bit MCUs offer on-chip Ethernet MACs, including the AVR UC3 family from Atmel and the Kinetis from Freescale Semiconductor.
The Peripheral Event System on the AVR UC3 devices helps reduce power consumption by allowing the processor core to sleep while the peripherals keep running, buffering packets or capturing analog data from an ADC input. The addition of floating-point math to the UC3 cores makes it possible for these devices to capture and process analog inputs at high speed and relay alarms or compressed sample data to an Internet server for further processing. Similarly, the Cortex-M4 core employed by the Kinetis also offers floating-point math and DSP support.
A number of members of the Texas Instruments Stellaris employ the combination of an Ethernet MAC and PHY, obviating the need to buy a separate MII-compatible PHY device and providing a further degree of integration.
For designs that need custom logic as well as network connectivity, Microsemi’s SmartFusion system-on-chip (SoC) devices provide an Ethernet MAC alongside an array of programmable logic gates, an ARM Cortex-M3 processor core and an intelligent analog-capture system. This combination of peripherals makes it possible to construct Internet-attached motor and actuator controllers that need comparatively little intervention from the host processor. Pulse width modulation (PWM) routines can be downloaded into the programmable logic and the analog capture engine used to preprocess incoming sensor data. The logic block can alert the processor to intervene if conditions move out of tolerance.
The processor can then assemble a status-update packet, possibly using a further section of programmable logic to perform data compression, and then pass that data out to the network through the Ethernet MAC.
As network support becomes a key requirement across many industries, more MCU and SoC suppliers are responding by adding not just Ethernet interfaces to their products but reference software as well.
For functions such as embedded webservers, a number of the MCUs mentioned already have reference implementations available. For example, the open-source IwIP stack, which includes webserver code has been ported to MCUs such as the AVR UC3, SmartFusion and Stellaris and are described in application notes provided by their respective vendors. These help streamline the process of implementing network-attached devices and gateways that will drive the Internet of things.
This article has provided an overview of techniques for implementing network support for industrial and embedded products using high-integration MCUs. The devices discussed include products from Atmel, Maxim Integrated Products, Freescale Semiconductor, Microsemi, Maxim Integrated Products, Texas Instruments and Zilog.
- Groba, C and Clarke S, “Web services on embedded systems - a performance study”. http://www.webofthings.org/wot/2010/pdfs/152.pdf