Three Reasons Your Design Needs I²C I/O Expanders



The 2-wire I2C bus is an incredibly useful way to add all kinds of low-speed I/O besides I2C while simplifying designs and trace routing

The venerable I2C 2-wire bus remains as popular today as when Philips invented it in 1982. Originally a 100KHz bus, the current Version 4 (2014) Ultra Fast-mode (UFm) clocks at 5MHz—making it fast enough for most medium speed peripherals including digital I/O, GPIO, keyboards, keypads, and sensors. In fact, I2C is the perfect way to move signals around in many embedded systems, including those inside smartphones or destined to live on the “cloud edge” of the Internet of Things (IoT).

In this article we’ll suggest multiple examples where I2C will add value to your embedded design, giving you a new trick in your design tool bag.

2 Wires; Too Easy

I2C’s multi-drop, 3.3V or 5.0V active low, 2-wire interface is dirt-simple to wire up and easy to program. Using Serial Data Line (SDA) and Serial Clock Line (SCL), a master controls the bus and slaves acknowledge their 7- or 10-bit address (Figure 1). Communication ensues and the master ends the transmission with a stop bit. There can be several masters, and the number of slaves is limited only by the available addresses and bus capacitance.

Typical I2C bus length is on the order of several meters—more than enough for on-board or board-to-board system communications. Most I2C lines remain on a single PCB. The I2C protocol is a combination of START and STOP bits typically enumerated by dropping lines from high to low, with high typically at 5VDC.

Figure 1: I²C uses a Master/Slave, 2-wire bus with pull-ups to an active high state. Addressing is either 7- or 10-bits, and there can be multiple masters and as many slaves as the addressing or bus capacitance allows. (Image courtesy of Wikipedia and created by Cburnett.)

Figure 1: I²C uses a Master/Slave, 2-wire bus with pull-ups to an active high state. Addressing is either 7- or 10-bits, and there can be multiple masters and as many slaves as the addressing or bus capacitance allows. (Image courtesy of Wikipedia and created by Cburnett.)

With an available 5.0 volts and two easy-to-route lines, I2C can be converted to many other kinds of medium-speed interfaces such as GPIO, A/D/A, level shifters and countless IoT sensors (Figure 2). This means that many devices and interfaces can be MUXed, converted and transported via I2C. For example, a wide parallel interface can be reduced to I2C, reducing routing complexity by saving wires and traces.

Figure 2: I²C can be used to convert from sensors and medium-speed interfaces. (Courtesy: Pericom Semiconductor.)

Figure 2: I²C can be used to convert from sensors and medium-speed interfaces. (Courtesy: Pericom Semiconductor.)

I2C Simplifies Pinout, Fanout

Equally important is saving I/O pins on SoCs. All of the devices shown in Figure 2 can be implemented using only two SoC pins. That’s more than 13 devices connected to a space-constrained SoC with only two pins; amazing! For example, refer back to Figure 2 (lower right section), which shows I2C bridging to a SPI bus or a UART—all using only two I2C pins.

Figure 3 shows bi-directional I2C MUXes used to run multi-trace signals or busses over a longer distance using only two wires. I2C is fast enough to accommodate this kind of arrangement and it makes the job easy. For example, converting from a wide parallel bus to I2C saves on PCB routing, allows cheaper (and simpler) connectors, and can even act as a bus extender between boards in a system.

Figure 3: Using I²C to extend and/or simplify a parallel bus. (Courtesy: Pericom Semiconductor).

Figure 3: Using I²C to extend and/or simplify a parallel bus. (Courtesy: Pericom Semiconductor).

Figure 4 shows an I/O expander that converts an I2C bus to a 16-bit parallel bus. Compliant to the I2C spec, PI4IOE5V9539 from Pericom Semiconductor supports active low signals, 400KHz Fast Mode operation for dual-simplex (all Input or all Output) GPIO operation, and can be clocked up to 2MHz if needed. This particular device can be ganged up to three others to create a 48-bit parallel bus that necks down to a 2-wire I2C interface (using four I2C slaves). According to Pericom, this is equivalent to a 48-wire keypad controller converted to two I2C wires using only four 24-pin, tiny TSOP parallel I/O expanders.

Figure 4: Block diagram for a 16-bit I²C-to-GPIO expander. Up to four devices can be ganged to create a 48-bit parallel bus—perfect for high-function keypads. (Courtesy: Pericom Semiconductor.)

Figure 4: Block diagram for a 16-bit I²C-to-GPIO expander. Up to four devices can be ganged to create a 48-bit parallel bus—perfect for high-function keypads. (Courtesy: Pericom Semiconductor.)

Don’t Wake Me

Another reason I2C I/O expanders are so useful is they add local line control while freeing up the system controller from low-level tasks. In the simplified cell phone shown in Figure 5, the Baseband/Application Engine can avoid constantly polling the I/O blocks shown, burning battery power to keep the controller active. Instead, the INT (interrupt) output line can wake up the controller only when needed, allowing it to stay in standby or sleep, and save system power. A simple thing, but essential in battery-operated devices. In Pericom’s devices, this is called “Quick Link.”

The I/O expander shown back in Figure 4 also includes RESET. RESET sets the power-on default values without cycling the device power—a handy feature to return a still-powered system to a known good state. As well, the device offers the ability to switch polarity to either Input or Output, making a single device bi-directionally useful.

Figure 5: The expander’s interrupt line (INT) allows the Application Engine to avoid polling peripherals to stay in idle or sleep mode longer. (Courtesy: Pericom Semiconductor.)

Figure 5: The expander’s interrupt line (INT) allows the Application Engine to avoid polling peripherals to stay in idle or sleep mode longer. (Courtesy: Pericom Semiconductor.)

Little Tricks to Simplify Designs

I2C I/O expanders simplify system designs in other, less obvious ways. Pericom’s I/O expander product line includes fanout in x2, x4, x8 and x16 flavors and incorporates some nifty second-order features. For instance, a 2.2V to 5.5V Vcc range gives designers voltage choice from typical TTL 5.0VDC, down to the lower voltages found in battery and mobile devices.

I2C is a simple and robust 2-wire interface, but with longer traces comes the possibility of noise. Adding noise filtering on the I2C SCL and SDA lines avoids false level changes. Some I/O expanders also support both TTL and CMOS voltage levels on the I2C lines, a convenience for legacy designs.

The PI4IOE5V9570 4-bit I/O expander shown in Figure 6 can also drive LEDs directly. It’s a faster device capable of 1MHz I2C operation, but each of its four latched outputs can source 25mA. In this case, the SoC controls the GPIO signals using the I2C interface (through the bridging function in the expander). The SoC issues I2C commands to the expander, which in turn converts the commands to either high or low voltage. The GPIO ports drive the LEDs directly and the conversion from I2C to GPIO and proper LED voltage is taken care of completely by the I/O expander. In a system design like a cell phone, this means two I2C wires can illuminate and control four separate LEDs.

Figure 6: This 4-bit I²C I/O expander has two additional tricks: 1MHz operation and 25mA drive on each output pin—enough to drive LEDs directly. (Courtesy: Pericom Semiconductor.)

Figure 6: This 4-bit I²C I/O expander has two additional tricks: 1MHz operation and 25mA drive on each output pin—enough to drive LEDs directly. (Courtesy: Pericom Semiconductor.)

From Two, to Too Many to Count

In this article we’ve described only a handful of ways I2C I/O expanders benefit embedded designs. From fan out/in, to saving SoC power and pins, to driving LEDs directly, the I2C I/O expander adds some simple elegance to the mature I2C bus. Better yet, the ways to use I2C expanders are too many to count. We encourage you to try one in your next design.

This article was sponsored by Pericom Semiconductor.

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • TwitThis

Tags: