Can we set the milliseconds when set the hardware clock? (K64 )

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Can we set the milliseconds when set the hardware clock? (K64 )

1,034 次查看
gaozida
Contributor II

The RTC Time Seconds Register only save the seconds, how to ensure the accuracy of the millisecond?

Thanks!

标记 (1)
0 项奖励
回复
2 回复数

842 次查看
egoodii
Senior Contributor III

We need to differentiate 'accuracy' and 'precision'.  For precision:  If you stop the RTC, you can write the prescale-register (TPR) by multiplying your 'milliseconds' by 32768/1000.  With that simple extension your driver can easily read and write 'millisecond' precision.

As for accuracy, the default 32,768 divider CAN have the small adjustments mentioned (this would, however, negate the ability to convert TPR to ms with the simple 1000/32768 factor), and with that you could compensate the typical temperature-curve of watch-crystals, but ONLY if you are 'awake', at least periodically, to measure temperature and adjust the compensation appropriately.  Another way to get 12ppm accuracy (~1sec/day) is to use an external part that already does this real-time temperature-compensation: SiTime: SIT1552AC-JE-DCC-32.768D.  Takes a little more battery, but insures +/-10ppm 0-70C (extended temp versions available -40+85C, holds +/-13ppm).

0 项奖励
回复

842 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi,

RTC has contain the compensation logic which provides an accurate and wide compensation range and can correct errors as high as 3906 ppm and as low as 0.12 ppm.

So I'd like to suggest you to learn the more information about the compensation operation from the K64' reference manual.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复