There are many factors that are worth considering to select the appropriate microcontroller for a project. Cost, performance, size and power consumption all matter, but it is also crucial to make sure that the proper software and hardware tools of the selected microcontroller are available. The readily available development board for the selected controller is also helpful. Likewise, support is also significant and it is not enough to have support only from the vendor, but there should be community support for the selected platform. Finally, the fully debugged, extensive software libraries for the chosen microcontroller with well documented application programming interfaces (APIs) can be used to reduce the development time significantly.
Some basic features can be found in all modern microcontrollers. These microcontrollers have some flash memory that is used to store the application code, some static random-access memory (SRAM) and electrically erasable programmable read-only memory (EEPROM). An internal resistance capacitance (RC) oscillator is used to provide a clock source, and for some applications, an external crystal is used where a clock source is needed. There are some I/O ports and a minimum of one timer/counter port in them.
For embedded systems, microcontrollers are categorized into three main types depending on the width of data buses: 8, 16 and 32 bit. There are many others, but these three are the most common. For lower-end applications, 8 bit microcontrollers are generally used while 16 bit microcontroller are used for mid-end applications and 32 bit microcontrollers are used for higher-end applications.
8 bit microcontrollers
If an application or a project is relatively smaller in size and has lower demands on processing power, then an 8 bit microcontroller is the right choice. Most of the Arduinos are 8 bit. So, an 8 bit microcontroller can be used for the final product if an Arduino was used to build an early prototype.
The applications that are meant to perform only one task are usually operated by 8 bit microcontrollers with little data processing and limited user interface (UI). All sizes are available in an 8 bit microcontroller, ranging from six pin devices to 64 pin chips. Flash sizes also vary from 512 bytes to 256 KB, SRAM sizes ranging from 32 bytes to 8 KB or more and EEPROM ranging from 0 to 4 K or more.
16 bit microcontrollers
Although the 16 bit microcontrollers have many attributes similar to those offered by the 8 bit, 16 bit microcontrollers are relatively faster, and feature more flash and SRAM. Other than having a greater number of I/O pins, they have faster hardware multipliers that consume less program memory as compared to pure software implementations. Finding devices, with both analog-to-digital converters (ADCs) and digital-to-analog converters (DACs) or with Ethernet, touch sensors or LCD drivers, is easy. Inside these devices, some hardware blocks are present, which usually cannot be found in lower-end devices. Some of the examples are encryption engines, DMA controllers, and operational or programmable gain amplifiers.
TI MSP430 series
For low powered devices, MSP430 can be used. In idle mode, less than 1 µA current is drawn. The top speed of the central processing unit (CPU) is 25 MHz. There are six different low-power modes in MSP430 that are used to disable unwanted clocks and CPU. Moreover, MSP430 has a wake-up time of less than 1 µs, which lets the microcontroller be in sleep mode longer and results in decreased average current consumption.
A 16 bit microcontroller cannot be used in more complex embedded systems due to some of its limitations. MSP430 has limited on-chip memory (max 512 KB flash memory and 66 KB random access memory (RAM)) and no external memory. For applications that need large buffers or data tables, only on-chip memory is not enough. Even though there is a direct memory access (DMA) controller available, it does not have a DMA output strobe that makes it difficult to move the data from the chip.
32 bit microcontrollers
Similar to a microprocessor, 32 bit microcontrollers are quite powerful and offer advanced features like instruction pipelining, memory protection, floating-point units (FPU), branch predictions and onboard debuggers. In instruction pipelining, subsequent instruction is pre-fetched by the processor core before time. In branch prediction, the following instructions of both outcomes of an if-else condition are pre-fetched, making the code execution fast. Floating-point calculations made by FPUs are faster than SW-implemented methods. There is a memory protection unit to make sure that the critical sections of the operating system cannot be unintentionally over-written by the application code.
Lastly, on-board debugging facilitates application code debugging by allowing peeking into registers and some other areas of the system. All advanced features work together to help these microcontrollers run fast, robust and large applications. Moreover, they can easily support real-time operating systems (RTOSs) that provide multitasking capabilities.
Conclusion
The microcontroller is one of the most crucial components of a product. So, the microcontroller must be selected wisely and carefully because it is not an easy task to change the microcontroller in the middle of a project. Other components or elements in a project can be replaced or changed as per requirement without any system-wide changes. But the story is a bit different in the case of the microcontroller because it is the core of the product.
It is critical to choose a microcontroller that provides a project with some room to grow in the future. For instance, if an application only needs 16 general-purpose input/output (GPIO) pins, then a microcontroller with more than 16 GPIO pins must be selected. This will help in the event that a button needs to be added to a project in the future. In other words, a microcontroller that allows future growth must be selected. Otherwise a redesign must occur for simple project upgrades using a new microcontroller.
Alternatively, it is also not wise to choose a microcontroller that has more performance or features than necessary. For example, if a project includes simple monitoring of temperature and humidity, then an advanced 32 bit microcontroller is not needed that runs at hundreds of MHz. Such a selection will only make it over-priced and add complexity to the product design. Instead, find a middle ground where there is room to grow in the future, but still not pay extra for features, performance and speeds that will not be used.
