完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
各位大大安安,在官方BSP\tiMER_Capture范例中,提到Timer0和Timer3的输出频率各位500Hz和1Hz,但是实际上则是1000Hz和2Hz,这其中是不是有什么误会???谢谢!
printf(" Timer0: Clock source is 12 MHz; Toggle-output mode and frequency is 500 Hz.\n"); printf(" Timer3: Clock source is 12 MHz; Toggle-output mode and frequency is 1 Hz.\n"); printf(" Timer2: Clock source is HCLK(72 MHz); Continuous counting mode; TCMP is 0xFFFFFF;\n"); printf(" Counter pin enable; Capture pin and capture interrupt enable;\n"); printf("# Generate 500 Hz frequency from TM0 and connect TM0 pin to Timer2 counter pin.\n"); printf("# Generate 1 Hz frequency from TM3 and connect TM3 pin to TM2_EXT capture pin.\n"); printf("# Get 500 event counts from Timer2 counter pin when each TM2_EXT pin interrupt occurred.\n\n"); /* Initial Timer0 and Timer3 default setting */ timer0_freq = TIMER_Open(TIMER0, TIMER_TOGGLE_MODE, 1000); timer3_freq = TIMER_Open(TIMER3, TIMER_TOGGLE_MODE, 2); printf("Timer0 frequency = %d\n",timer0_freq); printf("Timer3 frequency = %d\n",timer3_freq); |
|
相关推荐
1个回答
|
|
自己回覆一下,重新看了TRM文件,toggle 模式是toggle 输出 (tout)信号以 50% 的占空比反复改变
所以程式中timer0_freq和timer3_freq变数是代表timer0和timer3中断信号的频率 使用示波器量测Timer0 toggle out 脚位,量测得到500Hz的方波 |
|
|
|
只有小组成员才能发言,加入小组>>
625浏览 3评论
510浏览 2评论
361浏览 1评论
381浏览 1评论
348浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-23 01:17 , Processed in 0.571664 second(s), Total 49, Slave 41 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号