你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

When update the reptition counter in STM32 TIM block?

[复制链接]
JeffreyChen 提问时间:2023-9-19 14:41 / 未解决

When update the reptition counter in STM32 TIM block?

The spec mentioned taht REP_CNT is updated at U_RC (repetition update event). But no more detail about U_RC is found in the spec.

I want to know when the repetition counter is reload the new RCR value after TIM RCR is changed if base counter is enabled.

I guess two kinds of possiblity:

(1) At the first base counter overflow or underflow after RCR is changed

(2) When current receptition downcount to zero after RCR is changed.

Hope your answer. Thanks.

image.png

image.png
image.png
image.png
收藏 评论5 发布时间:2023-9-19 14:41

举报

5个回答
butterflyspring 回答时间:2023-9-19 15:26:20
Hi Jeffrey,

Here is some description FYI.  It is updated at the moment when the upate event occurs.
It is the same meaning as mentioned in the " TIMx repetition counter register " which is just change the point of view from REP_CNT.

TIM_RCR change.PNG




STMCU-管管 回答时间:2023-9-19 15:26:46
Considering your possibilities:
1、The first base counter overflow or underflow after changing the RCR: This is correct. The new RCR value will be reloaded into the repetition counter at the first subsequent update event, which happens when the base counter overflows or underflows.

2、When the current repetition count downcounts to zero after changing the RCR: This possibility is not accurate. The repetition counter does not directly affect the update event itself; rather, it determines the number of consecutive overflows or underflows required before triggering an update event.

xmshao 回答时间:2023-9-19 16:36:38
还是说中文吧。大家方便点。


首先,RCR寄存器只有高级定时器才具备,且带预装功能。


RCR 计数器的重装更新 只能借助更新事件。而更新事件的产生一般可以有三种方式:


第一种方式:对于高级定时器而言,就是每当RCR计数器向下计到零的时候;对于通用或基本定时器而言就是每次发生溢出的时候;
第二种方式:就是工作在复位从模式的定时器接收到复位触发信号的时候;
第三种方式:基于软件方式手动产生更新事件;
JeffreyChen 回答时间:2023-9-19 16:47:43

STMCU-管管 发表于 2023-9-19 15:26
Considering your possibilities:
1、The first base counter overflow or underflow after changing the R ...

Thanks for your answer. As we all know, if RCR is 5, UEV only occurs when repetition counter reached to 0.

If writing a new value 7 to RCR when REP_CNT is 4,new value (7) should be loaded into REP_CNT when REP_CNT is 3 accourding to you answer. But there is no UEV (update event) occurs at this moment, right?

If yes, it conflicts with the answer aboved: repetition counter is reloaded with new RCR when an update event occurs.

image.png

Could you give more advice?Thank you again.

image.png
xmshao 回答时间:2023-9-19 17:35:39

JeffreyChen 发表于 2023-9-19 16:47</p>
<p>Thanks for your answer.  As we all know, if RCR is 5,  UEV only occurs when repetition counter ...

[md]hi, if we prepared a new value 7 to RCR when REP_CNT is 4, the new value will not be reloaded into repeated counter until the REP_CNT downcounts to 0 .

image.png

of course, there is another 2 methods to complete the reload like manually generating update event or reset slave mode Timer triggered by signal.

所属标签

相似问题

官网相关资源

关于
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
st-img 微信公众号
st-img 手机版