EUR | USD

Easily and Efficiently Add Cost-Effective Child Nodes to IIoT Endpoints Using Port Expanders

By Bill Giovino

Contributed By Digi-Key's North American Editors

For Industrial Internet of Things (IIoT) applications, the features and flexibility of IIoT endpoints have been expanding not only in functionality but also expanding the physical control area by many feet from the host microcontroller in the endpoint. While a few I/O pins from the IIoT endpoint’s host microcontroller can be used to reach these extended locations, the I/O lines become more susceptible to electromagnetic interference (EMI) with increasing distance, resulting in reduced reliability. Although another microcontroller can be used as a child node of the IIoT endpoint’s host microcontroller, this can unnecessarily increase complexity when the data is only used for simple digital I/O signals.

Instead of extending the I/O lines for wider control, developers can use port expanders as cost-effective child nodes off the IIoT endpoint.

This article describes the role of port expanders before introducing two port expanders from Maxim Integrated. These expanders easily interface to the host microcontroller with serial interfaces that significantly extend the digital I/O functionality of the IIoT node. They do so while retaining conventional general purpose I/O (GPIO) functionality such as pulse width modulation (PWM) generation and interrupt detection.

Why port expanders are needed for an IIoT network

When planning an IIoT network, one of the first steps involves deciding the number of endpoints. Each piece of equipment that is required to synchronize its behavior with the rest of the facility will require at least one endpoint. A good example of this would be a factory assembly line. Each station must be synchronized to the progress of the entire assembly line in order to perform the right assembly procedure at the right time.

However, an IIoT endpoint in a factory assembly line may not be localized to one physical area but may instead use wiring or cables to extend the IIoT endpoint’s host microcontroller GPIO ports many feet away, similar to a star configuration with the host microcontroller as the hub. The termination of each point of the star may have enough complexity to act as a child node off the main IIoT endpoint but may not be sophisticated enough to be configured as its own IIoT endpoint with its own network connection. While the child node can be designed to be controlled by its own microcontroller, for simple GPIO this may add unnecessary complexity and cost.

A real-world example would be an IIoT endpoint that controls motors using PWM signals. If the motors are several feet away, multiple PWM signals would need to be sent to the motors, which would increase EMI for the surrounding area. Shielded cable could be used to transmit the PWM signals, but that would increase the cost of the system, and would not eliminate errors due to phase delays over distance or cross-talk. Instead, a serial bus such as I2C or SPI could be used to send commands to a programmable system located near the motors that would generate the PWM signals. These electronics would be a child node programmed to generate the required PWM signals.

A practical solution to the child node can be to use a port expander over a serial interface to the host microcontroller. Port expanders are simpler to configure than a microcontroller and extend the reach of the host microcontroller’s GPIO. Instead of running eight or more GPIO lines to a child node, a port expander at the child node can be easily accessed by the host microcontroller over a simple I2C or SPI interface. Writing to a register in a port expander sets or clears GPIOs while reading returns the status of GPIOs, the same as controlling GPIOs on the host microcontroller. Port expanders also retain much of the functionality of microcontroller GPIOs, including PWM generation and interrupt inputs.

An example of an easy to use port expander is the Maxim Integrated MAX7315AUE+T with eight GPIOs and an I2C interface (Figure 1).

Diagram of Maxim Integrated MAX7315A port expanderFigure 1: The Maxim Integrated MAX7315A port expander provides up to eight GPIOs and can generate an interrupt to the host microcontroller on a change in state of any GPIO. It is accessed by a two-wire I2C interface. (Image source: Maxim Integrated)

The MAX7315A supports eight GPIOs, each of which can be independently configured as input or open-drain output. A host microcontroller communicates with the MAX7315A over a two-wire I2C interface which operates up to 400 kilohertz (kHz). The address of the device on the I2C bus is configured by the three address pins AD [0:2], per Figure 1. The device can also generate an interrupt to the host microcontroller.

The MAX7315A allows eight GPIOs to be easily managed by only three pins: the two I2C pins and the interrupt pin. The device can be placed any distance away from the host microcontroller as long as conditions allow for reliable I2C communications. Depending on the board layout and ambient EMI, with the serial clock (SCL) running at a 400 kHz, usually three feet is a reliable distance, and with a 100 kHz SCL nine feet or more can be achieved.

However, it is important to test this in an active environment to ensure that ambient conditions or EMI does not have a significant effect on the distance.

Interrupt detection at the child node

The device supports an active low interrupt output on pin 13, but if the interrupt function is not needed, pin 13 can be configured as a ninth GPIO. The interrupt can be configured to go low on any input pin transition. This allows the host microcontroller to be made aware of activity at the child node without polling the MAX7315A. When the interrupt function is enabled, any GPIO that is configured as an input and has an interrupt enabled, acts as an interrupt input. On any change in state of any GPIO configured as an interrupt, pin 13 goes low to signal the change to the host microcontroller. The host microcontroller then reads the status of the MAX7315A to determine which GPIO changed state.

This process prevents any loss of interrupt functionality from using a port expander for GPIO, which is critical not just in IIoT but also in microcontroller systems that require interrupts for efficient firmware operation.

The interrupt function should be disabled before changing the configuration of the MAX7315A to avoid the generation of a false interrupt.

Although the MAX7315A can operate off a 2 volt to 3.6 volt power supply, the GPIOs are 5.5 volt tolerant. This allows the GPIOs to be compatible with standard logic levels including 2.0 volt, 3.6 volt, and 5.0 volt digital systems. Each GPIO configured as an open-drain output can source up to 50 milliamps (mA) in a logic high level. Outputs can be tied together to increase the output current. This makes the MAX7315A applicable for high-current LED indicators and keyboard backlights.

PWM generation at the child node

The MAX7315A also allows for programmable PWM outputs without intervention from the host microcontroller. An internal 32 kHz oscillator is used as the time base for PWM waveforms. A 4-bit master intensity setting configures the available 32 kHz PWM intensity for all outputs from 0 to 15, similar to a prescaler. Each PWM output waveform for each GPIO is divided into 15 time slots. The master intensity setting determines how many slots are available for PWM generation. Each individual GPIO has its own individual intensity register that is used to set the duty cycle for the waveform in the active slots. This is best explained with an example using the output waveform of an individual GPIO pin (Figure 2).

Graph of Maxim MAX7315A output waveform of an individual GPIO pinFigure 2: The MAX7315A has a programmable PWM generator that operates off an internally generated 32 kHz clock. This PWM has master intensity = 2 and an individual GPIO duty cycle intensity = 2. (Image source: Maxim Integrated)

The master intensity is set to 2, so only slots 1 and 2 of the 15 slots are available for PWM generation, while slots 3 through 15 are at logic level zero. The individual duty cycle intensity for this GPIO is set to 2, so the waveforms in slots 1 and 2 are at a duty cycle of 2/16 = 12.5%.

The PWM master intensity can be set from 0 to 15, where 15 means all 15 slots are available. A master intensity of zero means PWM generation is disabled for all GPIO and so the 32 kHz clock is turned off to save power.

Each individual GPIO can configure a PWM duty cycle intensity of 1 to 16, where 16 is a 100 percent duty cycle, setting the slot to a logic high.

For further flexibility, each GPIO has a polarity bit that can invert the PWM waveform. Figure 2 shows the waveform with the polarity bit for that GPIO set to 1. The PWM waveform in Figure 3 shows the same GPIO with the same master intensity and duty cycle intensity as Figure 2, but the polarity bit is cleared to 0.

Graph of Maxim Integrated MAX7215A has a polarity bit that inverts the waveformFigure 3: Each PWM GPIO on the Maxim Integrated MAX7215A has a polarity bit that inverts the waveform. This PWM has a master intensity = 2 and an individual duty cycle intensity = 2 with the polarity bit = 0 which inverts the waveform. (Image source: Maxim Integrated)

With this flexibility in PWM waveform generation, the MAX7315A can be used in a child node off an IIoT endpoint to control dimming of LED indicators, drive power transistors for DC motors, and control solenoids and actuators. Now, instead of running eight digital lines carrying PWM waveforms across a noisy industrial environment, the host microcontroller just needs to configure the MAX7315A and allow it to run independently.

Extending functionality at child nodes

For more complex child nodes, Maxim Integrated offers the MAX7301AAX+T port expander with up to 28 GPIOs. The MAX7301AAX is interfaced to the host microcontroller in the IIoT endpoint using a standard four-pin SPI interface (Figure 4). It also supports an active high interrupt function as an alternate function off P31. The MAX7315AAX can be configured to generate an interrupt back to the host microcontroller on a change in state of one or more GPIOs. This allows 27 GPIOs in a child node to be controlled in an interrupt-driven system using only five control lines: the four SPI control lines and one interrupt line.

Diagram of Maxim Integrated MAX7301 port expander SPI interfaceFigure 4: The Maxim Integrated MAX7301 port expander has an SPI interface and supports up to 28 GPIO pins that are available for input or output. Pin 31 supports an alternate function as an active high interrupt, allowing 27 GPIO lines to be controlled using five control signals. (Image source: Maxim Integrated)

The MAX7301AAX operates over a wide 2.25 volt to 5.5 volt supply range, making it compatible with most digital logic systems. The GPIO can be configured as Schmitt-trigger inputs with or without an internal pullup resistor. GPIO can also be configured as push-pull outputs that can sink up to 10 mA. This makes the MAX7301AAX appropriate for interfacing to logic-level circuits used to control other equipment such as industrial controllers, as well as system monitoring and alarm circuits.

Conclusion

As designers extend IIoT endpoints’ physical reach, controlling child nodes can be a challenge as extending multiple control lines over distances of many feet creates issues with EMI, layout, and circuit complexity. By using port expanders to control child nodes in interrupt-driven systems, developers can simplify pc board layout and improve reliability while adding significant functionality to the IIoT endpoint.

Disclaimer: The opinions, beliefs, and viewpoints expressed by the various authors and/or forum participants on this website do not necessarily reflect the opinions, beliefs, and viewpoints of Digi-Key Electronics or official policies of Digi-Key Electronics.

About this author

Bill Giovino

Bill Giovino is an Electronics Engineer with a BSEE from Syracuse University, and is one of the few people to successfully jump from design engineer, to field applications engineer, to technology marketing.

For over 25 years Bill has enjoyed promoting new technologies in front of technical and non-technical audiences alike for many companies including STMicroelectronics, Intel, and Maxim Integrated. While at STMicroelectronics, Bill helped spearhead the company’s early successes in the microcontroller industry. At Infineon Bill orchestrated the company’s first microcontroller design wins in U.S. automotive. As a marketing consultant for his company CPU Technologies, Bill has helped many companies turn underperforming products into success stories.

Bill was an early adopter of the Internet of Things, including putting the first full TCP/IP stack on a microcontroller. Bill is devoted to the message of “Sales Through Education” and the increasing importance of clear, well written communications in promoting products online. He is moderator of the popular LinkedIn Semiconductor Sales & Marketing Group and speaks B2E fluently.

About this publisher

Digi-Key's North American Editors