Questions about the RTC time is not accurate?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Questions about the RTC time is not accurate?

1,461 Views
jinchengxie
Contributor I

Use the MCU is S32K144

About the RTC configuration is as follows, the clock is 1 KHZ LPO

图片1.png

图片2.png

图片3.png

图片4.png

        Call interrupt processing function (secondsISR) every second, and print the corresponding debugging information。The results found that the print 60 times (1 minute) real time is 1 minutes and 4 seconds, error in 4 seconds.

        At the same time I try to modify the configuration of the structure as shown in the members compensationInterval and compensation to compensate the configuration, but from the point of view of S32 RM which is the maximum compensation - 128 to + 127.

        This is my understanding is there a problem?Or timing error problem is objective existence, that is what's the solution?

图片5.png

0 Kudos
2 Replies

1,029 Views
alexandrunan
NXP Employee
NXP Employee

Hello to you,

I have investigated your case and seems it is a ~10% drift from the base time this is because the maxim tolerance of the LPO clock is +/- 8% and another reason is that the using of LPO acordingly to Reference manually

" Alternatively, the time counter can be clocked by a LPO 1 kHz clock and the prescaler will increment by 32 for each LPO clock"

so the base clock for 1second is 32768 Hz, with LPO is 32000 Hz this is an increase of  2.3%.

To do the compensation you need to have a reference clock from wich to calculate the deviation for compensation !

The best aproch is to use a external RTC cristal or TCXO with 32,768 Khz if you want to have no deviation ! 

0 Kudos

497 Views
Ramu_NXP
Contributor I

Hi,

I don't have external crystal in my custom board. I need to use 1kHz LPO_CLK only for RTC alarm. I see the drift/error in the alarm from board to board as 128KHz change from chip to chip. As suggested in the reference module, the statement as below -

"Although compensation is supported when clocked from the LPO,
TCR[4:0] of the compensation register are also ignored and only TCR[7:5] set the compensation value
(can overflow after 1020 to 1027 cycles).
0b - RTC prescaler increments using 32.768 kHz clock.
1b - RTC prescaler increments using 1 kHz LPO, bits [4:0] of the prescaler are ignored."

Though I used TCR[7:5] for compensation, I do not see any effect of correction in the trigger. Please suggest how to fix this.

Thanks.

Ramu

0 Kudos