金牌会员
 
- 积分
- 1266
- 金钱
- 1266
- 注册时间
- 2013-1-11
- 在线时间
- 438 小时
|
发表于 2019-11-29 14:14:46
|
显示全部楼层
/* TIM4 configuration:
- TIM4CLK is set to 16 MHz, the TIM4 Prescaler is equal to 128 so the TIM1 counter
clock used is 16 MHz / 128 = 125 000 Hz
- With 125 000 Hz we can generate time base:
max time base is 2.048 ms if TIM4_PERIOD = 255 --> (255 + 1) / 125000 = 2.048 ms
min time base is 0.016 ms if TIM4_PERIOD = 1 --> ( 1 + 1) / 125000 = 0.016 ms
- In this example we need to generate a time base equal to 1 ms
so TIM4_PERIOD = (0.001 * 125000 - 1) = 124 */
从CNTR到ARR以PSCR这个频率运行的时间 |
|