嵌入式系统接口设计与应.ppt
《嵌入式系统接口设计与应.ppt》由会员分享,可在线阅读,更多相关《嵌入式系统接口设计与应.ppt(287页珍藏版)》请在三一办公上搜索。
1、嵌入式系统设计与应用,STM32F103MCU本课程的主要内容,主要内容,Cortex-M3的总结STM32F系列的特点STM32F103系列的特点STM32F103的概述STM32F103的外特性STM32F103的内特性STM32F103的SFRSTM32F103的应用,主要参考资料,STM32F103xxx_Datasheet.pdfSTM32F103xxx_Reference_Manual.pdfSTM32F103xxx_Library_Manual.pdfRVMDK 3.2,Cortex-M3的总结,Cortex-M3的总结CM3NVIC,Cortex-M3的总结,Cortex-M3
2、的特性Cortex-M3 block diagram,Cortex-M3的总结,Cortex-M3的特性Processor coreARMv7-M architecture.The main features:Thumb-2 instruction set subset.Harvard Architecture with data load/store.Three-stage pipeline.Single cycle 32-bit multiply.Hardware divide.Thumb and Debug states.Handler modes and Thread modes.wi
3、thout the overhead of state saving and restoration between interrupts.Interruptible-continued LDM/STM,PUSH/POP.ARMv6 compatible BE8 and LE access support.ARMv6 compatible unaligned access support.,Cortex-M3的总结,Cortex-M3的特性Processor coreARMv7-M architecture.The main features:Low latency ISR entry and
4、 exit.Processor state saving and restoration,with no instruction fetch overhead.Exception vector is fetched from memory in parallel with the state saving,enabling faster ISR entry.Support for late arriving(迟来)interrupts.Tightly coupled interface to interrupt controller enabling efficient processing
5、of late-arriving(迟来)interrupts.Tail-chaining(尾连)of interrupts,enabling back-to-back(背靠背)interrupt processing,Cortex-M3的总结,Cortex-M3的特性Processor coreRegisters The processor contains:13 general purpose 32-bit registers,R0 to R12Link Register(LR)-R14Program Counter(PC)-R15Program Status Register,xPSRtw
6、o banked SP registers.-R13,Cortex-M3的总结,Cortex-M3的特性Processor coreMemory interfaceThe processor has a Harvard interface to enable simultaneous instruction fetches with data load/stores.Memory accesses are controlled by:A separate Load Store Unit(LSU)that decouples load and store operations from the
7、Arithmetic and Logic Unit(ALU).A 3-word entry Prefetch Unit(PFU).One word is fetched at a time.This can be two Thumb instructions:one word-aligned Thumb 32-bit instruction;the upper/lower halfword of a halfword-aligned Thumb 32-bit instruction with one Thumb instruction,or the lower/upper halfword o
8、f another halfword-aligned Thumb 32-bit instruction.,Cortex-M3的总结,Cortex-M3的特性Processor coreNVICThe NVIC is tightly coupled to the processor core.This facilitates low latency exception processing.The main features include:a configurable number of external interrupts,from 1 to 240a configurable numbe
9、r of bits of priority,from three to eight bitslevel and pulse interrupt supportdynamic reprioritization of interruptspriority groupingsupport for tail-chaining of interruptsprocessor state automatically saved on interrupt entry,and restored on interrupt exit,with no instruction overhead.,Cortex-M3的总
10、结,Cortex-M3的特性Processor coreBus matrixThe bus matrix connects the processor and debug interface to the external buses.The bus matrix interfaces to the following external buses:ICode bus.This is for instruction and vector fetches from code space,it is a 32-bit AHB-Lite bus.DCode bus.This is for data
11、load/stores and debug accesses to code space.it is a 32-bit AHB-Lite bus.System bus.This is for instruction and vector fetches,data LD/ST and debug accesses to system space.This is a 32-bit AHB-Lite bus.PPB.This is for data LD/ST and debug accesses to PPB space.This is a 32-bit APB(v3.0)bus.,Cortex-
12、M3的总结,Cortex-M3的特性Processor coreBus matrixThe bus matrix also controls the following:Unaligned accesses.The bus matrix converts unaligned processor accesses into aligned accesses.Bit-banding.The bus matrix converts bit-band alias accesses into bit-band region accesses.It performs:bit field extract f
13、or bit-band loads;atomic read-modify-write for bit-band stores.Write buffering.The bus matrix contains a one-entry write buffer to decouple bus stalls from the processor core.,Cortex-M3的总结,Cortex-M3的特性Processor coreDWTYou can configure the implementation to include a DWT.If present,you can configure
14、 the DWT to incorporate the following debug functionality:four comparators that you can configure either as a hardware watchpoint,an ETM trigger,a PC sampler event trigger,or a data address sampler event triggerseveral counters or a data match event trigger for performance profiling(性能分析)configurabl
15、e to emit PC samples at defined intervals,and to emit interrupt event information.,Cortex-M3的总结,Cortex-M3的特性Processor coreETMYou can configure the system at implementation to include an ETM.This is a low-cost trace macrocell that supports instruction trace only.WICYou can configure the implementatio
16、n to include a Wake-up Interrupt Controller(WIC).,Cortex-M3的总结,Cortex-M3的编程模式About the programmers modelThe processor architecture is the ARMv7-M.Instructions architecture is the Thumb-2.Operating modes:The processor supports two modes of operation,Thread mode and Handler mode:Thread mode is entered
17、 on Reset,and can be entered as a result of an exception return.Privileged and User(Unprivileged)code can run in Thread mode.Handler mode is entered as a result of an exception.All code is privileged in Handler mode.,Cortex-M3的总结,Cortex-M3的编程模式About the programmers modelOperating statesThe processor
18、 can operate in one of two operating states:Thumb-2 state.This is normal execution running 16-bit and 32-bit halfword aligned Thumb instructions.Debug State.This is the state when in halting debug.,Cortex-M3的总结,Cortex-M3的编程模式Privileged access and user accessCode can execute as privileged or user:Use
19、r(Unprivileged)execution limits or excludes access to some resources.Privileged execution has access to all resources.Handler mode is always privileged.Thread mode can be privileged or unprivileged.When Thread mode has been changed from privileged to user,it cannot change itself back to privileged.O
20、nly a Handler can change the privilege of Thread mode.Handler mode is always privileged.,Cortex-M3的总结,Cortex-M3的编程模式Privileged access and user accessMain stack and process stackOut of reset,all code uses the main stack.An exception handler such as SVC can change the stack used by Thread mode from ma
21、in stack to process stack by changing the EXC_RETURN value it uses on exit.All exceptions continue to use the main stack.The stack pointer,r13,is a banked register that switches between SP_main and SP_process.Only one stack,the process stack or the main stack,is visible,using r13,at any time.It is a
22、lso possible to switch from main stack to process stack while in Thread mode by writing to CONTROL1 using the MSR instruction,in addition to being selectable using the EXC_RETURN value from an exit from Handler mode.,Cortex-M3的总结,Cortex-M3的编程模式RegistersThe processor has the following 32-bit register
23、s:13 general-purpose registers,r0-r12Stack point alias of banked registers,SP_process and SP_mainLink register,r14Program counter,r15One program status register,xPSR.Figure shows the processor register set.,Cortex-M3的总结,Cortex-M3的编程模式RegistersThe processor has the following 32-bit registers:13 gener
24、al-purpose registers,r0-r12Stack point alias of banked registers,SP_process and SP_mainLink register,r14Program counter,r15One program status register,xPSR.Figure shows the processor register set.,Cortex-M3的总结,Cortex-M3的编程模式RegistersGeneral-purpose registersThe general-purpose registers r0-r12 have
25、no special architecturally-defined uses.Most instructions that can specify a general-purpose register can specify r0-r12.Low registers Registers r0-r7 are accessible by all instructions that specify a general-purpose register.High registers Registers r8-r12 are accessible by all 32-bit instructions
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 嵌入式 系统 接口 设计
链接地址:https://www.31ppt.com/p-6415002.html