SWCU191 February 2022 CC1311P3 , CC1311R3 , CC2651P3 , CC2651R3 , CC2651R3SIPA
When the radio is powered down, the RAT module is not counting. To keep a consistent time base over time for synchronized protocols, it is possible to synchronize the radio timer with the real-time clock (RTC) (see Chapter 16).
To allow synchronization after power up, the CMD_SYNC_STOP_RAT command (see Section 26.3.3.1.10) must be sent before RF core is powered down. This command (until the next RTC tick) stops the radio timer and returns a parameter rat0, should be stored and provided when the radio timer is restarted.
The next time the RF core is powered up and the RAT is started, this synchronization must be done using CMD_SYNC_START_RAT (see Section 26.3.3.1.11), where the rat0 parameter obtained from CMD_SYNC_STOP_RAT must be provided. This command starts the RAT, waits for an RTC tick, and adjusts the RAT. Depending on the application, it may not be necessary to run the CMD_SYNC_STOP_RAT command every time the radio is powered down; a previous value of rat0 may be reused. In some cases, however, this may cause issues if the radio is powered for a long time and the low-frequency and high-frequency crystal oscillators have a significant error relative to each other.
To get accurate synchronization, it is important that the system is running on the high-frequency crystal oscillator starting before the CMD_SYNC_START_RAT command is run and extending to after the CMD_SYNC_STOP_RAT command is finished.
For the CMD_SYNC_START_RAT and CMD_SYNC_STOP_RAT commands, the AON_RTC:CTL RTC_UPD_EN register bit must be set to 1 (see Section 17.4.1). It is never necessary to reset this bit to 0; it may be set permanently to 1 when the RTC is started.