Other Parts Discussed in Thread: AWRL6432
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号: AWRL6432
您好、
我将 PRCMSlowClkCtrGet () 的内置慢时钟计数 器与 AWRL6432 上 0x5B000020 的帧基准计数器进行比较。
我知道帧基准计数器以 40MHz 运行、慢速计数器以 32.768kHz 的频率运行。
测试代码:
uint32_t t1_fast = *(uint32_t *)0x5B000020;
uint64_t t1_slow = PRCMSlowClkCtrGet();
ClockP_usleep(1000000);
uint32_t t2_fast = *(uint32_t *)0x5B000020;
uint64_t t2_slow = PRCMSlowClkCtrGet();
uint32_t fast_us = (t2_fast - t1_fast) / 40; // 40 MHz
double slow_us = (double)(t2_slow - t1_slow) * (1000000.0 / 32768.0); // 32.768 kHz
DebugP_logInfo("Frame Reference Counter: %u us\r\n", fast_us);
DebugP_logInfo("Slow counter: %.0f us\r\n", slow_us);
我的期望:
- 两个计数器都应接近 1000000 μ s。
结果:
- 帧参考计数器:999334us — 符合预期。
- 慢计数器:948364 μ s — 偏差比预期大得多。
这表明慢速计数器 以低于 32.768kHz 的频率运行。
我尝试了不同的时间间隔和两个不同的电路板、并获得了类似的结果。
这可能是什么原因?