嵌入式学习小组
直播中

最强海贼王

8年用户 1377经验值
擅长:MEMS/传感技术
私信 关注

BSP\\TIMER_Capture范例中,Timer0和Timer3的输出频率和手册的不一致是为什么?

各位大大安安,在官方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)

王伟

2024-1-2 16:28:45
可以有几种可能性导致实际的输出频率与手册中不一致:

1. BSP中的代码可能有错误

2. 手册中的描述可能有误

3. BSP和手册中描述的都是默认情况下的频率,但实际项目中可能有修改过的参数导致频率不同。

需要仔细查看代码和手册以确定原因。
举报

更多回帖

发帖
×
20
完善资料,
赚取积分