Courtesy: Micrium Inc.
So what are the “Things” in the Internet of Things?
At Micrium, we define a Thing as an embedded device, one that transmits and receives information over a network. So what’s an embedded device?
Embedded devices are based on microcontrollers, and run software with a small memory footprint.
Some Linux and Android-based systems can also be described as embedded systems. However, these general-purpose operating systems usually require an application processor, and have additional capabilities such as dynamic application loading.
This is why microcontroller-based embedded systems are often described as deeply embedded systems. For us at Micrium, these deeply embedded systems are the Things in the Internet of Things.
Embedded devices often use 16-bit or even 8-bit microcontrollers. But chips that feature 32-bit architectures have dropped in price over the last several years, and are becoming common in embedded systems. The greater capabilities of 32-bit chips present new choices for developers. And a real-time operating system is now the preferred option, allowing for more flexible and extensible software to run on these systems.
A complete RTOS – with a kernel, a user interface, a file system, USB support, networking, and more – can fit in a memory space of less than one megabyte.
With an RTOS, the software architecture of an embedded system can be more flexible.
Troubleshooting and adding new features becomes dramatically simplified. It is also simpler to perform firmware upgrades. In short, it just makes sense to use an RTOS with a 32-bit processor.
So which processor architecture should you choose? To date, the main contenders are Intel and ARM.
Now, it’s commonly believed that IoT hardware should always be low-cost, so that we can flood the planet with IoT devices. Some people forecast an IP address for every light bulb. But in fact, low-cost is not the solution for every application, especially when IP networking is concerned.
So which MCU makes a good starting point?
For an ARM processor in the IoT device, the Cortex-M0 is perfect. For gateways, the ARM Cortex-M3, M4 or Cortex-A are all good choices because of their greater processing capabilities.
For non-ARM processors, a good option for the IoT device is the Renesas RL78 or RX100 series. And for the gateway, the Renesas RX600 or RZ series.
Either way, new processors with more flash memory and more RAM appear on the market regularly, and always at a lower cost.
The programming languages used in deeply embedded systems include C, C++ and sometimes Java. So, your choice is not between C or Java; it is whether you will use C and Java. Java is attractive for IoT devices because of the huge number of Java developers worldwide. But the resource requirements for a Java engine are not negligible.
Oracle’s Java ME Embedded is designed for small devices. And Oracle recommends up to 700 Kilobytes of RAM and up to 2 megabytes of flash memory in the device for Java alone, plus support for a network connection. These numbers don’t meet Micrum’s definition of a deeply embedded device. And when you factor in the embedded kernel and the communication stack, it pushes the total into megabytes of ROM and RAM. Clearly, Java’s role in IoT devices will be limited to more capable and expensive systems.
When cost is not an issue, you can pick a single powerful processor to run all the tasks required of your device. However, a common engineering compromise is to use two processors in the device. One low-cost processor is used for the physical-world interface, like a sensor. This would be an 8 or 16-bit chip. And a second 32-bit processor runs the network interface. This second processor is often placed in a separate module, one that can be certified separately for standards compliance. And that module can then be used in multiple products.
When two processors are used, a real-time kernel is not strictly required for the sensor or actuator. However, an RTOS is strongly recommended for the communication module.
So in our next video, we will look at how your device will connect to the Internet.