Real-Time Clock XMC4500

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
I'm using RTC (v4.1.6) App and updating the time using "RTC_SetTime(&timeval)".
The problem is that second counter (timeval.seconds) is running faster than the real time. I'm getting the time from a GPS and then update the RTC.
I think the "Time counter" is not set to zero, and this causes the problem.
1637.attach

1639.attach

Can you please confirm that and tell me how to set the "Time counter" to zero?
And if that is not the case, can you give me a solution to the problem?

Thanks
0 Likes
4 Replies
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
Hi,

You can set TIM0 to zero. Please ensure that you disable the RTC first.
0 Likes
Not applicable
Can you please explain more?
I used "RTC->TIM0 = 0;" but the program freezes.
Thank you
0 Likes
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
The Timer counter is make up of TIM0 and TIM1 which consist of the bit field of seconds, mins, hrs, days, months and years. In order to edit these bit field, the RTC has to be disabled first (RTC_CTR.ENB = 0).
0 Likes
Not applicable
I got this error
1647.attach
0 Likes