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.
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.
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 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.
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.
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.
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.