4 Replies Latest reply on Dec 19, 2017 7:49 AM by kmichalopoulos

    BCM20737S RTC clock problem

    kmichalopoulos

      I am working with BCM20737S and we have to keep track of time. We have an external 32.768KHz crystal and everything is setup  according to the rtc_sample example. Every second I check the time using rtc_getRTCTime. The output is correct for a couple of minutes and then the clock is off by one second. I monitored the behavior of the system by printing the seconds. Bellow I have the debug log. The system gets the time from a different device and there is one second difference between the time in the

      system and the PC running the debug viewer (plus the timezone difference). The difference is stable (1 second) until it reaches the point at 16:56:02. There I have for 2 different seconds the same value returned from the rtc_getRTCTime. I am not sure why this is happening. This happens after a couple of minutes after the time is synchronized and I can't see any type of periodic behavior so far.

      In a thread I noticed that they were using the bleapputils_changeLPOSource(LPO_32KHZ_OSC, FALSE, 250); line to setup the crystal.

      When I am using this command in the create function, I get the opposite effect, the clock is jumping a second every now and then. I am not sure if it is the driftRate wrong

      and how to correctly set it up. I will disable to sleep to see if that helps but I must have the sleep enabled.

       

      16:55:56 - 21:55:55

      16:55:56 - CurrSec: 55

      16:55:57 - 21:55:56

      16:55:57 - CurrSec: 56

      16:55:58 - 21:55:57

      16:55:58 - CurrSec: 57

      16:55:59 - 21:55:58

      16:55:59 - CurrSec: 58

      16:56:00 - 21:55:58

      16:56:00 - CurrSec: 58

      16:56:01 - 21:56:0

      16:56:01 - CurrSec: 0

      16:56:02 - 21:56:1

      16:56:02 - CurrSec: 1

      16:56:03 - 21:56:1

      16:56:03 - CurrSec: 1

      16:56:04 - 21:56:2

      16:56:04 - CurrSec: 2

      16:56:05 - 21:56:3

      16:56:05 - CurrSec: 3

      16:56:06 - 21:56:4

      16:56:06 - CurrSec: 4

      16:56:07 - 21:56:5

      16:56:07 - CurrSec: 5

      16:56:08 - 21:56:6

      16:56:08 - CurrSec: 6