Taking advantage of SPI in embedded wireless sensor/IoT designs
In "Assessing 8-bit communications interfaces for the Internet of Things," included in this week's Tech Focus newsletter, Tom David of Silicon Labs takes a look at a number of small footprint communications protocols such as SPI and I2C and their usefulness in 8-bit Internet-of-Things designs.
Unlike his even-handed analysis, I must admit I have a bias in favor of the oldest of them all, the Serial Peripheral Interface (SPI) Bus. I was introduced to it in the mid-1970s in an undergraduate course in electronics I was taking while working at the California Institute of Technology.
I was impressed at the time with its flexibility and ease of implementation in even the most resource-constrained microcontroller-based designs. And I still am, especially now in the age of the Internet of Things, where the name of the game is getting the most performance out of sensors and remote wireless MCUr devices with a minimum of power.
The SPI bus still continues to be used, and this is despite the fact that much more recent and flexible serial communications interfaces have come along to displace it, such the Inter-IC bus (I2C) and SMBUS.. Developers have been telling me for years that SPI it is not long for this world considering its many disadvantages compared to these later alternatives: it requires more pins than even I2C, has no in-band addressing, supports only one master device, and has no error checking protocols.
Worst of all, it only works over relatively short distances, especially when compared with RS-232, RS-485, or the CANbus. But in the constrained environment of wireless sensor configurations that are common in many Internet of Things applications, the short distance limitation actually works in its favor when some of its advantages are also factored into the equation.
Among other things, it typically has lower power requirements than other serial interfaces and is not limited to any maximum clock speed. Especially important is that it is not limited to 8-bit words, allowing the developer complete protocol flexibility for the bits transferred. Moreover it allows a designer to choose any arbitrary mix of message size, content, and purpose.
For all these reasons I feel that it is an ideal serial communications protocol for many next-generation IoT designs. This is borne out by some of the recent articles on the protocol included in this week's Tech Focus newsletter, including:
Nano-Power Wireless Wake-Up Receiver With a Serial Peripheral Interface
An ultra low power Wake Up Receiver (WUR) intended for use in Wireless Body Area Networks (WBAN) that makes use of a serial peripheral interface for reduced power. .
Design of a Wireless Sensor Network node based on STM32
Design of a wireless sensor node based on STM32F103RE MCU and TI's CC2430 radio frequency chip using a serial peripheral interface (SPI) bus as the communication and control between them.
Isolating SPI in high bandwidth sensor applications
A look at the Serial Peripheral Interface Bus (SPI), its constraints, and how to deal with those constraints in isolated systems using the Analog Devices ADuM3150 in high bandwidth sensor applications.
What serial protocols are you considering for your next generation IoT, wireless sensor, and machine-to-machine network designs? Are you still using SPI, or have you abandoned it for something better?
Embedded.com Site Editor Bernard Cole is also editor of the twice-a-week Embedded.com newsletters as well as a partner in the TechRite Associates editorial services consultancy. He welcomes your feedback. Send an email to email@example.com, or call 928-525-9087.