Selecting a Microcontroller

Posted by John English on Feb 3, 2017 5:07:06 PM
Find me on:

These days an enormous number of projects involve programmable microcontrollers. At their most basic level, microcontrollers are programmable digital integrated circuits that can perform logical operations, have memory, and interface with the outside world. In most cases their connection to the "outside world" is through traces on a PCB to other devices. Common microcontrollers range from tiny 8-bit packages with limited RAM and low cost (such as the popular ATtiny85) to massive 32-bit devices with hundreds of pins and an impressive range of peripherals (such as the also popular STM32F407). For all of the projects that employ microcontrollers of some kind, there is always the question of "which one?

There are many aspects of a design to consider when evaluating microcontrollers. What processing speed and memory size is necessary to accomplish the goal? Are there hardware peripherals that are needed for the project, such as specific communication interfaces or advanced features like DMA? What are the requirements for physical size, power consumption, and component cost? What development tools and software libraries are available? Do the developers involved have experience with the development tools, and if not, what kind of learning curve will they face? What external resources are available, such as third party documentation or online communities? The Arduino platform is wildly popular in large part due to its active community and worldwide user base.

Many projects have clear requirements for microcontroller peripherals. Perhaps a USB interface is needed, and the device needs to mount as a mass storage device. Maybe it needs an SPI or I2C interface for communicating with sensors, external flash, or other microcontrollers. In projects where a large amount of external RAM is needed, a special hardware interface may be required. In systems with audio, high quality DAC and ADC peripherals may be useful, although similar functionality might instead be implement with digital audio interfaces such as I2S or S/PDIF. A wise designer will be careful when choosing a microcontroller that will employ many different peripherals. It’s common for separate peripherals in a given microcontroller to share certain resources, such as timers or physical IO pins. No one wants to spend hours or days working on a particular microcontroller, and, after all that effort, find out that the intended configuration of pins and peripherals creates show stopping resource conflicts!

It can be difficult to evaluate all of these design features, let alone navigate the thousands of microcontroller options readily available. For many simple projects, a good answer may be "go with what you know." At Boulder Engineering Studio, we sometimes have projects that involve building only a few devices, such as scientific instruments for research. In these cases, if a microcontroller that we have an existing familiarity with is a good fit for the project, we may be able to save considerable development time and by leveraging our past experience. The cost of engineering time, when measured in hours or days saved, can dwarf the cost difference between microcontrollers by orders of magnitude.

In many other cases, we have projects that involve design for mass production. Anticipated build volumes of thousands or millions of units is common for electronics manufacturing. In these designs, optimizing for small improvements in cost can have enormous implications. However, the evaluation of cost involves more than just the price of the microcontroller itself. Selecting a microcontroller can have wide ranging impacts that ripple into other elements of the product. Imagine a hypothetical project, comparing the STM32F405 and the STM32F407. Although the 407 is more expensive, it has an internal Ethernet controller. If paying slightly more for that part means eliminating the need for an external Ethernet controller, the reduction in BOM size and PCB area alone may ultimately result in savings. At very large volumes, the microcontroller components might be purchased directly from the manufacturer, rather than thought a distributor like Digikey or Mouser. The price of a part will vary with volume, and not necessarily at the same rate for each part. While one microcontroller might be lower cost than another at quantity 1,000, the opposite might be true at quantity 10,000.

One of the most exciting aspects of the electronics industry is how quickly devices like microcontroller are becoming more powerful, more efficient, and lower cost. There's an amazing range of options available to us today, packing incredible performance into tiny, cheap packages. As is the case with almost everything in embedded elements the answer to what would might seem like astraight forward question like "what microcontroller should we use," is "it depends."


Are you ready to take the plunge on your own design?

Request a Consult 

To start chatting with our engineers about your project!


Topics: electrical, microcontroller