前言:Repetition counter是一个STM32增强的计数器功能,有很多用途,本文尝试进行简单阐述:

我们理解为,就是定时器溢出再增加一个倍率rate 的控制。注意是倍率,也就是如果是定时1S,那么设定N为1,那么就是N+1=2倍


Section 14.3.1: Time-base unit describes how the update event (UEV) is generated with respect to the counter overflows/underflows. It is actually generated only when the repetition counter has reached zero. This can be useful when generating PWM signals.

我们简单的任务,UEV的产生就是计数器记到位就好了,其实,由于RC(Repetition Counter)的存在,正在事件的产生是由RC计数到0才真正开始。这一点对产生PWM信号非常重要,因为PWM信号的脉宽需要调整,RC要精确控制就必须硬件上具备这个功能。

This means that data are transferred from the preload registers to the shadow registers

也就是说,数据从preload reg 到 Shadow reg(包括下面三种情况)

(TIMx_ARR auto-reload register,

TIMx_PSC prescaler register,

but also TIMx_CCRx capture/compare registers in compare mode

)

every N+1 counter overflows or underflows, where N is the value in the TIMx_RCR repetition counter register.

每次溢出记一次数的话,达到RCR的N值,这时候才真正将UEV产生出来。同时更新shadow registers

The repetition counter is decremented:

• At each counter overflow in upcounting mode,

• At each counter underflow in downcounting mode,

• At each counter overflow and at each counter underflow in center-aligned mode.

Although this limits the maximum number of repetition to 128 PWM cycles, it makes it possible to update the duty cycle twice per PWM period. When refreshing compare registers only once per PWM period in center-aligned mode, maximum resolution is 2xTck, due to the symmetry of the pattern.

The repetition counter is an auto-reload type; the repetition rate is maintained as defined by the TIMx_RCR register value (refer to Figure 72).

When the update event is generated by software (by setting the UG bit in TIMx_EGR register) or by hardware through the slave mode controller, it occurs immediately whatever the value of the repetition counter is and the repetition counter is reloaded with the content of the TIMx_RCR register.

In center-aligned mode(理解为从低到高计数然后紧接着从高到低计数), for odd values (奇数的时候计数两次)of RCR, the update event occurs either on the overflow or on the underflow depending on when the RCR register was written and when the counter was started. If the RCR was written before starting the counter, the UEV occurs on the overflow. If the RCR was written after starting the counter, the UEV occurs on the underflow. For example for RCR = 3, the UEV is generated on each 4th overflow or underflow event depending on when RCR was written.


参考:

STM32 定时器中TIM_RepetitionCounter 作用详解

https://blog.csdn.net/longgyue/article/details/80161380

STM32 - 定时器的设定 - 基础 01.1 - Repetition counter相关推荐

  1. STM32 - 定时器的设定 - 基础 01 - Timer Base - Prescaler description - Upcounting mode

    前言:时基是定时器的最基本的功能: 本节详细叙述STM32的时基的功能. 1 Time-base unit The main block of the programmable advanced-co ...

  2. STM32 - 定时器的设定 - 基础- 07 - 6-step PWM generation - 6步长PWM的产生 - COM Event的解释

    前言:本节主要讲互补输出的步长设定问题,同时引入了一个重要的参数COM,这个再诸多STM32的手册里面都过于分散,在本文有一个比较完备的小结: When complementary outputs a ...

  3. STM32 - 定时器的设定 - 基础- 06 - OCxREF signal - Clearing the OCxREF signal on an external event

    OCxREF signal 作为捕捉比较的定制化参考波形在对输出波形的配置上占有巨大的影响.如何将这个信号和外部输入的事件联系起来,能给系统的设计带来更多的可选择性. The OCxREF signa ...

  4. STM32 - 定时器的设定 - 基础 - 05 - Arbitrary waveform generation using timer DMAburst feature - 任意波形的序列产生

    DMA的功能不说了,如何产生任意序列的波形,我们仔细看看: 本节叙述了同DMA的方法,在不占用MCU资源的情况下,通过提前编辑一组任意定制的波形参数,实现复杂的波形输出. STM32 DMA-burs ...

  5. STM32 - 定时器的设定 - 基础-04 - 输出波形控制 - PWM 模式

    PWM为诸多应用的基本波形,如何实现和如何定制,首先要了解STM32中PWM的实现方法. 在STM32中,PWM的实现主要通过控制 OCxRef (active high).:output compa ...

  6. STM32 - 定时器的设定 - 基础- 0A - Timers and external trigger synchronization - 定时器和外部触发的同步

    四种同步方式: The TIMx Timers can be synchronized with an external trigger in several modes: Reset mode, G ...

  7. STM32 - 定时器的设定 - 基础-03 - 输出波形控制 - Output compare mode

    1 简介: This function is used to control an output waveform or indicating when a period of time has el ...

  8. STM32 - 定时器的设定 - 基础- 02 - Capture/compare channels 和相关设置寄存器 - 和STM32缩写词条解释

    前言:捕捉比较通道: STM32丰富的定时器的变化,就在这个模式,所以,复杂是必然的:当然,也可以简单来理解,就是通过选择定时器的输入的配置同时配置定时器的输出来获取我们需要的各种波形: 几个重要的缩 ...

  9. STM32 - 定时器的设定 - 基础- 0D - Timer synchronization chaining - 主从模式下 - 定时器同步和级联控制 - 级联启动定时器

    和前面两次举例不同的是,前面两次是用CC通道的输出波形来做触发,这个例子,用UEV的发生做触发: In this example, we set the enable of Timer 2 with ...

最新文章

  1. [POI2007]ZAP-Queries
  2. C# 中的Async 和 Await 的用法详解
  3. 个人开发者做一款Android App需要知道的事情
  4. fabric 简单理解
  5. opencv入门 - 显示图像学习总结
  6. JavaScript的arguments及其子对象
  7. 浪里个浪 FZU - 2261
  8. Android--使用Camera拍照
  9. python的sdk是什么意思_python sdk
  10. android surface windows,Android易混概念辨析之Surface,Window,View,SurfaceView,Bitmap
  11. 一个按键控制数码管的开和关_单片机是否能用一个按键控制数码管的显示图?...
  12. dataframe先分组再画图
  13. Android开发之获取GPS位置案例源码详解
  14. 我的免费版mbti职业性格测试
  15. 阿里巴巴食堂:看菜名我跪了~程序员:给我来个“油炸产品经理”
  16. aws saa是什么缩写?aws saa认证考察什么?
  17. 【Code】Python金字塔模型的实现(Pyramid)
  18. 阿里云神龙团队拿下 TPCx-BB 排名第一的背后技术
  19. Android中AS创建点9图片与使用
  20. stm32cubeide烧写程序_STM32 Cube IDE 下实现 IAP —— (1) 程序跳转

热门文章

  1. C#LeetCode刷题之#350-两个数组的交集 II(Intersection of Two Arrays II)
  2. 分享个提高自己审美的网站
  3. 正则语言和正则表达式_探索正则表达式背后的语言学
  4. hacker代码_如何仅用7行R代码构建Hacker News Frontpage抓取工具
  5. javascript入门_您需要一个JavaScript入门工具包
  6. 基本 Python 词汇
  7. cpu 保存模式的内存访问向下兼容原理
  8. Spark 的核心 RDD 以及 Stage 划分细节,运行模式总结
  9. 分布式系统以及CAP原理
  10. 机器学习(1)之梯度下降(gradient descent)