ARM Cortex-M Processor family is an energy-efficient and easy-to-use family of compatible processors designed to help developers meet the needs of future embedded applications. These needs include providing more functions, increasing connections, improving code reuse, and improving energy efficiency at a lower cost. Cortex-M series cost-and power-sensitive MCU and terminal applications (such as intelligent measurement, human-computer interface equipment, automotive and industrial control systems, large household appliances, consumer products and medical devices).
Why choose Cortex-M?
Industry Standard: ARM Cortex-M processor is a global microcontroller standard and has been licensed to more than 40 ARM partners, including leading providers such as NXP Semiconductors, STMicroelectronics, Texas Instruments and Toshiba. Using standard processors allows ARM partners to create devices with a consistent architecture while allowing them to focus on creating excellent device implementations.
Energy efficiency: lower energy consumption and longer battery life
Run at a lower MHz or shorter active time.
Architecture-based sleep mode support.
It is more intelligent and sleep longer than the 8/16-bit device.
--------------------------------------------------------------------------------
Smaller code
Lower Silicon cost
High-density Instruction Sets
More operations per byte than 8/16-bit Devices
Smaller RAM, ROM, or flash requirements
--------------------------------------------------------------------------------
Easy to use
Faster software development and reuse
Global standards between multiple suppliers
Code compatibility
Unified tools and Operating System Support
--------------------------------------------------------------------------------
High Performance
More competitive products
Powerful Cortex-M Processor
Higher performance per MHz
More functions can be implemented with lower energy consumption
Comparison of Cortex-M processors
The Cortex-M series is an ideal solution for various compatible and easy-to-use embedded devices (such as Microcontroller (MCU) that must consider different costs, energy consumption, and performance. Each processor provides the best trade-offs for a wide range of embedded applications.
ARM Cortex-M0
ARM Cortex-M3
ARM Cortex-M4
8/16-bit Application
16/32-bit Application
"32-bit/DSC" Application
Low cost and simplicity
Performance efficiency
Effective Digital Signal Control
The Cortex-M series Processors are both binary and upward compatible, making software reuse and seamless development from one Cortex-M processor to another possible.
ARM Cortex-M Technology
Each Cortex-M series processor has specific advantages, but all of them are supported by some basic technologies that allow the Cortex-M processor to be competent for multiple embedded applications.
CPU Core
Thumb-2 Technology
Optimal mixing of 16/32-bit commands
Code size less than 3 times of the 8-bit Device
No negative impact on performance
Low Energy consumption mode
Nested vector Interrupt Controller)
Integrated sleep status support
Multiple Power Supply Domains
Architecture-based software control
Low latency, low jitter interrupt response
Assembly programming is not required
Interrupt service routine written in pure C Language
Tools and RTOS support
CoreSight debugging and tracking
CMSIS
ARM Cortex microcontroller Software Interface Standard (CMSIS) is a vendor-independent hardware abstraction layer of the Cortex-M processor series. CMSIS allows you to implement consistent and simple processor software interfaces for interface peripherals, real-time operating systems, and middleware, thus simplifying software reuse. CMSIS can shorten the learning process of new microcontroller developers and shorten the time-to-market of new products.
In-depth: Nested vector Interrupt Controller (Objective C)
Objective C is an indispensable part of the Cortex-M processor, which provides excellent interrupt processing capabilities for the processor.
The Cortex-M processor uses a vector table containing the address of the function to be executed for a specific interrupt handler. When an interrupt is accepted, the processor extracts the address from the vector table.
To reduce the number of doors and increase system flexibility, the Cortex-M processor uses a stack-based exception model. When an exception occurs, the system pushes key General registers to the stack. After the import stack and command extraction are completed, the interrupted service routine or fault handling program will be executed, and then the register will be automatically restored to restore the interrupted program to normal execution. With this method, you do not need to write the assembler package (which is required to perform stack operations on traditional interrupt service routines Based on the C language ), this makes application development very easy. Objective C supports interrupt nesting (in the stack) to allow early service for an interrupt by using a higher priority.
Complete interrupt response in hardware
The Cortex-M series processor's interrupt response is the number of cycles from sending the interrupt signal to executing the interrupt service routine. It includes:
- Detection interruption
- Best handling of back-to-back or late interruptions (see below)
- Extract vector address
- Add vulnerable registers to the stack
- Jump to the interrupt handler
These tasks are executed in hardware and included in the interrupt response period reported for the Cortex-M processor. In many other architectures, these tasks must be executed in the Interrupt Processing Program of the software, resulting in latency and complexity of the process.
Tail chain in Objective C
In the case of back-to-back interruption, the traditional system repeats the full state storage and restoration cycle twice, resulting in a higher latency. The Cortex-M processor simplifies the conversion between active and suspended interruptions by implementing the tail link technology in Objective C hardware. The processor state is automatically stored on the interrupt entry and restored upon interruption exit in a period less than the software implementation time, significantly improving the performance of the low MHz system.
Objective C's response to high-priority interruptions late
If you are late for a higher-priority interrupt during the previous interrupt execution stack push period, Objective C immediately extracts a new vector address to provide services for the suspended interrupt, as shown above. Cortex-M risk C provides a deterministic response to these possibilities and supports late arrival and preemption.
Stack pop-up preemption by Objective C
Similarly, if an exception arrives, Objective C will discard the stack pop-up and immediately provide services for the new interrupt, as shown above. By preemptible and switching to the second interrupt without restoring and saving the state, Objective C shortens the latency in a deterministic manner.
Migrate from 8/16-bit to ARM Cortex-M
Advantages of ARM Cortex-M code size
ARM
Compare the code size with the EEMBC CoreMark test.
Instruction width
8-Bit Microcontroller uses 8-bit commands and 32-bit commands based on ARM Cortex-M processor. This is a common misunderstanding. In fact, the PIC18 and PIC16 commands are 16-bit and 14-bit respectively. For the 8051 architecture, although some commands are 1 byte in length, many other commands are 2 or 3 bytes in length. This is usually the case for a 16-bit architecture, where some commands may occupy 6 bytes or more memory.
ARM Cortex-M3 and Cortex-M0 processor leverages ARM Thumb-2 technology that provides excellent code density. With Thumb-2 technology, the Cortex-M processor can support the fundamental foundation of 16-bit Thumb commands that have been extended to include more powerful 32-bit commands. In many cases, the C-language compiler uses 16-bit commands, unless the 32-bit version is used to perform operations more effectively.
Instruction Efficiency
This image is incomplete because ARM Cortex-M processor commands are not considered to be more powerful at the same time. In many cases, a single Thumb command can be equivalent to several 8/16-Bit Microcontroller commands; this means that the Cortex-M device has less code and therefore can complete the same task at a lower bus speed.
Comparison of 16-bit multiplication between different processor architectures
8-digit example
16-bit example
ARM Cortex-M
Mov a, XL; 2 bytes
Mov B, YL; 3 bytes
Mul AB; 1 byte
MOV R0, A; 1 byte
MOV R1, B; 3 bytes
Mov a, XL; 2 bytes
Mov B, YH; 3 bytes
Mul AB; 1 byte
Add a, R1; 1 byte
MOV R1, A; 1 byte
Mov a, B; 2 bytes
Addc a, #0; 2 bytes
MOV R2, A; 1 byte
Mov a, XH; 2 bytes
Mov B, YL; 3 bytes
Mul AB; 1 byte
Add a, R1; 1 byte
MOV R1, A; 1 byte
Mov a, B; 2 bytes
Addc a, R2; 1 byte
MOV R2, A; 1 byte
Mov a, XH; 2 bytes
Mov B, YH; 3 bytes
Mul AB; 1 byte
Add a, R2; 1 byte
MOV R2, A; 1 byte
Mov a, B; 2 bytes
Addc a, #0; 2 bytes
MOV R3, A; 1 byte
MOV R4, & 0130 h
MOV R5, & 0138 h
MOV SumLo, R6
MOV SumHi, R7
(Hardware multiplication unit in which operands are moved in or out of memory ing)
MULS r0, r1, r0
N. B. Cortex-M multiplication actually performs 32-bit multiplication. Here we assume that r0 and r1 contain 16-bit data.
Space occupied by compressed data
It must be noted that the Cortex-M processor supports 8-bit and 16-bit data transmission and can effectively use the data memory. This means that programmers can continue to use the same data types they use in 8/16-bit software.
Energy efficiency advantages
Demand for constantly increasing connections (such as USB, Bluetooth, and IEEE 802.15), products with complex analog sensors (such as accelerometer and touch screen) and ever-decreasing costs, this has led to the need to more closely integrate Analog Devices with digital functions for data preprocessing and transmission. Most 8-bit devices do not provide performance that supports these tasks with no significant increase in MHz (and therefore no significant increase in power, therefore, embedded developers need to find alternative devices with more advanced processor technology. 16-bit devices have previously been used to solve energy efficiency problems in microcontroller applications. However, the relatively low performance of 16-bit devices means that they usually need a long active working cycle or a high clock frequency to complete the same task completed by 32-bit devices.
Make software development easier
The software development of the microcontroller based on ARM Cortex processor may be much easier than the development of the Eight-Bit Microcontroller product. The Cortex processor is not only fully programmable in the C language, but also comes with a variety of advanced debugging features to help locate problems in the software. In addition to all the additional resources included in the MCU development kit, there are a lot of examples and tutorials on the Internet, many of which come from the websites of MCU Vendors Based on ARM processors.