Cortex-M – the Standard Architecture for MCU Applications
Total Page:16
File Type:pdf, Size:1020Kb
Cortex-M – The Standard Architecture for MCU Applications Andy Luo Embedded Marketing Manager [email protected] 1 Market Challenges . More features at lower cost . Increasing connectivity (e.g. USB, Ethernet, 802.15, NFC) . Drive for better code reuse . Analog devices with increasing processing and communication . Energy efficiency . Wireless sensors, motor control, metering . 8/16-bit running out of performance headroom . As complexity rises so does frequency and memory requirement 2 Market Migration to 32-bit Gathering Momentum . Algorithm complexity increasing . Integration of multiple functionality into single processing subsystem . “Black box” systems starting to include networking connectivity . Energy efficiency becoming increasingly important . Assembler programming replaced with C 3 Cortex-M Processor Family . Seamless embedded architecture . Spanning cost and performance points ARM Cortex-A Series: Applications processors for feature-rich OS and user applications ARM Cortex-R Series: Embedded processors for real-time signal processing and control applications ARM Cortex-M Series: Deeply embedded processors optimized for microcontroller and low-power applications 4 Cortex-M Processor Solution . Energy efficiency Low power implementation Sleep mode support . Lower energy costs Wake-up Interrupt Controller Increased intelligence at node . Ease of use Broad tools and OS support Binary compatible roadmap . Lower software costs Pure C target . High performance 32-bit RISC architecture Competitive products High efficiency processor cores . Integrated Interrupt Controller (NVIC) . Reduced system cost Thumb-2 code density . Lower silicon costs Area optimised designs CoreSight support 5 Spanning the Application Range . Forget traditional 8-/16-/32-bit classifications . Seamless architecture across all applications Cortex-M0 Cortex-M3 Cortex-M4 “8/16-bit” applications “16/32-bit” applications “32-bit/DSP” applications Ultra-low power MCU plus DSP Performance efficiency Low cost High efficiency Feature-rich connectivity Optimised connectivity Accelerated SIMD, FP & DSP 6 Addressing Proprietary MCU Space Cortex-M0 Cortex-M3 Cortex-M4 Renesas SuperH Renesas H8 8051 Microchip dsPIC TI MSP430 Atmel AVR32 Freescale HCS08 TI C2000 Infineon C166 Microchip PIC32 Microchip PIC18 AVR8 Microchip PIC24 Renesas SuperH Infineon C166 Freescale 58xxx TI MSP430 Atmel AVR32 7 Cortex-M License Growth 8 Embedded Shipment based on ARM Unit:Million 9 Instruction Set Architecture PKH QADD QADD16 QADD8 QASX QDADD QDSUB QSAX QSUB QSUB16 QSUB8 SADD16 SADD8 SASX SEL SHADD16 SHADD8 SHASX SHSAX SHSUB16 SHSUB8 SMLABB SMLABT SMLATB SMLATT SMLAD SMLALBB SMLALBT SMLALTB ADC ADD ADR AND ASR B CLZ SMLALTT SMLALD BFC BFI BIC CDP CLREX CBNZ CBZ CMN SMLAWB SMLAWT CMP DBG EOR LDC SMLSD SMLSLD LDMIA BKPT BLX ADC ADD ADR LDMDB LDR LDRB SMMLA SMMLS LDRBT BX CPS AND ASR B LDRD LDREX LDREXB SMMUL SMUAD LDREXH DMB BL BIC LDRH LDRHT LDRSB SMULBB SMULBT LDRSBT DS B CMN CMP EOR LDRSHT LDRSH LDRT SMULTB SMULTT MCR ISB LDR LDRB LDM LSL LSR MLS SMULWB SMULWT MCRR MRS LDRH LDRSB LDRSH MLA MOV MOVT SMUSD SSAT16 MRC MSR LSL LSR MOV MRRC MUL MVN SSAX SSUB16 NOP NOP REV MUL MVN ORR ORN ORR PLD SSUB8 SXTAB PLDW REV16 REVSH POP PUSH ROR PLI POP PUSH SXTAB16 SXTAH RBIT SEV SXTB RSB SBC STM REV REV16 REVSH SXTB16 UADD16 ROR SXTH UXTB STR STRB STRH RRX RSB SBC UADD8 UASX SBFX UXTH WFE SUB SVC TST SDIV SEV SMLAL UHADD16 UHADD8 SMULL WFI YIELD CORTEX-M0/M1 SSAT STC STMIA UHASX UHSAX STMDB STR STRB STRBT UHSUB16 UHSUB8 STRD STREX STREXB STREXH STRH STRHT STRT UMAAL UQADD16 SUB SXTB SXTH TBB TBH TEQ TST UQADD8 UQASX UBFX UDIV UMLAL UMULL USAT UXTB UXTH UQSAX UQSUB16 WFE WFI YIELD IT CORTEX-M3 UQSUB8 USAD8 USADA8 USAT16 USAX USUB16 USUB8 UXTAB UXTAB16 UXTAH UXTB16 MERLIN VABS VADD VCMP VCMPE VCVT VCVTR VDIV VLDM VLDR VMLA VMLS VMOV VMRS VMSR VMUL VNEG VNMLA VNMLS VNMUL VPOP VPUSH VSQRT VSTM VSTR VSUB MERLIN-FP 10 Nested Vectored Interrupt Controller . Faster interrupt response 8051 Cortex‐M . With less software effort 1)SJMP/L JMP from vector 1) Starting real handler code table to handler 2)PUSH PSW 3)ORL PSW, #00001000b (to switch register bank) . ISR written directly in C 4)Starting real handler code . Pointer to C routine at vector . ISR is a C function . Integrated NVIC handles: . Saving corruptible registers . Exception prioritization . Exception nesting 11 Ultra Low Power . ARM Cortex-M processors optimized for low power . Architected support for sleep states and WIC . Excellent results with ARM Physical IP . Using PMK, leakage is as low as 7nA leakage in state retention mode Cortex-M0 sleep mode leakage (nanow atts) 700 12x 50x 600 reduction reduction 500 400 300 200 100 0 180G 180ULL 180ULL PMK 12 ARM MCU Into “Sub 1 USD” Zone 13 ARM Cortex-M0 Processor . The smallest, lowest power ARM processor . A third of the area and power of ARM7TDMI-S™ processor . 12K gates, 47 μA/MHz on 180ULL in minimal configuration* . 0.9 DMIPS/MHz performance . Significant advantages over 8/16-bit . Longer battery life through energy efficiency . Reduced system cost through code density . Performance headroom for advanced features . Extends ARM architecture to new applications . Ultra low-power MCU and mixed-signal devices . Ideal sequencer or FSM replacement on SoC . Binary and tools upwards compatible with Cortex-M3 processor 14 Efficiency with µA to spare . Extremely low power leakage and operation . 67 µA/MHz active, 7nA state retention in full configuration* . Reduced Flash access and no speculative fetches . Significant energy efficiency advantage over 8/16-bit . Over 2-4x shorter duty cycle than MSP430 and PIC18** . Working smarter, sleeping longer Active power µA/MHz . Ideal in power optimized designs 300 250 200 150 100 * Using ARM Physical IP with PMK on 180ULL for Available your device MSP430 process at 1.8V - ARM Cortex-M0 in full 50 PIC18L configuration (32 interrupts, fast mul, debug) M0 0 ** Based on benchmarks in public domain. Data from pubic websites 15 ARM Cortex-M0 Application Medical Consumer peripherals Remote Sensors . Touch screen controller . Accelerometer . GPS / Bluetooth . Battery monitor . Joystick/touchpad controller 16 Performance Comparison 17 Code Size Comparison 53% 51% 49% 44% 16% 18 Cortex-M4 Extends MCU Range . Merlin expands opportunities up and to the right . Leverages all existing Cortex-M technology, capabilities, benefits . Adds differentiating signal processing technology, floating point Signal Cortex-M Processing Ease of use Cortex-M4 Single Cycle MAC C Programming Integer SIMD Interrupt handling Floating Point Ultra low power Hardware Divide “Many components that were once reported as ‘DSP chips’ are no longer. Rather, they are reported as systems on chip (SoC) in categories like ASICs or ASSPs.” – Will Strauss, Forward Concepts 19 Cortex-M4 Processor Details . ARMv7M architecture . Thumb-2 technology . ARMv6 SIMD and DSP . Single cycle MAC (Up to 32 x 32 + 64->64) . Optional decoupled single precision FPU . Integrated configurable NVIC . Compatible with Cortex-M3 processor . Microarchitecture . 3-stage pipeline with branch speculation . 3x AMBA AHB-Lite Bus Interfaces Dotted boxes denote optional blocks . Configurable for ultra low power . Deep Sleep Mode, Wakeup Interrupt Controller . Power down features for Floating Point Unit . Flexible configurations for wider applicability . Configurable Interrupt Controller (1-240 Interrupts and Priorities) . Optional Memory Protection Unit, Optional Debug & Trace 20 Cortex-M4 major target markets features Motor control Audio Saturating math 16-bit SIMD Single cycle MAC 32 x 32 MAC Floating point Very low mW/MHz Power management Leading 32-bit arch Efficiency Low power Industrial Automation Automotive >250MHz in 90nm Interrupt management High efficiency Memory protection Small footprint Determinism 21 Cortex Microcontroller Standard . Cortex Microcontroller Software Interface Standard (CMSIS) . Abstraction layer for all Cortex-M processor-based devices . CMSIS 2.0: Cortex-M4 support for SIMD . CMSIS-SVD: XML peripheral debug description . Benefits to the embedded developer . Consistent software interfaces for silicon and middleware vendors . Simplifies re-use across Cortex-M processor-based devices . Reduces learning curve, development costs, and time-to-market 22 Keil Microcontroller Development Tools 23 mbed – Rapid Prototyping for MCUs . Building an online developer platform . Gets new users started with ARM within 60 seconds . Enables developers to quickly prototype new products . Adoption highlights Published Programs . User base and community activity growing quickly 800 600 . Developers sharing code: 500+ published programs 400 . Ecosystem growing: baseboards, books, workshops 200 0 Q30909Q3 Q409 09Q4 Q110 10Q1 Q210 10Q2 . Won EDN Innovation Award . Winner of EDN Innovation award for tools . Recognition in first 6 months: a great endorsement Winner 2009 24 Conclusions . Spanning the spectrum of embedded applications . Hardware and software compatibility and reuse . Energy efficiency . Lower energy costs and longer battery life . High performance . Competitive products . Reduced system cost . Lower silicon costs and superior code density 25.