In part one of how to choose a microcontroller, we considered many important aspects including bit size, processor type, operating voltage, package size, communication interfaces and memory. This article looks at further considerations, such as compilers and integrated development environments (IDEs), and compares some of the most popular microcontrollers on the market.
When looking at the compilers and IDEs available on the market, bear in mind that this is a secondary consideration. Compilers are what turn your code – written in a language such as C or C++ – into machine-readable code. This can then be programmed onto the microcontroller, where it will be executed at runtime.
Most microcontrollers can be programmed in C or C/C++ hybrids. Many can also be programmed in Assembly if the design demands faster operations. It’s even possible to embed Assembly into most of these C programs. Meanwhile, IDEs provide a guided user interface to help you develop, compile, test, run and debug any software for your project. Often these IDEs and compilers are free, but not always. For example, the Java-based Eclipse IDE was originally written for Java development. Eclipse is then customized for each microcontroller company to cater to their specific needs.
In choosing a microcontroller or architecture, it’s useful to look at the supported IDEs and how easy they are to use – if there are online tutorials, what the online support is like, and if there are many code examples to work from. This can significantly reduce the time spent getting up and running.
Let’s have a quick look at some of the IDEs commonly available.
Microchip offers the MPLAB X IDE, a full graphical user interface (GUI), which uses C and C++ and is free to download along with the XC8, XC16, XC32 and XC32++ standard compilers. Pro versions of each compiler enable greater code optimization, maximizing code reductions and best performance. There are also a number of useful plugins available for MPLAB X, enabling easy setup and configuration using Microchip Code Compiler. Microchip Harmony is another plugin, which is a firmware development platform designed for the PIC32 series of microcontrollers.
The Arduino IDE is a very lightweight IDE written in Java, developed for use with the popular Arduino series of platforms. Programs are written in “sketches.” It supports C and C++, and one of the major advantages of this IDE is the huge amount of open source code available to everyone, and the large community, which means that some small projects can be written up in a matter of minutes.
Atmel Studio is Atmel’s free integrated development platform – which supports Atmel’s larger product line, including the SMART ARM (SAM), AVR and AVR32 products. It features seamless import of projects from the Arduino IDE. It is integrated with the Atmel Software Framework (ASF), a large library of free source code with 1,600 project examples.
The Arduino IDE can be used to develop code for all ATMEGA AVR microcontrollers. This can also be done in Atmel Studio, which allows for far greater control over the device if needed. It is also very important to note that the Arduino IDE typically relies on programming the microcontrollers through the UART interface to a preloaded bootloader. It is possible to program this bootloader using a variety of programmers, or even another Arduino.
Code Composer Studio is the Texas Instruments IDE for its embedded processors, including the TMS320 DSP’s OMAP and DaVinci system-on-chip, Hercules microcontrollers and MSP430 and MSP432 microcontrollers. Combining the advantages of the Eclipse software framework, it comprises a suite of tools to develop and debug embedded applications.
Keil offers uVision, which is a third-party IDE combining project management, runtime environment, source code editing and program debugging in a single environment. It supports a broad range of development tools, C compiler, debugger and IDE for 8051, ARM and ST10 families.
IAR Systems develops third-party C and C++ compilers and debuggers for 8-bit, 16-bit and 32-bit microprocessors. Embedded Workbench is its development environment that supports 30 different processor families, including 8051, ARM, AVR, AVR32, MSP430, H8, Coldfire, R8C, STM8, and V850.
In looking at the various development environments, it is important to note that while Keil uVision and the IAR Embedded Workbench offer the ability to program a wide variety of microcontrollers and processor types, they need a bit more work to get up and running, and will be less supported than some of the other options.
MPLAB X, Arduino IDE and Code Composer are widely supported and offer a lot of example code to get you started, but will only focus on their own subset of microcontrollers.
While it’s important to focus on the various aspects of choosing the right microcontroller, it’s also very useful to be able to find the various microcontrollers in the Common Parts Library.
Some of the most popular microcontrollers are shown in the Common Parts Library, including Atmel’s ATMEGA328p, STMicroelectronics’ STM32 F401, and Texas Instruments’ MSP430.
For a larger selection of microcontrollers, the updated search filters provide a faster way to find the microcontroller you want. Type the category “microcontroller” into the search bar to find more than 50,000 microcontrollers available from more than 50 manufacturers.
50,000 options is a crazy amount to work through, so how do we begin to choose a manufacturer or microcontroller family? It’s helpful to start by looking at the top 10 microcontroller manufacturers, to better understand the various options, intended uses, and the target market.
Microchip is best known for its PIC series of 8-bit, 16-bit and 32-bit microcontrollers. It also produces a wide range of other electronic devices, from linear regulators and oscillators to wireless controllers and 3D gesture controllers.
As mentioned earlier, Microchip’s MPLAB X is its freely available IDE, and the most common programming tools are the low-cost PICKit3, the medium-range ICD3, and the high-end REAL ICE programmers.
Microchip has been around since 1993, and there are plenty of code examples available to use. Its microcontrollers and other devices have been used in everything from vending machines to small embedded sensor devices, all around the world.
Atmel was recently bought by Microchip, and most of its products will be found under Microchip’s brand. It offers a range of microcontrollers, including the 8-bit AVR (megaAVR and tinyAVR), 8/16-bit XMEGA, 32-bit AVR and the SMART ARM (SAM) range of microcontrollers.
Atmel Studio is available free of charge and allows the user to create and debug its code. Atmel-ICE (https://octopart.com/atatmel-ice-microchip-77759562) is a powerful debugger, enabling debugging and programming of the Atmel microcontroller range.
As Atmel AVR devices are most commonly used in Arduino development platforms, the Arduino Sketch IDE is a very lightweight development tool with many code examples and plenty of online support. It also removes the need for debuggers or programmers through the use of bootloaders.
Renesas Electronics offers the 16-bit RL78 and R8C, 32-bit RX MCU and a range of other microcontrollers. The R8C series of high-performance microcontrollers offers application-specific standard products (ASSPs), used for low-end motor control and lighting.
A number of development boards are available. The main programmers are the E2 Emulator, E2 Emulator Lite, Renesas Flash Programmer and PG-FP5. The main software development packages include CS+ and e2 studio. The compiler needs to be purchased for each of these to work.
The RL78 series are suitable for motor control, sensor detectors, and metering. They can also operate at voltages as low as 1.6V to 5.5V. The RZ/G series of microcontrollers supports OpenOS, 3D graphics and Full HD Video codecs.
NXP Semiconductors offers a wide range of microcontrollers under Power Architecture Processors (MPC5xxx e200 and e300 cores) and ARM Processors (LPC, Kinetis and S32 ranges) as well as the Coldfire, DSP56xxx, MC56xxx, S12, HC08, HCS08 and LPC9XX/80C51 families. Its microcontrollers focus on everything from low cost and integrated connectivity to automotive and power efficiency.
A wide range of development boards is also available. The microcontroller ranges are supported by the LPCXpresso, MCUXpresso, Kinetis Design Studio and S32 Design Studio.
NXP microcontrollers have been used in everything from industrial HVAC control to smart home equipment, automotive and smart energy systems. The LPC54000 series is ideal for GUI solutions.
Texas Instruments manufactures a wide range of semiconductors, for applications from power management to embedded processing. It offers the MSP430, the low-cost, ultra-low power consumption, general-purpose 16-bit MCU, and the MSP432 32-bit ARM Cortex.
It also offers a number of development tools. Code Composer Studio is the main IDE that supports TI’s microcontroller and embedded processors portfolio. It consists of a suite of tools used to develop and debug embedded applications, including optimizing C/C++ compiler, source code editing, project build environment, debugger, profiler and more.
The MSP-PRG430 is a serial programmer for the MSP430 series of microcontrollers.
STMicroelectronics offers the 8-bit STM8, 16-bit ST10, and the 32-bit STM32 microcontrollers. The STM8 is supported by the free Small Device C compiler, free Cosmic C compiler and paid-for IAR C and Raisonance compilers. The ST10 was designed in cooperation with Infineon for measurement and control tasks as a further development of the C166 family. The most common toolset for the ST10 is the C166/ST10 VX Software Development Tools by Tasking.
The STM32 is very popular and is widely supported by a number of compilers and debug utilities, including STM32CubeMX, System Workbench for STM32, VisualGDB, and EPC Debugger. Its range of Nucleo development boards for the STM32 is available in a range of sizes. The Nucleo boards are similar to the Arduino development boards in that they have a range of additional plugin boards that can be used to add WiFi, Bluetooth, NFC and much more to a project.
Cypress Semiconductor produces the PSoC programmable system-on-chip solutions. These include a CPU core and mixed-signal arrays of integrated configurable analog and digital peripherals. These are more like microcontrollers with programmable logic, similar to FPGAs and ASICs. This can be a powerful asset for those intending to create efficient mixed-signal designs.
PSoC Designer and PSoC Creator are free Windows-based development environments, which include a free C source code compiler with no code size limitations. The PSoC MiniProg3 is an all-in-one programmer for the PSoC 1, PSoC 3, PSoC 5 and debug tool.
Silicon Labs offers the 8-bit EFM8 and C8051 devices as well as the 32-bit EFM32 and Precision32 Devices. Its Gecko series of EFM32 32-bit MCUs and Bee series of EFM8 8-bit MCUs offer low power for energy-sensitive applications operating on batteries for extended time periods.
Simplicity Studio is the freely available development environment, which provides a powerful suite of tools for energy profiling, configuration and wireless network analysis, as well as demos and software examples.
Silicon Labs also has a great selection of development boards and starter kits. Most notable are the Tiny Gecko, Giant Gecko, Zero Gecko, Happy Gecko and Pearl/Jade Gecko starter kits (https://octopart.com/slstk3402a-silicon+labs-80851612).
Infineon offers a range of 32-bit industrial-focused microcontrollers (XMCXXXX), the 16-bit C166 (ST10 cooperation) and an 8051-compatible 8-bit microcontroller (XC800). There are a number of supported in-system programmers on its website. MemTool is a freely available on-chip Flash tool. Keil is the recommended toolchain for Infineon’s range of microcontrollers.
Infineon’s TriCore microcontrollers are most commonly used in the automotive industry for central control units in combustion engines and gearboxes, where they control fuel injection, ignition, and exhaust gas recirculation.
The Z80 was Zilog’s most famous product series, used in the Nintendo Game Boy, Sega Master System, Sinclair ZX80, ZX81 and ZX Spectrum, and Amstrad CPC home computers. Zilog also offers the Z8 Encore!, eZ8 Encore, eZ8 Encore! XP and eZ8 Encore! MC families. The 16-bit ZNEOZ16F series MCU is a powerful CISC microcontroller that outperforms most RISC microcontrollers in its class. The 32-bit ZNEO32! family of MCUs focuses on motor control. The Zilog software development tools include a wide range of packages covering its devices, including Zilog Developer Suite, ZDS II and Z8051. These are freely available on Zilog’s site. The Zilog microcontrollers can be programmed with the Zilog USB Smart Cable.
When trying to figure out what memory size, communications peripherals, bit size and processor to choose, it’s also a tough task trying to select between more than 50,000 available microcontrollers. It can help to understand where various microcontrollers have been used before, and what they are ideally suited to.
Microchip’s PIC microconotrollers and Atmel’s AVR and AVR32 microcontrollers offer great general-purpose options. Texas Instruments’ MSP microcontrollers offer additional mixed-signal processing at low cost and low power. Zilog and Cypress Semiconductor offer more custom solutions that may be of interest, depending on the project.
It is also good to know what you’ll be working with. MPLAB X, Arduino IDE, Atmel Studio, Code Composer and Simplicity Studio are all well-supported IDEs with plenty of reusable libraries available for use in any project. In saying this, it may be necessary to consider alternatives like Keil uVision or IAR Embedded Workbench if you’re using microcontrollers from two or more manufacturers and want to keep the same IDE.
If you have any comments or suggestions, drop us a note in our Slack channel or in the comments below. Be sure to check out the other blogs in this series: how to select a capacitor, resistor, inductor, and microcontroller.