1ARM Cortex-M3IntroductionARM University Relations
10Cortex-M3 Register SetVery compiler friendlyLoad/Store Architecture32-bit registersFlexible register schemeLinear 32-bit address spaceProcessr8
11Program Status RegisterOne Status Register consisting ofAPSR-Application Program Status Register–ALU flagsIPSR-Interrupt Program Status Register–
12High PerformanceARM processorHigh-bandwidthon-chip RAMHighBandwidthExternalMemoryInterfaceDMABus MasterAPBBridgeKeypadUARTPIOTimerAHBAPBHigh Perform
13Memory MapVery simple linear 4GB memory mapThe Bus Matrix partitions memory access via the AHB and PPB busesDebugSYSTEM AHBThe image cannot be dis
14NXP LPC1311/13/42/43 Block Diagram
15NXP LPC1311/13/42/43 Memory Map
16ARM Cortex-M3Application codeOSSystem Call (SVCall)Undefined InstructionPrivilegedProcessor PrivilegeMemoryInstructions & DataAbortsInterruptsRe
17Memory Protection Unit (MPU)MPU provides access control for various memory regionsZero Latency Memory Protection8 register-stored regionsSame re
18Traditional Method of Atomic Manipulation00000000xxxxx1xx00000100Read byte from SRAMMask and ModifyBit ElementWrite byte to SRAM0x020000000x02000000
19Word aliasPhysical bit32MBBit band alias32MB31MB1MBBit band regionBit band alias32MB31MB1MBBit band regionWrites to a word address in thebit band a
2AgendaCortex-M3 Overviewv7-M Architecture/Programmers ModelData Path and PipelinesTools and mbed Platform
20Conditional ExecutionITTET EQInst 1Inst 2Inst 3Inst 4If–Then (IT) instruction added (16 bit)Up to 3 additional “then” or “else” conditions maybe s
21Interrupt HandlingOne Non-Maskable Interrupt (INTNMI) supported1-240 prioritizable interrupts supportedInterrupts can be maskedImplementation op
22Exception HandlingResetNMIFaultsHard FaultMemory ManageBus FaultUsage FaultSVCallDebug MonitorPendSVSysTick InterruptExternal Interrupt
23Multiple sleep modes supportedControlled by NVICSleep Now–Wait for Interrupt/Event instructionsSleep On Exit–Sleep immediately on return from la
24Single steppingITM (Instrumentation Trace Module)Support for instrumented codeLike “printf” debugging, but single cycle writes to ITM module can
25AgendaCortex-M3 Overviewv7-M Architecture/Programmers ModelData Path and PipelinesTools and mbed Platform
26Cortex-M3 DatapathRegisterBankMul/DivAddressIncrementerALUBAINTADDRI_HADDRAddressRegisterBarrelShifterWritebackALURead DataRegisterWrite DataRegiste
27Cortex-M3 has 3-stage fetch-decode-execute pipelineSimilar to ARM7Cortex-M3 does more in each stage to increase overallperformanceCortex-M3 Pipel
28CycleOperationADDSUBORRANDEORORROptimal PipeliningAll operations here are on registers (single cycle execution)In this example it takes 6 clock cy
29It takes 3 cycles to complete the branchWorst case scenario–indirect branch takenCycleAddressOperation0x8000BX r50x8002SUB0x8FEEORR0x8FECAND0x8FF0
3Microcontrollers are gettingcheap32-bit ARM Cortex-M3 Microcontrollers @ $1Some microcontrollers sell for as little as $0.65Microcontrollers are
30In this example it takes 7 clock cycles to execute 6 instructionsClock cycles per Instruction (CPI) = 1.2The read cycle must complete on the bus
31Store buffer allows STR instruction to finish before storecycle completes on the busBack-to-back STR instructions pipeline on the AHB-Lite bus-Als
32AgendaCortex-M3 Overviewv7-M Architecture/Programmers ModelData Path and PipelinesTools and mbed Platform
33RVMDK Software Development ToolsIncludes ARM macro assembler, compilers (ARM RealView C/C++Compiler, Keil CARM Compiler, or GNU compiler), ARM link
34RVMDK Software Development Tools
35Cortex-M3 Development Platforms
36Rapid Prototyping3D Moulding3D Printing2D/3D DesignWeb FrameworksRapid Prototyping helps industries create new productsControl, communication and
37Getting Started and Rapid Prototyping with ARM MCUsComplete Targeted Hardware, Software and Web 2.0 PlatformmbedLightweight Online CompilerCortex-M3
38mbed Motor Controller Example#include"mbed.h“DigitalOutleftfwd(p16);DigitalOutleftrev(p17);PwmOutpwm(p21);AnalogInpot(p20);intmain(){pwm.period
39DocumentationARM v7-M Architecture Reference Manual (ARM v7-MARM)Cortex-M3 Technical Reference Manual (TRM)ARM Debug Interface V5 Architecture Sp
4ARM Cortex-M3 ProcessorFPBBKPTARMCortex-M3CoreETMInstructionTraceBus MatrixIDDAPJTAG/SWDNVIC1-240 Interrupts8-256 PrioritiesCode Busesto Flashto Code
40University Resourceshttp://www.arm.com/support/university/[email protected]http://www.mbed.org/http://www.keil.com/
518 x 32-bit registersExcellent compiler targetReduced pin count requirementsEfficient interrupt handlingPower managementEfficient debug and dev
6ARMv7M ArchitectureNo Cache-No MMUDebug is optimized for microcontroller applicationsVector table contains addresses, not instructionsDIV instru
7ARM and Thumb PerformanceMemory width (zero wait state)05000100001500020000250003000032-bit16-bit16-bit with32-bit stackARMThumbDhrystone 2.1/sec@ 20
8The Thumb-2 instruction setVariable-length instructionsARM instructions are a fixed length of 32 bitsThumb instructions are a fixed length of 16bi
9AgendaCortex-M3 Overviewv7-M Architecture/Programmers ModelData Path and PipelinesTools and mbed Platform
Commentaires sur ces manuels