Tool/software: Code Composer Studio
Hi,
I'm working on a project based on the CC3200+FreeRTOS and i had to check the RTC stability since the project need to read data from sensors at a specific time and back to sleep (not hibernate or deep sleep) and the time must be in milliseconds (for example: the device need to wake up at 1600943553 seconds (seconds since 1970) and 500 milliseconds).
i used the function "MAP_PRCMRTCMatchSet(wakeUpInSeconds, wakeUpInMilliSeconds);" to configure the interruption time and ofc "MAP_PRCMIntEnable(PRCM_INT_SLOW_CLK_CTR);" to enable it.
The issue with this, the wake up time is not occurrent or stable. sometime it wakes up before (sometimes after) the desired time. this problem appears in no specific time, sometimes less then an hour, sometimes need hours to shows up.
i used the alternative function "MAP_PRCMSlowClkCtrMatchSet(wakeupTimeValue);" to do some tests and to compare it with the MAP_PRCMRTCMatchSet, i get the RTC time and the slow clock ctr value each time the device wakes up using those functions (MAP_PRCMSlowClkCtrGet and MAP_PRCMRTCGet)
the result was:
MAP_PRCMSlowClkCtrMatchSet is stable and the device wakes up every single time at the "wakeupTimeValue" + few milliseconds (4 or 5, with is normal)
but in the other hand the time in seconds and millisecond i get using the MAP_PRCMRTCGet function wasn't correct (not stable or occurrent)
this is a piece of the log file:
desired Wakeup Value: 13937792
real wakeup value: 13937969
desired Wakeup RTC sec: 1600938826, milliSec: 500
real Wakeup RTC sec: 1600938827, milliSec: 919
The difference between the desired and the real wakeup value is 177 => 5 milliseconds and it's acceptable.
the difference between the desired and the real wake up time for the RTC is huge 1 second and 419 milliseconds (sometimes its before the desired wakeup time by 300 milliseconds).
Hope if you can explain to me what is the issue with the RTC functions, and what causes this instability?
Thanks,