关键词不能为空

当前您在: 主页 > 英语 >

nrf51822学习笔记之TIMER

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-03-02 20:03
tags:

-

2021年3月2日发(作者:家务活)


大量的


TIMER task/event


及中 断,


可以使各种系统外设


(包括


GPI O



通过


PPI

系统执行定时


或记数任务(


timing/count tasks



.


PPI


系统也可以使能定时器(


TIMER


task/event


features

)来产生周期性输出


(periodic


output)



PWM


信号到任意的


GPIO


口。



The PPI system also enables the TIMER task/event features to generate periodic output and PWM


signals to any GPIO.













定时计数器的时钟源是

< p>
HFCLK


,并可以通过一个


4 bit (1/2


X


)


分配器对


HFCLK


进行分频


.



TIMER


可以处于两种模式:



1


定时模式



Ti mer mode




2


计数模式(


Counter mode




两种模式都可以通过触发


启动或停止


任务


(

START


task


or


STOP



task)


来启动或停止


TIMER




TIMER



count-up timer




Timer mode :


每个定时器周期(


F


TIMER




内部计数寄存器


(


Counter register


)




+1.


Counter mode:


每次


COUNT task


被触发的时候



Counter register +1.


此模式下,


FTIMER


和分


频系数就不起作用了。





TIMER


可以通过位宽寄存器


(


BITMODE register


)< /p>


设置计数最大值


(


maximum value


).



分频和位宽寄存器


(PRESCALER register and the BITMODE register)



只 能在


TIMER


停止运行的时候对其进行修改,


否则结果难以预料。


当计数超过了最大值时,


计数寄存 器会溢出,并自动从


0


重新开始计数。可通过执行


CLEAR task


使


TIMER



0





比较和捕获


(Compare/Capture):


比较:


每个捕获比较寄存器


< br>CC[0..3]



都可以产生一个

COMPARE event.


当某个计




计到



capture


compare


register


CC[n]


中的


值相



时,


就会



生一



COMPARE[n] event,


这两个


n


是对应着的。



捕获:


每个


capture/compare register


都可以执行一个



capture task



每次


capture[n]


task


被触发,计数值都会被复制到


CCP[n]


寄存器



every time the CAPTURE[n] task is triggered the Counter value is



copied to the


CC[n] register.



任务的优先权(


Task priority






START task and the STOP task


同时来到的时候,


STOP task


优先




任务延时(


Task delays





CLEAR task, COUNT task and the STOP task


都会在一个


HFCLK


时钟 周期内完成,



电源模式下,


STAR T task


需要更长的时间。



The CLEAR task, COUNT task and the STOP task will guarantee to take effect within


one clock cycle of the


HFCLK. Depending on sub-power mode, the START task may


require longer time to take effect





-


-


-


-


-


-


-


-



本文更新与2021-03-02 20:03,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/692630.html

nrf51822学习笔记之TIMER的相关文章