Get in touch

How to Choose a Microcontroller for Your Next Project

Software Development

6 mins read

There are thousands of different types of microcontrollers on the market today. Many of them are good, but not for every situation and every project. That is the reason why choosing a suitable microcontroller is absolutely essential. When choosing the right microcontroller, you need to consider not only technical features but also business care issues like availability on the market and cost.

 

At the beginning of the project, there is often a great temptation to select a microcontroller before knowing much about the technical requirements of the project, which is a bad approach. Before any thoughts, a group of engineers should do research about project needs and ways how to accomplish them. After that, you need to consider a number of factors that will help you make the right decision. Some of the most important ones will be discussed in the following text.

Hardware requirements

 

You should make a list of all external interfaces that the microcontroller will need to support. First, make a list of all communication interfaces and its peripherals that are needed for your project – I2C, Ethernet, SPI, UART, USB, etc. The second type of interface is digital inputs and outputs, analog-to-digital inputs, PWMs, etc. When you have all of this listed, you have a piece of information about the number of pins that are required.

 

Software requirements

 

The next step is to determine the software requirements. For example, processing speed – having this information, you can decide whether you go with an 8 MHz microcontroller or an 80 MHz microcontroller. Also, do your algorithms require floating-point mathematics? Will you use any high-frequency sensors? How often and how long each task will need to run? The most important questions are: What is the required amount of computing power? Does the firmware need to be encrypted or protected from reading through debug port in the final product?

Figure 1. Sketch of peripherals and minimum I/O requirements

 

Microcontroller architecture

 

After knowing the hardware and software requirements, the next step is to decide which architecture is more suitable for your project. There are two major architectures for the design of microcontrollers: Von Neumann Architecture and Harvard Architecture. In Von Neumann’s Architecture instructions and data are stored in the same memory and one bus is used to transmit data and instructions. So, it can’t perform data transfer and instruction fetching at the same time. On the other hand, Harvard Architecture has distinct data and instructions stored and also separated buses, so in this architecture, there is no need for scheduling data transitions and instruction fetching.

 

Memory Requirement

 

Two critical components of every microcontroller are Flash and RAM. One of the highest priorities is making sure that you don’t run out of program memory space or variable memory space. Engineers can estimate what size of Flash and RAM the project will require, using the software architecture and communication peripherals included in the application. You should always select a microcontroller with a bigger memory space than the estimate calculated. It is easier to start with more memory space, and after, when you are sure that your project won’t need so much memory, move to another chip from the same chip family. Also, you have to take into consideration features that may be added in the next versions.

 

Data width

Can the application get by with 8-bit or 16-bit microcontrollers, or it requires a larger size like 32-bit or 64-bit microcontrollers? It is very important to select the right bit size – the performance of the microcontroller increases with the increase of the bit size. Today, most application use 32-bit or 16-bit microcontrollers.

 

Power consumption

 

Power consumption is an important factor, especially if you have an IoT project that is battery-powered. Check the power consumption in normal mode, but also in low power modes.

 

Now, when you have lists with all features mentioned above you can start the search for a microcontroller. The best place to start is a microcontroller supplier such as Arrow, Mouser, Future Electronic, or similar. It is easier and better to go with the one you have already used and have good experience with. But this is not the end. Once when you are on the supplier’s webpage, there are also a few things to consider.

 

Examine cost

Let’s assume that at this moment, you have a few potential candidates for microcontrollers. Now, you can make a list of potential candidates with the order depending on the price with the cheapest in the first place.

 

Check availability

First, you need to know approximately when you need to have a microcontroller on your desk. Check things like are parts kept in stock at multiple distributors or is there a delivery time in several weeks. The second thing you need to know about availability is the duration of the product life cycle. If your project will have a life cycle of around 15 years, you need to be sure that the manufacturer guarantees that the microcontroller will be available for the next 15 years.

 

Investigate support for microcontroller

 

While choosing the microcontroller, check out for community support and available documentation: code samples, examples, reference design, online community, forums, etc. Also, check available software support: vendor-provided HAL, BLE, and Zigbee stack is their support for Zephyr, and also check if the person who will work on it already has experience with that microcontroller.

It is important to select a microcontroller with a good development kit so you can play, research, learn about it as much as you can and start building prototypes until you get the real hardware for your project. It will save you a lot of time and will speed up the process. Also, check the price of the development kit. The last thing is to examine the compiler and the tools that are available such as assembler, debugger, compiler, emulator, etc.

 

Now you have made a decision, but it should not be set in stone. Build up test circuits and interface them to the microcontroller, and check if high-risk parts are working properly. You may be in a situation where you discovered that the selected microcontroller is not appropriate for your project, but great damage has not been done yet – now you know what component is causing issues, so try to find a similar microcontroller that will have the missing feature.