systick 理解

systick 中断的优先级往往设置为最低值,而不是最高值;如果设置为最低值不会发生上图标号[6]处的情况,设置为最低可能会被其他中断抢占,延长systick的响应时间,但是这个延迟不会累计,因为systick的周期是固定的。举个例子,比如tick是1s一次,假设中断被抢占后会延迟tick中断响应100ms,那么心跳的时钟节拍由1s 2s 3s 4s 5s 6s 变成了1s <抢占> 2.1s 3.1s 4.1s 5.1s 6.1s,之后再抢占一次就变成了 1s 2.1s <抢占> 3.2s 4.2s 5.2s 6.2s,之后再抢占一次就变成了 1s 2.1s 3.2s <抢占> 4.3s 5.3s 6.3s,心跳间隔永远是均匀的1s。
大小端:

寄存器:
R0-R12: can be used during common operations to store temporary values, pointers (locations to memory), etc. R0, for example, can be referred as accumulator during the arithmetic operations or for storing the result of a previously called function. R7 becomes useful while working with syscalls as it stores the syscall number and R11 helps us to keep track of boundaries on the stack serving as the frame pointer (will be covered later). Moreover, the function calling convention on ARM specifies that the first four arguments of a function are stored in the registers r0-r3.
R0-R12:可以在常见操作中用于存储临时值、指针(内存位置)等。例如,R0可以在算术运算期间作为累加器引用,也可以用于存储先前调用的函数的结果。R7在处理系统调用时非常有用,因为它存储系统调用号,R11帮助我们跟踪堆栈上的边界,作为帧指针(稍后将介绍)。此外,ARM上的函数调用约定指定函数的前四个参数存储在寄存器r0-r3中。
R13: SP (Stack Pointer). The Stack Pointer points to the top of the stack. The stack is an area of memory used for function-specific storage, which is reclaimed when the function returns. The stack pointer is therefore used for allocating space on the stack, by subtracting the value (in bytes) we want to allocate from the stack pointer. In other words, if we want to allocate a 32 bit value, we subtract 4 from the stack pointer.
R13: SP(堆栈指针)。堆栈指针指向堆栈的顶部。堆栈是用于特定于函数的存储的内存区域,该区域在函数返回时被回收。因此,堆栈指针用于在堆栈上分配空间,方法是从堆栈指针中减去我们想要分配的值(以字节为单位)。换句话说,如果我们想分配一个32位的值,我们从堆栈指针中减去4。
R14: LR (Link Register). When a function call is made, the Link Register gets updated with a memory address referencing the next instruction where the function was initiated from. Doing this allows the program return to the “parent” function that initiated the “child” function call after the “child” function is finished.
R14: LR(链路寄存器)。当函数调用时,链接寄存器会更新一个内存地址,该内存地址引用的是函数发起的下一条指令。这样做允许程序在“子”函数完成后返回到发起“子”函数调用的“父”函数。
R15: PC (Program Counter). The Program Counter is automatically incremented by the size of the instruction executed. This size is always 4 bytes in ARM state and 2 bytes in THUMB mode. When a branch instruction is being executed, the PC holds the destination address. During execution, PC stores the address of the current instruction plus 8 (two ARM instructions) in ARM state, and the current instruction plus 4 (two Thumb instructions) in Thumb(v1) state. This is different from x86 where PC always points to the next instruction to be executed.
R15: PC(程序计数器)。程序计数器会根据执行指令的大小自动递增。这个大小在ARM状态下总是4个字节,在THUMB模式下总是2个字节。当分支指令正在执行时,PC保存着目的地址。在执行过程中,PC在ARM状态下存储当前指令加8(两条ARM指令,因为流水线,预取址)的地址,在Thumb(v1)状态下存储当前指令加4(两条Thumb指令)的地址。这与x86不同,在x86中PC总是指向下一条要执行的指令。
systick 理解的更多相关文章
- (STM32F4) SysTick理解使用
關於Cortex System Timer (Systick) 網上隨便google就可以找到許多相關範例. 他就是ARM提供的一個24-bit的下數(count-down)計時器我看大部分應用都是提 ...
- systick优先级的理解
sysTick系统嘀嗒定时器并非STM32独有的,它是Cortex内核的部分,CM3为它专门开出一个异常类型,并且在中断向量表中占有一席之地(异常号15).这样它可以很方便的移植到不同厂商出CM3内核 ...
- STM32学习笔记(六) SysTick系统时钟滴答实验(stm32中断入门)
系统时钟滴答实验很不难,我就在面简单说下,但其中涉及到了STM32最复杂也是以后用途最广的外设-NVIC,如果说RCC是实时性所必须考虑的部分,那么NVIC就是stm32功能性实现的基础,NVIC的难 ...
- STM32学习笔记(四) RCC外设的学习和理解
RCC时钟模块并不好理解,初次接触我也是一头雾水,而且我真正掌握它的时候也比较晚,是我在学习uC/os-II,需要分析时钟时才有了深刻认识.但在学习中我却一定要把放在了前列,因为这是整个嵌入式最重要的 ...
- stm32f10x.h文件分析理解
今天再看过半年前自己写的这篇发现自己当时理解有误,stm32f10x.h与库开发并未存在太大关系,只是一个最为重要的寄存器地址到寄存器结构体变量的映射. stm32f10x.h 这个头文件是STM32 ...
- STM32的NVIC_PriorityGroupConfig使用及优先级分组方式理解
STM32的NVIC_PriorityGroupConfig使用及优先级分组方式理解 STM32的优先级NVIC_PriorityGroupConfig的理解及其使用 STM32中断优先级彻底讲解 S ...
- 第18章 SysTick—系统定时器
第18章 SysTick—系统定时器 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com/ ...
- 第18章 SysTick—系统定时器—零死角玩转STM32-F429系列
第18章 SysTick—系统定时器 全套200集视频教程和1000页PDF教程请到秉火论坛下载:www.firebbs.cn 野火视频教程优酷观看网址:http://i.youku.com/ ...
- 【STM32H7教程】第22章 STM32H7的SysTick实现多组软件定时器
完整教程下载地址:http://forum.armfly.com/forum.php?mod=viewthread&tid=86980 第22章 STM32H7的SysTick实现 ...
- stm32学习笔记之SysTick的思考
原文来自--SevenZ的笔记.http://blog.21ic.com/user1/8247/archives/2011/85920.html ? 首先我们要明白什么是SysTick定时器? Sys ...
随机推荐
- OSPF配置知识总结2(单区域)
OSPF配置知识总结2 静态路由有静态路由的好处,但也有弊端,牵一发动全身,在一个路由路径上,只要变一个,其他所有的路由器上的静态路由都要跟着改变. 用动态路由OSPF很简单就能解决这个问题.如下: ...
- LVM分区扩容
LVM分区扩容 用户需求: 将根分区有50G扩容到300G,以满足dmdb 集群用户后期增加需求 1. 查看当前硬盘分区情况,看到当前根分区只有50G 2. vgs 查看逻辑卷情况,发现root ...
- raid 0 与raid 1的区别?
区别共有三点: 1.两者的概念不同: RAID 0:是多磁盘数据分组同步写读. RAID 1:是多磁盘同数据同步写读. 2.两者的安全性不同: RAID 0:无数据备份功能,安全性差. RAID 1: ...
- 在LUbuntu上搭建Neovim+LaTeX环境
目录 安装.配置vimtex 安装texlive 安装zathura 安装.配置vimtex Plug 'lervag/vimtex' let g:tex_flavor= 'latex' " ...
- django验证码模块django-simple-captcha的使用介绍
django-simple-captcha是django验证码模块,非常方便易用. 1.环境的准备: 在django项目环境中安装:pip install django-simple-captcha ...
- ubuntu启动盘制作
转自https://www.cnblogs.com/silentdoer/p/13044305.html 1. 从Ubuntu官网http://cn.ubuntu.com/download/下载系统的 ...
- java hibernate +mysql demo
origin article:http://www.javatpoint.com/example-to-create-hibernate-application-in-eclipse-ide requ ...
- git 与远程仓库关联返回 fatal: remote origin already exists 解决方法
今天领导新建了一个代码仓库,我按照流程一步步推送代码,结果到了关联仓库的时候,返回 fatal: remote origin already exists(远程源已经存在) 下面是解决方法 1.删除远 ...
- Lecture 2. Fundamental Concepts and ISA - Carnegie Mellon - Computer Architecture 2015 - Onur Mutlu
并不只有冯诺依曼模型,按照控制流顺序执行指令 还有 data flow 模型,按照数据流顺序执行指令 冯诺依曼模型和数据流模型的编程语言的一个对比 Control-driven 编程模型和 data- ...
- nginx 解决 405 not allowed错误
1.http nginx.conf文件 error_page 后 增加代码 error_page 405 =200 @405; location @405 { proxy_method GET; pr ...