In the early 70s, two American companies, Intel and Texas Instruments, introduced microprocessors and microcontrollers to the world. These companies envisioned a future that was to be dominated by single-chip integrated computers.
Today, such devices play critical roles in almost all consumer electronic devices, automotive, aerospace, instrumentation, and control systems. Meaning you can find it in every production and nearly every home on the planet. We have become dependent on microcontrollers, yet surprisingly, only a few people really know what a microcontroller is.
In this tutorial, we will attempt to answer that question. We will also give a short overview of the most popular microcontrollers in the market and advances that have been made so far to make working with microcontrollers easy.
The Microcontroller System
To understand what a microcontroller is from the basics, let us first define what a system is. The diagram below illustrates a system as a collection of parts or devices with three features: input, process, and output. A system accepts at least one input, performs some action on that input, and gives out at one or more outputs.
Just like any typical system, a microcontroller system also has inputs, processes, and outputs. The exact number of attributes depends on the project at hand.
For example, a microcontroller system in a car can have many inputs, processes, and outputs compared to a microcontroller system of an electric door controller. The information and outputs of a microcontroller system are voltages that we can use to determine the state of external devices. The process involves reading the voltages from input devices (or controlled environments in the case of feedback systems) and using them to decide on the required output voltages.
A microcontroller is an integrated circuit designed to perform a specific operation in an embedded system. A typical microcontroller includes a processor, memory, and input/output (I/O) peripherals on a single chip. In short, the simplest definition of a microcontroller is an entire computer system on a single integrated circuit chip.
Examples of Devices that can be Controlled by Microcontrollers
Microcontrollers use instructions to determine the state or to control external devices. We find such devices in almost every aspect of our lives, especially applications requiring repetitive operations or high-speed computations. Here are a few examples of devices that microcontrollers can control:
- computer peripherals
- telephone systems
- microwave ovens
- security systems
- consumer electronic devices
What is a Development Board
Do you still remember the first time you built a simple circuit on a breadboard or a Veroboard? How was the experience? In most cases, you had to learn how to use the breadboard first and then learn about your circuit. You probably have spent a lot of time building your circuit on the breadboard.
But experienced users find it easy to build circuits on the breadboard. However, when the complexity of the circuit increases, it becomes difficult too to use the breadboard. That’s where development boards come in handy.
In simple terms, development boards or development kits are PCBs with minimum circuitry onboard to enable us to develop and test projects easily and quickly. We can also use development boards to prototype applications in products. The most popular development boards on the market are, without doubt, the Raspberry Pi and the Arduino. Their introduction to the market revolutionized the way people practiced electronics.
Development boards make working with microcontrollers easy in that we have all the circuitry required to program the microcontroller. Adding input and output devices is also straightforward, given that they are at the necessary voltage levels. I like these devices because it has become easier to program the microcontroller, and you can build fantastic programs as a beginner.
In this way, you can focus on the program functionality rather than assembly instruction sets or program debuggers.
Take Arduino, for instance. New learners getting started with microcontrollers find AVR GCC quite intimidating compared with the Arduino programming language. This means that Arduino offers new learners a gentle introduction to the field of microcontrollers, and the learning curve is shallow.
AVR Series Microcontroller Overview
There are so many microcontrollers on the market today, and selecting the suitable microcontroller for your project may be a bit challenging for new designers. Experienced developers have worked with many microcontrollers, and they know the limitations of most of them. There are a lot of factors to consider when selecting a microcontroller. But for me, the first is functionality, ease of programming, cost, and of course, community support.
Ample community support means that you will get lots of help quickly when you get stuck. The tables below summarize some of the factors you may consider when selecting a microcontroller for your project.
|Features||Performance specifications||Programming language(s) used||Compilers||Common applications|
|ATtiny85||No. of Pins: 8|
Family/Series: AVR Tiny
6 IO channels
512 Byte EEPROM
8/16 MHz CPU Speed
20MHZ internal clock
|Supply Voltage Range:2.7V to 5.5V|
Operating Temperature Range:-40°C to +85°C
|Arduino (with limitations),|
C/C++ or assembly code. (Microchip Studio – formerly AVR Studio), MPLAB X Integrated Development Environment,
IAR Embedded Workbench
|Safety-critical applications are targeting industrial and automotive products (IEC 61508 and ISO 26262).|
Industrial control systems.
SMPS and Power Regulation systems.
Analog signal measuring and manipulations.
|ESP8266||No. of Pins:30|
Digital I/O Pins (DIO): 16
Analog Input Pins (ADC): 1
Flash Memory: 4 MB
SRAM: 64 KB
Clock Speed: 80 MHz
|Operating Voltage: 3.3V|
Input Voltage: 7-12V
|Arduino||Arduino IDE||Prototyping of IoT devices,|
Low power battery-operated applications,
Projects requiring multiple I/O interfaces with WiFi and Bluetooth functionalities
|8051||No. of Pins: 40|
128 bytes RAM
Four register banks
128 user-defined software flags
8-bit bidirectional data bus
16-bit unidirectional address bus
32 general-purpose registers each of 8-bit
Three internal and two external Interrupts
Four 8-bit ports,
16-bit program counter and data pointer,
full-duplex UART Communication.
|Operating Voltage: 5V|
Supply Voltage Range:2.5V to 5.5V
Operating Temperature Range:-0°C to +70°C
|CX51 C Compiler,|
IAR Embedded Workbench – C/C++ compiler for 8051,
Aeronautical and Space
Industrial Process and Flow Control
Radio and Networking Equipment
|MSP430||No. of Pins:|
Non-volatile memory (kB): 64
RAM (KB): 2
ADC: 12-bit SAR
GPIO pins (#): 51
Features: AES, DMA, Real-time clock
Number of I2Cs: 2
|Operating voltage: 2.5v – 5.5 v. Active mode: 330 µA at 1 MHz, 3 V.||Assembly,|
MSP430 – GCC,
|Factory Control & Automation Applications.|
Buildings & Home Automation systems.
Grid Infrastructure & Metering networks.
Portable Test & Measurement Equipment.
Health, Medical & Fitness Applications.
|Teensy 3.2||No. of Pins: 34 Pin development board,|
32 bit ARM Cortex-M4 72 MHz CPU (M4 = DSP extensions)
256K Flash Memory, 64K RAM, 2K EEPROM
21 High-Resolution Analog Inputs (13 bits usable, 16-bit hardware)
1x 12 bit DAC Analog output
34 Digital I/O Pins (16 shared with analog)
12 PWM outputs
7 Timers for intervals/delays, separate from PWM
USB with dedicated DMA memory transfers
3 UARTs (serial ports)
SPI, 2x I2C, I2S, IR modulator
I2S (for high-quality audio interface)
Real-Time Clock (with user-added 32.768 crystal and battery)
16 general-purpose DMA channels (separate from USB)
|Operating Voltage: 3.3V|
Supply Voltage Range:3.6V to 6.0V
|32-bit robot/motor control, miniaturized applications, UAVs, sensor networks,|
|STM32||USB 2.0 OTG HS and FS,|
Two CAN 2.0B,
One SPI + two SPI or full-duplex I2S,
SDIO for SD/MMC cards,
Twelve 16-bit timers,
Two 32-bit timers,
Two watchdog timers,
16 or 24 channels into three ADCs,
51 to 140 GPIOs,
Improved real-time clock (RTC),
Cyclic redundancy check (CRC) engine,
Random number generator (RNG) engine.
|Operating Voltage: 3.3V|
Supply Voltage Range:1.7V to 3.6V
|You can use the following IDEs:|
Arm Keil MDK,
Segger Embedded, Studio,
|Embedded ARM GCC compiler||Industrial:|
Building and security:
Battery operated applications
PC peripherals, gaming
Digital camera, GPS platforms
ARM Cortex-M3 CPU platform
Up to 128 Flash
Up to 16 kB RAM
180 μA/MHz in Active Mode (EM0)
0.9 μA sleep with RTC and RAM retention
Autonomous peripherals in sleep
USART, I2C, and SPI
|-40 °C to +85 °C temperature grade|
1.98 V to 3.8 V single power supply
|C programming||GNU ARM C Compiler|
Single Board Computers
Microcontrollers may not be sufficient for some projects. In that case, you can select from a wide range of single-board computers. Single-board computers are ideal for developers and hobbyists. They are great for use in robotics applications, the Internet of Things, bright house, industrial automation, process control, and human-machine interface. Here is a summary of some of the most popular single-board computers
|Raspberry Pi Platform||RAM||Processor||USB||Ethernet||WiFi||Bluetooth||HDMI||Other Video||MicroSD|
|Raspberry Pi A+||512MB||700 MHz ARM11||1 Port||–||–||–||Yes||DSI, Composite||Yes|
|Raspberry Pi B||512MB||700 MHz ARM11||4 Ports||10/100Mbps||–||–||Yes||DSI, Composite||Yes|
|Raspberry Pi 2B||1GB||900 MHz Quad-Core ARM Cortex-A7||4 Ports||10/100Mbps||–||–||Yes||DSI, Composite||Yes|
|Raspberry Pi 3B||1GB||Quad-Core 64-bit ARM Cortex A53||4 Ports||10/100Mbps||802.11n||4.1||Yes||DSI, Composite||Yes|
|Raspberry Pi 3B+||1GB||64-bit ARM Cortex A53||4 Ports||300/Mbps/PoE||802.11ac||4.2||Yes||DSI, Composite||Yes|
|Raspberry Pi Zero||512MB||1 GHz single-core ARM11||1 Micro USB||–||–||–||Mini-HDMI||–||Yes|
|Raspberry Pi Zero wireless||512MB||1 GHz single-core ARM11||1 Micro USB||–||802.11n||4.1||Mini- HDMI||–||Yes|
|BeagleBone Platform||Memory||Processor||USB||Network||Video||Supported expansion interfaces||MicroSD|
|PocketBeagle||512MB DDR3 (800MHz x 16)||AM3358, 1GHz ARM Cortex-A8||USB 2.0 480Mbps Host/Client Port, USB 2.0 on expansion header||add-ons||SPI displays||3x UART, 4x PWM, 2x SPI, 2x I2C, 8x A/D converter, 2x CAN bus (w/o PHY), 2x quadrature encoder, USB||Yes|
|BeagleBone Black||512MB DDR3 (800MHz x 16), 4GB on-board storage using eMMC||AM3358, 1GHz ARM Cortex-A8||USB 2.0 480Mbps Host/Client Port, USB 2.0 Host Port||10/100 Ethernet||microHDMI, cape add-ons||4x UART, 12x PWM/Timers, 2x SPI, 2x I2C, 7x A/D converter, 2x CAN bus (w/o PHY), LCD, 3x quadrature encoder, SD/MMC, GPMC||Yes|
|BeagleBone Blue||512MB DDR3 (800MHz x 16), 4GB on-board storage using eMMC||AM3358, 1GHz ARM Cortex-A8||USB 2.0 480Mbps Host/Client Port, USB 2.0 Host Port||2.4GHz WiFi, Bluetooth, BLE||SPI displays||4x UART, 2-cell LiPo, 2x SPI, I2C, 4x A/D converter, CAN bus (w/ PHY), 8x 6V servo motor, 4x DC motor, 4x quadrature encoder||Yes|
|BeagleBone AI||1GB DDR3 (2x 512Mx16, dual-channel), 16GB on-board storage using eMMC||AM5729, 2x ARM Cortex-A15||USB 3.0 5Gbps Host/Client Port, USB 2.0 Host Port||Gigabit Ethernet, 2.4/5GHz WiFi, Bluetooth, BLE||microHDMI, cape add-ons||4x UART, 12x PWM/Timers, 2x SPI, 2x I2C, 7x A/D converter, CAN bus (w/o PHY), LCD, 3x quadrature encoder, SD/MMC||Yes|
|BeagleBone Green||512MB DDR3 RAM.|
4GB 8-bit eMMC on-board flash storage
|AM3358 1GHz ARM Cortex-A8||USB 2.0 480Mbps Host/Client Port, USB 2.0 Host Port||Ethernet||UART, PWM/Timers, SPI, I2C, A/D converter, CAN bus (w/o PHY), LCD, SD/MMC||Yes|
|BeagleBone Green Wireless||512MB DDR3 RAM.|
4GB 8-bit eMMC onboard flash storage
|AM3358 1GHz ARM Cortex-A8||4*USB 2.0 480Mbps Host/Client Port, USB 2.0 Host Port||Wi-Fi 802.11 b/g/n 2.4 GHz and Bluetooth 4.1 LE||4x UART, 12x PWM/Timers, 2x SPI, 2x I2C, 7x A/D converter, CAN bus (w/o PHY), LCD, 3x quadrature encoder, SD/MMC||Yes|
|BeagleBoard XM||128MB-512MB DDR3 RAM. 8-bit eMMC onboard flash storage||AM37x 1GHz ARM Cortex-A8||USB 2.0 480Mbps Host/Client Port, USB 2.0 Host Port||Ethernet||S-Video port||UART, PWM/Timers, SPI, I2C, A/D converter, CAN bus (w/o PHY), LCD, SD/MMC||Yes|
So that’s a brief overview of the most popular platforms on the market today! However, this is not an exhaustive list and only includes some of the most common microcontroller tools. There are still a lot of third-party tools for programming and compiling microcontrollers out there.