Mark Patrick, Mouser Electronics
Almost every system these days contains one or more microcontrollers (MCUs), and their popularity is underlined by the huge number of devices available on the market. Some designers may feel spoiled by this extensive choice, while others see the number of MCUs to choose from as something that takes up time and resources. Whichever way you view it, the MCU is an essential part of the modern design process.
The broad choice demands a methodical approach when it comes to the selection process, taking into account many factors including the features, supplier and supply chain. In this article we will consider the seven most important areas of the selection process that will almost certainly be relevant to your decision.
Architecture
The most important aspect of any MCU is the processor core and, if this is under-specified, the MCU will struggle to perform the necessary tasks. If the application simply requires the MCU to monitor I/O lines and change control outputs based on the inputs, an 8-bit MCU will almost certainly suffice. Should the task be more complex, such as performing the mathematical calculations necessary for true closed-loop control, the wider instruction set necessary will mean that a 16-bit or even 32-bit MCU should be selected.
One of the benefits of more bits is that data can be handled as a single entity. While this can be achieved with an 8-bit device, the data will often have to be split into sub-units, and this puts an extra load on the processor and impacts performance. Wider-pipeline MCUs have a higher price point, and balancing cost and performance is important. For this reason, 16-bit MCUs are often chosen as being a good balance for closed-loop control systems. If more complexity is required, for example adding management and communications capabilities, it is likely that a 32-bit MCU will be the optimum choice.
Figure 1: The PIC18F46Q10T-I/PT is an example of Microchip’s popular PIC family of 8-bit MCUs.
Input-Output (I/O)
Almost invariably, MCUs contain a variety of inbuilt I/O ports that make the design task significantly easier, and save board space. Often, manufacturers will configure MCUs for a particular application that will include specific quantities and types of I/O lines. These application-specific MCUs may also contain specific subsystems such as wireless for IoT connectivity or motor drive/control circuits.
MCU manufacturers’ websites often contain a parametric search function so, if the ideal MCU exists, finding it is as simple as checking the relevant boxes in the search form based on the needs of the particular application.
In some cases, the ideal feature set may not be available “off the shelf,” so compromises have to be made, or external circuitry added to achieve the necessary functionality. Fortunately, many MCUs have one or more of the common interfaces available, such as I2C or SPI, which can ease the task of adding external circuitry. If the ideal MCU is not available, the external components should be decided on before finally selecting the MCU so the designer can be sure there are enough of the right type of I/O connections to provide all of the necessary interfacing.
Memory
Onboard memory is a critical decision when selecting an MCU as, while it is possible to add external memory, performance is slowed due to the additional access cycles needed. It is therefore important (if possible) to have an appreciation of the code size when selecting an MCU – or at least selecting from an MCU series where variants with additional memory are available, allowing scaling without the need to change pinout and alter the PCB. It should also be borne in mind that the code may expand in future to add additional features.
While it is ideal for the main memory (for code and data) to be on board, it is quite common for non-volatile external memory (such as an EEPROM) to be added to store key configuration information while the system is powered down.
Power
The growth of the IoT means that many more applications are reliant on low power consumption, so that they can operate for months or years on a single battery. Rising energy prices and environmental concerns mean that, even for mains-powered systems, energy efficiency is an important consideration.
With an MCU, energy consumed is proportionate to the load on the MCU, so significant energy can be saved by taking advantage of sleep modes at times when there is little for the MCU to do. To maximize this advantage, designers can package activity into short bursts, allowing the maximum use of sleep modes where the current drawn by the MCU can be in the order of nanoamperes (nA). The MCU can also power down peripherals, such as wireless comms chipsets, and only apply power once they have a specific task.
Some MCUs include smart peripheral controllers that allow external devices to continue to perform their normal functions without the need to wake the MCU, allowing it to remain in sleep mode for longer, reducing the overall current draw.
Figure 2: Block diagram of Texas Instruments’ MSP430F2132QRHBREP.
Design Support Tools
Just as important as the actual MCU chosen are the design support tools associated with that MCU. In fact, they can be a key differentiator, significantly reducing the resources needed to complete a design and the time taken to bring that design to market. While features of the MCU can be found using a parametric search, it is not as simple to find design tools that will fit the needs and experience of a development team.
If the team has good knowledge of high-level languages, they will tend to prefer MCUs with a wide range of available compilers, such as those offered by ARM’s 32-bit devices. If cost is a primary consideration, the team may have to select an 8-bit or 16-bit MCU and work around some of the associated code restrictions. To assist with this, all of the main 8-bit and 16-bit MCU architectures have support tools available including compilers, debuggers and linkers. Often, these will be part of an integrated development environment (IDE).
Package Size
These days, designs are becoming denser and, therefore, physical space is always at a premium. Generally speaking, MCUs assist in this challenge due to the high level of integration they offer – particularly if you opt for a chip-scale package (CSP) that offers significant functionality in a very small form factor.
However, when choosing the package, any impact on PCB design should be considered. Very dense designs may necessitate increasing the PCB layer count, sometimes significantly. If the layer count is not increased, supporting components may have to be spaced away from the MCU to allow sufficient space for traces, especially sensitive traces such as the clock.
The usage environment can also influence the choice of package and therefore the MCU, depending on which packages it is available in. High temperatures or applications with high shock and/or vibration may dictate a certain package type that precludes the use of MCUs not available in a suitable package.
Figure 3: STMicroelectronics’ 511-NUCLEO-G070RB development board is based on an ARM 32-bit processor core.
Kits
MCUs make design easier due to their high level of integration, making them a preferred choice when project timescales need to be short. Many manufacturers make example code available that further shortens development times. To improve the speed of delivery to market, designers are often able to obtain evaluation/development kits that include pre-configured generic PCBs with the MCU and support components, such as I/O, already installed.
Alongside the MCU board, comprehensive development kits can also include peripheral modules that plug into the main board and offer additional functionality. With this approach, tailored hardware solutions can be delivered in days, allowing a proof-of-concept to be demonstrated to management and customers.
The modular solution can often be used for early shipments while development of a more compact, cost-optimized solution is conducted in parallel.