LAT1458
LAT1458 - Rev 1.0 page 2/7
简单的说 TIM3 通道一输出一个周期为 32s 的方波,作为一个标准的参考时间,TIM2 连
续捕获两次上升沿,并且记下这个周期里脉冲的个数。TIM3 的时钟源为外部 1hz 标准信号如
GPS 的 PPS 信号,TIM2 的时钟源为 LSE。
在 x-cube-rtc demo 实现中,涉及了 TIM2,它是一个 32 位的定时器。理论上 32s 的脉
冲数为:
32768 * 32 = 1,048,576 = 0x100000 = 2
20
4.3.5 叙述了移植建议:
The software example expects that the TIM2 is more than 20 bit, 32 bit in case of
L476RB. With products featuring only 16-bit timers it is recommended to keep track
of 16-bit timer overflows using the software and perform the calibration with 16-th
overflow to compensate for the missing 4 bits.
2.1. 实现
2.1.1. TIM4 替换 TIM2
鉴于 32 位 time 已经用尽,于是就使用 TIM4 替换 TIM2。又借鉴了 AN2592 3.1,