Micro-controller
Introduction
Have you wonder what is powering up your smart watch, game controller, dash cam, etc.? Inside each of internet of thing device , there is a small computer chip embedded inside, which called microcontroller. The key differences between microcontroller and PC CPU is that micropcontroller has lower cost, lower speed, lower power consumption, and most importantly realtime processing that is needed time critical applications. For instance, you wouldn't certainly want your game controller response to have high latency when playing a first person shooter game.
Goal
Micro-controller is used to provide specific functionality at low cost, low area, and Unltra low power consumption, and lastly deterministic output with low latency.
Overview
Block Descriptions
Core: There are 32 bit ARM processors
SRAM: Internal memories used to store variables, and buffer data.
Flash: internal storage used to store user program, persistent variables.
DMA: Direct memory access. It's a dedicated hardware block that can be used to control data flow between memories and I/O peripheral devices without interrupting the processor.
NVIC: Nest Vector Interrupt Controller: It handles system wide interrupt and exception for CPU.
WIC: Wake interrupt Controler: Wakes up processor from deep sleep when there is external interrupt trigger.
Peripheral interface: These digital system interface, I2C, SPI, I2S (Audio) that are used to interface with external ICs.
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: It is used to connect low speed interface from sources like I/O controller to internal high speed memory bus.
DEBUG: This is a debug trace port that allows programmer to debug program execution steps.
Popular ARM architectures.
There are generally 3 micro-architecture that is 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
- Real time data processing that is deterministic. In other words, microcontroller will do exactly what you tell it to do and complete data processing within allowed duration.
- Low interrupt latency
- Contains onboard memory and storage. No need to have external memories or storage
- Comprehensive system interfaces. USB, I2C, SPI, I2S (Audio), etc. come standard with modern Microcontroller that can be used to connect with peripheral devices.
Design Analysis
Top criteria when selecting a MCU
- Cost
- Power
- required peripherals
- 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
- NXP LPC series
- STM32 L series
- TI MSP430 series
Summary and Conclusion
- Main benefit is ultra low power, low cost, small size, and low latency (i.e Realtime processing)
- Difference among M0/M3/M4/M4F architectures
- Micro-controller selection guidelines
Microcontroller is essential to data processing with low latency for timing critical applications sound as car collision system, sensor fusions, and external controller. A good engineer must not over design the system with unnecessary cost and high power consumption.