This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/LAUNCHXL-CC1310: Real time clock running slowly

Part Number: LAUNCHXL-CC1310
Other Parts Discussed in Thread: CC1310, SYSBIOS

Tool/software: TI-RTOS

Hi,

I am using the TI-RTOS Seconds module as I need to record the time when I/O events occur.  These events and the time they occurred are reported periodically using the radio.

The problem is that the value returned by the Seconds_get function looses about 10 seconds per minute.  This is repeatable over two CC1310 Launchpads and a CC1310EMK/SmartRF06.

RF_getCurrentTime() seems to work accurately, but is less useful for long term timing as it wraps every 18 minutes.

I noticed the problem in my application, but to demonstrate the issue, I have tried to produce a minimal example that stays in a tight loop reading the time.

The code below reproduces the problem: Either put a 'scope on the output that drives the LED, or look at the output console and time how long it takes the count to increment by 60.

The code is based on the standard 'empty_CC1310_LAUNCHXL_TI' project, with the code below replacing the example's 'heartBeatFxn'. Add  var Seconds = xdc.useModule('ti.sysbios.hal.Seconds') to the empty.cfg.

Regards,

Tony.

Void heartBeatFxn(UArg arg0, UArg arg1)
{

    // add
    // var Seconds = xdc.useModule('ti.sysbios.hal.Seconds');
    // to the end of the cfg file

    Seconds_set(0);

    while (1)
    {
        // save the current seconds count
        UInt32 currentSeconds = Seconds_get();
        while(true)
        {
            // if the seconds value has changed
            if (Seconds_get() != currentSeconds)
            {
                // store the new value
                currentSeconds = Seconds_get();
                // toggle a LED
                PIN_setOutputValue(ledPinHandle, Board_LED0,
                                   !PIN_getOutputValue(Board_LED0));
                // print the time
                System_printf("TIME: %d\n",currentSeconds);
                System_flush();
            }
        }
    }
}