打印
[技术问答]

TIMER_Open 函数的输出频率

[复制链接]
3001|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
各位大大安安,在官方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);



使用特权

评论回复
沙发
tail066| | 2021-8-13 15:22 | 只看该作者
你这,不就是 printf的信息么?

使用特权

评论回复
板凳
643757107| | 2021-8-13 19:27 | 只看该作者
楼主糊涂了吧,你自己设置的是那个,然后又打印出来,有啥问题啊

使用特权

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

本版积分规则

279

主题

1448

帖子

2

粉丝