Choosing the Right ARM Microcontroller
Introduction
Have you ever wondered what powers your smart watch, game controller, or dash cam? Inside each of these Internet of Things (IoT) devices, there is a small computer chip embedded called a microcontroller. Microcontrollers are different from PC CPUs in several key ways: they are lower cost, lower speed, lower power consumption, and most importantly, they can provide real-time processing, which is essential for time-critical applications. For example, you wouldn't want your game controller to have high latency when playing a first-person shooter game.
Microcontrollers are used in a wide variety of IoT devices, including:
Smart watches: Microcontrollers are used to power the display, sensors, and other features of smart watches.
Game controllers: Microcontrollers are used to process input from the controller and send commands to the game console.
Dash cams: Microcontrollers are used to record video and audio, and to store the recordings on a memory card.
Microcontrollers are also used in many other applications, such as:
Industrial control: Microcontrollers are used to control machines and other industrial equipment.
Medical devices: Microcontrollers are used in medical devices such as pacemakers and insulin pumps.
Automotive: Microcontrollers are used in cars to control the engine, transmission, and other systems.
Design Goal
The goal of a microcontroller is to provide specific functionality at low cost, low area, ultra-low power consumption, and deterministic output with low latency.
MicroController System Overview
Block Descriptions
Core: The core is the central processing unit (CPU) of the microcontroller. It is responsible for executing instructions and controlling the other blocks in the microcontroller.
SRAM: Static random-access memory (SRAM) is a type of memory that retains its contents when the power is turned off. It is used to store data that needs to be accessed quickly, such as variables and buffers.
Flash: Flash memory is a type of memory that can be erased and rewritten. It is used to store the microcontroller's program code and data.
DMA: Direct memory access (DMA) is a feature that allows the microcontroller to transfer data between memory and peripherals without involving the CPU. This can improve performance in applications where data needs to be transferred quickly.
NVIC: The nested vector interrupt controller (NVIC) is responsible for handling interrupts. Interrupts are events that can cause the microcontroller to stop what it is doing and execute a specific piece of code.
WIC: The wake interrupt controller (WIC) is responsible for waking up the microcontroller from a low-power state when an interrupt is received.
Peripheral interface: A peripheral interface is a block that allows the microcontroller to communicate with external devices. Some common peripheral interfaces include I2C, SPI, and USB.
Clock generator: it provides all the clocks with various speed needed for the internal system such as processor, memory, and I/O interfaces.
Source can be from an external crystal clock or internal RC resonator clock
Note: external clock is generally used when accurate timing such as timestamp is needed.
BUS Bridge: The bus bridge is a block that connects the low-speed peripheral interfaces to the high-speed memory bus. This allows the microcontroller to access peripherals quickly.
DEBUG: The debug port is used to debug the microcontroller's program code. This can be done by connecting a debugger to the debug port.
Popular ARM architectures.
Twp popular types: R class ARM Archiecture and M Class ARM Archiecture
M Class ARM Archiecture: There are generally 3 M class micro-architectures that iare used namely:
M0 (ARMv6-M Archtecture)
This contains the most basic ARM instruction sets that is generally powerful enough to run very specific functions such used for network processor for Bluetooth stack.
16 bits instructions
General I/O controls and data processing
M3 (ARMv7-M)
More richer ARM instruction sets
32 bits instruction
Contains more advance arithmetic logic such as divider, multiply and accumulate (MAC) dedicated hardware blocks (used for signal processing).
Limited DSP instructions
Contains debug interface
M4 (ARMv7-M)
It has the same feature as that of M3 but with additional richer digital signal processing instructions set
For example sensor fusion algorithm such as objection orientation detection can used the DSP instructions.
M4F (ARMv7-M)
It has the same feature as that of M4 but with additional float point unit that can be used to process float instead of integers.
floating point allows higher dynamic range that is needed to represent data such as signal from GPS which can be very weak and need higherinput dynamic data format to capture.
Benefits of M Class ARM Microcontrollers:
Real-time data processing: Microcontrollers can be used to process data in real time. This means that the microcontroller can complete data processing within a specified time period.
Low interrupt latency: Microcontrollers can respond to interrupts quickly. This means that the microcontroller can react to events in a timely manner.
Onboard memory and storage: Microcontrollers often have onboard memory and storage. This means that the microcontroller does not need to have external memory or storage.
Comprehensive system interfaces: Microcontrollers often have a variety of system interfaces. This allows the microcontroller to connect to a wide range of peripherals.
R class ARM Archiecture: R class ARM microcontrollers are a family of microcontrollers based on the ARMv7-M architecture. They are designed for embedded applications that require low power consumption and real-time performance.
Benefits of R Class ARM Microcontrollers:
Low power consumption: R class ARM microcontrollers are designed to consume very little power, making them ideal for battery-powered applications.
Real-time performance: R class ARM microcontrollers can execute instructions in real time, making them suitable for applications that require precise timing.
Wide range of peripherals: R class ARM microcontrollers have a wide range of peripherals, making them versatile and adaptable to a variety of applications.
Low cost: R class ARM microcontrollers are relatively inexpensive, making them a cost-effective solution for many applications.
Comparision between R and M class ARM MCU
R Class ARM Microcontrollers
Designed for low power consumption and real-time performance.
Typically have a 32-bit ARM Cortex-M processor.
32 KB to 1 MB of SRAM.
512 KB to 1 MB of flash memory.
Variety of peripherals, including timers, counters, serial ports, I2C, SPI, and CAN.
Ideal for applications that require low power consumption, real-time performance, and a wide range of peripherals.
M Class ARM Microcontrollers
Designed for high performance and flexibility.
Typically have a 32-bit ARM Cortex-M processor.
More than 1 MB of SRAM.
More than 1 MB of flash memory.
More peripherals, including DSP instructions, floating-point unit, and security features.
Ideal for applications that require high performance, flexibility, and advanced features.
MCU Selection Consieration
Top criteria when selecting a MCU
Cost
Power
required peripherals: The required peripherals are the peripherals that the microcontroller needs to connect to.
internal memory (SRAM)
Internal storage (Flash)
DSP and Floating point Unit
Processor clock speed.
Security
I.e if trustzone is needed for secure data storage then memory protection units (MPU) is needed.
Popular Vendors and low power series.
NXP LPC series
STM32 L series
TI MSP430 series
Summary and Conclusion
Microcontrollers are small, low-cost, and low-power computers that are used in a wide variety of applications. They have a number of benefits, including real-time data processing, low interrupt latency, onboard memory and storage, and comprehensive system interfaces.
When selecting a microcontroller, it is important to consider the following factors: cost, power consumption, required peripherals, internal memory (SRAM), internal storage (Flash), DSP and Floating point Unit, processor clock speed, and security.
Some popular vendors of microcontrollers include NXP, STMicroelectronics, and Texas Instruments.