Inside our application but also with the LPCXpresso1549 evaluation board (OM13056) we see the RTC clock is sometimes incremented by 2 seconds.
This happens about 30 times a day so the RTC is getting very inaccurate.
We couldn't pinpoint the reason why our application was not working as expected so we made a small program that only reads the RTC counter and compares it with the previous value and there we see the counter sometimes is incorrectly incremented.
Is there some kind of way to prevent this is happening?
Hi Ronald,
Have you tried using the periph_rtc example from the LPCOpen package to see if the same error happens? The example shows how to setup and use the RTC and to use the alarm to wake up the device from a sleep mode. You can download the LPCOpen 15xx package from this page:
Let me know the result!
Best Regards,
Carlos Mendoza
Technical Support Engineer
We also used the lpcopen 2.2 software, we made some small modifications and removed the sleep to test if it increments correctly. Also with this code we see it's not counting correctly now and then.
Hi Ronald,
After further investigation we have confirmed this issue, it will be written in errata sheet. The results were the following:
- RTC COUNT can increment by one but take two steps (updated twice) within one second.
- RTC COUNT can increment by two in one step within one second. Both cases (1) and (2) could lead to accumulated error. We don’t have the work around for this yet. The issue seems to be related to some glitch when the internal 16-bit ripple count wraps from 0x7FFF to 0x8000 and from 0xFFFF to 0x0000.
Best Regards!
Carlos Mendoza
Technical Support Engineer