arm cortex core microcontrollers

42
© BME-MIT 2018 Budapest University of Technology and Economics Department of Measurement and Information Systems ARM Cortex core microcontrollers 3. Cortex-M0, M4, M7 Scherer Balázs

Upload: others

Post on 18-Dec-2021

23 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ARM Cortex core microcontrollers

© BME-MIT 2018Budapest University of Technology and EconomicsDepartment of Measurement and Information Systems

ARM Cortex core microcontrollers3. Cortex-M0, M4, M7

Scherer Balázs

Page 2: ARM Cortex core microcontrollers

© BME-MIT 2018 2.

Trends of 32-bit microcontrollers 2003-2017

Flash [kbyte]

Pin count

M0 M3M0,M0+ M4, M3M3, M0

10245122561286432168421

0,58 14-16 20 28-32-36 40-44-48 64 80-100 144 208 256

Page 3: ARM Cortex core microcontrollers

© BME-MIT 2018 3.

ARM Cortex-M cores

o M0, M0+: Ultra low power

• Very simple

• 85 uW/MHz

o M1: design for FPGA

o M3: General purpose microcontroller

o M4: DSP instructions

o M7: more faster than M4, superscalar, cache

Page 4: ARM Cortex core microcontrollers

© BME-MIT 2018 4.

ARM Cortex-M0

Page 5: ARM Cortex core microcontrollers

© BME-MIT 2018 5.

A Cortex-M0 core

32-bit core, 2 stage pipeline

Neumann architectureo Very simple

ARMv6-M architectureo 16-bit Thumb instruction set extended with some Thumb-2 instructions

Page 6: ARM Cortex core microcontrollers

© BME-MIT 2018 6.

ARM7, Cortex-M3, M0 comparison:bus systems

ARM7TDMI Cortex-M3 Cortex-M0

Page 7: ARM Cortex core microcontrollers

© BME-MIT 2018 7.

Registers

Similar to other ARM Cortex cores

o R0 – R3: C subroutine parameters

o R0 ( R1 ) return values

o R4 – R11 local register variables

o R12 Intra-Procedure-call

o R13 Stack Pointer

o R14 Link Register

o R15 Program Counter

Page 8: ARM Cortex core microcontrollers

© BME-MIT 2018 8.

Memory map

Compatible with M3

Page 9: ARM Cortex core microcontrollers

© BME-MIT 2018 9.

Operation modes

Same as M3

oHandler and Thread mode

Page 10: ARM Cortex core microcontrollers

© BME-MIT 2018 10.

Instruction set

Thumb-2

o The modernization of the old Thumb instruction set. Reduced number of instructions 56 pieces. Granted execution speed.

o The instruction set of Cortex M0 can be used by any other Cortex M core.

o 0,9 DMIPS/MHz

Page 11: ARM Cortex core microcontrollers

© BME-MIT 2018 11.

Cortex-M0 and M3 instruction set comparison

Page 12: ARM Cortex core microcontrollers

© BME-MIT 2018 12.

Cortex-M0 core performance

Page 13: ARM Cortex core microcontrollers

© BME-MIT 2018 13.

NVIC, Nested Vector Interrupt Controller

Very Similar to the one in Cortex M3

Maximum 32 external vectors

Staring Stack pointer at 0x0

4 priority levels

Page 14: ARM Cortex core microcontrollers

© BME-MIT 2018 14.

Cortex-M0, core level power modes

Very low pin count WIC blocko Possible to wake-up from deep

sleep

Sleepo The CPU clock stops, the whole

NVIC remains active

Deep sleepo Only the WIC remains active,

the core and NVIC stops

WIC wakes-up the system through the PMU (Power Management Unit)

Page 15: ARM Cortex core microcontrollers

© BME-MIT 2018 15.

Cotex M0+

Optimized version of Cortex M0

o Pipeline reduced to 2 stage

o Micro Trace Buffer possibility (simplified instruction trace)

o Optional memory protection unit

o Optional vector table relocation

o On clock cycle I/O port handling

o 13,3 µW/MHz (M0) -> 11,2 µW/MHz (M0+)

• (32 µW/MHz (M3))

Page 16: ARM Cortex core microcontrollers

© BME-MIT 2018 16.

ARM Cortex-M4

Page 17: ARM Cortex core microcontrollers

© BME-MIT 2018 17.

Cortex-M4 Cortex-M4 processor

o Thumb-2 instruction seto DSP and SIMD instructionso One clock cycle MAC (32 x 32 + 64 ->

64)o Optional single precision FPU o Code compatible with M3

1,27 / 1,55 / 1,95 DMIPS/MHz Architecture

o 3 phase pipeline with branch prediction

o 3x AHB-Lite Bus Interface

Power safe modeso Deep Sleep Mode, Wakeup ITo Power down options for the FPU

NVIC (1-240 IT and priority) Memory Protection Unit Debug & Trace

Page 18: ARM Cortex core microcontrollers

© BME-MIT 2018 18.

Cortex-M4 instruction set

Page 19: ARM Cortex core microcontrollers

© BME-MIT 2018 19.

SIMD (Single Instruction Multiple Data)

Performing the same operations to many variable in one cycle

Using compressed 16-bit variables

Page 20: ARM Cortex core microcontrollers

© BME-MIT 2018 20.

One clock cycle MAC instructions

Page 21: ARM Cortex core microcontrollers

© BME-MIT 2018 21.

Cortex-M4 instruction set

Page 22: ARM Cortex core microcontrollers

© BME-MIT 2018 22.

Cortex-M4 FIR filter

Using a DSP with assembly code: 1 cycle

Cortex-M4 standard C code: 12 cycle

Optimized C code: 6 cycle

Assembly using SIMD instructions to 16-bit variables: 2-3 cycles

Optimized assembly code 1,5-2 cycle

Nearly the same performance as a DSP.

Page 23: ARM Cortex core microcontrollers

© BME-MIT 2018 23.

Cortex-M3, M4 comparison:16-bit arithmetic

Page 24: ARM Cortex core microcontrollers

© BME-MIT 2018 24.

Foating point unit

IEEE 754 standard based

Capabilities:

Page 25: ARM Cortex core microcontrollers

© BME-MIT 2018 25.

DSP Library support

CMSIS DSP library

o Basic mathematic operations: vector operations

o Trigonometrical operations: sin, cos, sqrt stb.

o Interpolation: linear, bilinear

o Complex math:

• Statistics: max, min, RMS etc.

• Filtering: IIR, FIR, LMS etc.

• Transformations: FFT

• Matrix operations

• PID controller

Page 26: ARM Cortex core microcontrollers

© BME-MIT 2018 26.

ARM Cortex-M7

Page 27: ARM Cortex core microcontrollers

© BME-MIT 2018 27.

Cortex-M7 ARMv7-M architecture Built-in Floating point unit 6 stage pipeline

o superscalaro branch prediction

2,14 – 3,23 DMIPS/MHz 0 – 64 kB 2 way instruction

cache 0 – 64kB 4 way data cache 8 or 16 region MPU ECC Error correcting code Lock-step possibility

Page 28: ARM Cortex core microcontrollers

© BME-MIT 2018 28.

M7 instruction set

Page 29: ARM Cortex core microcontrollers

© BME-MIT 2018 29.

M7 pipeline

6 stage superscalar pipelineo Two shifter, ALUo One MACo One floating point pipe

Page 30: ARM Cortex core microcontrollers

© BME-MIT 2018 30.

Tightly-coupled memory (TCM)

Small latency memory, used for predictable, and real-time critical code. Do not have the unpredictability like the cache.

16 Mbyte both for instruction and data (instruction64-bit bus, data 2x32-bit bus).

Page 31: ARM Cortex core microcontrollers

© BME-MIT 2018 31.

Performance of Cortex M7

Page 32: ARM Cortex core microcontrollers

© BME-MIT 2018 32.

DSP functionality Comparing to M4 CMSIS library support

Page 33: ARM Cortex core microcontrollers

© BME-MIT 2018 33.

Microcontrollers on the market

Page 34: ARM Cortex core microcontrollers

© BME-MIT 2018 34.

NXP lines

Page 35: ARM Cortex core microcontrollers

© BME-MIT 2018 35.

NXP lines

Page 36: ARM Cortex core microcontrollers

© BME-MIT 2018 36.

ST lines

Page 37: ARM Cortex core microcontrollers

© BME-MIT 2018 37.

Curiosity

Page 38: ARM Cortex core microcontrollers

© BME-MIT 2018 38.

LPC4300 family Cortex-M4 based Digital Signal Controller Cortex-M0 subsystem for peripheral functions max. 1 MByte Flash

o Organised into two banks Flash

Max. 200 kbyte SRAM High speed USB Features

o 10/100 Ethernet MACo LCD panel controller (max. 1024H × 768V)o 2x10-bit ADC and 10-bit DAC at 400 kspso 8 channel DMA controllero Motor Control PWM, Quadrature Encodero 4x UARTs, 2x I2C, I2S, CAN 2.0B, 2x SSP/SPI

Page 39: ARM Cortex core microcontrollers

© BME-MIT 2018 39.

LPC4300 internal architecture

Page 40: ARM Cortex core microcontrollers

© BME-MIT 2018 40.

Cortex-M4 and Cortex-M0 in one chip

Processing and real-time control is separable

Individual interrupt capability

Sharing data through common memory

Page 41: ARM Cortex core microcontrollers

© BME-MIT 2018 41.

Cortex-M0 and M4 together in audio aplications

Cortex-M0: peripheral tasks: I2S, USB

Cortex-M4: signal processing

Page 42: ARM Cortex core microcontrollers

© BME-MIT 2018 42.

Motor control example

Cortex-M4: Motor control Field Oriented Control (FOC)

Cortex-M0: CAN communication handling