打印

STM32库,3.0和3.3的差别这么大,TIM例程发现时钟设置完全不同

[复制链接]
1868|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
redcar|  楼主 | 2011-1-23 19:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1个3.0的,1个3.3的,都是  Project\STM32F10x_StdPeriph_Examples\TIM\TimeBase下的例子,连readme.txt里面写的都不一样
就是时钟设置里面,
3.0的是说
The TIMxCLK frequency is set to 36 MHz, the Prescaler is 4 so the TIM2 counter
clock is 7.2 MHz.  

The TIM2 CC1 register value is equal to 49152,  
CC1 update rate = TIM2 counter clock / CCR1_Val = 146.48 Hz,
so the TIM2 Channel 1 generates an interrupt each 6.8ms

3.3和3.4的一样,是说
The TIM2CLK frequency is set to SystemCoreClock / 2 (Hz), to get TIM2 counter  
clock at 6 MHz so the Prescaler is computed as following:
   - Prescaler = (TIM2CLK / TIM2 counter clock) - 1
SystemCoreClock is set to 72 MHz for Low-density, Medium-density, High-density
and Connectivity line devices and to 24 MHz for Low-Density Value line,
Medium-Density Value line and High-Density devices.

The TIM2 CC1 register value is equal to 40961,  
CC1 update rate = TIM2 counter clock / CCR1_Val = 146.48 Hz,
so the TIM2 Channel 1 generates an interrupt each 6.8ms

3.0.rar

4.06 KB

3.3.rar

4.17 KB

沙发
say_sth_freely| | 2011-1-24 08:11 | 只看该作者
版本升级了,改改说法还不允许嘛,原理还是一样滴

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

20

主题

228

帖子

2

粉丝