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.

Timestamp_getFreq gives wrong value for cc2650

Other Parts Discussed in Thread: CC2650, SYSBIOS, CC1350

Hi

I am trying to use Timestamp_getFreq to calculate time for one sample but the cc2650 freq is 48 Mhz and I am reading 65535 from Timestamp_getFreq.Can you please tell me what else do I need to do so I should get correct value

Timestamp_get64(&timer_start);

readbyte(i2c,ACCEL_XOUT_H,rxBuffer,6);
Timestamp_get64(&timer_stop);
delta_timer=&timer_stop-&timer_start;
Timestamp_getFreq(&freq);

Thanks and Regards

Sneha

  • Sneha,

    65536 is the correct value for the default configuration.  On CC26xx/CC13xx devices the RTC is used as the ‘timestamp provider’.  It is slower, but it has a big advantage in that it keeps running during low power modes - so it allows timestamp values to span low power modes.

    You can change your app configuration to use the SysTick counter in the NVIC instead, and the timestamp frequency will be 48Mhz.  But the timestamps will stall while the CPU is powered down.   Also, if you are using SYS/BIOS routines from ROM, you must disable this, because the ROM routines expect/require the RTC as the timestamp provider.

    To change your configuration (from the defaults in a TI-RTOS example project) you’ll need to add something like the following to your application .cfg file (at the end, to override any earlier settings):

    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var SysTickTimestamp = xdc.useModule('ti.sysbios.family.arm.m3.TimestampProvider');
    SysTickTimestamp.configTimer = true;
    Timestamp.SupportProxy = SysTickTimestamp;
     
    Also, if ROM is enabled, you must disable it:

    /* ================ ROM configuration ================ */
    /*
     * To use BIOS in flash, comment out the code block below.
     */
    var ROM = xdc.useModule('ti.sysbios.rom.ROM');
    if (Program.cpu.deviceName.match(/CC26/)) {
    //    ROM.romName = ROM.CC2650;
    }
    else if (Program.cpu.deviceName.match(/CC13/)) {
        ROM.romName = ROM.CC1350;
    }

    And, if in your .c file you are explicitly including TimestampProvider.h, you’ll need to specify that for SYSTICK:

    //#include <ti/sysbios/family/arm/cc26xx/TimestampProvider.h>
    #include <ti/sysbios/family/arm/m3/TimestampProvider.h>

    Regards,
    Scott

  • Thanks a lot for the reply.It solved my problem 

    Thanks and Regards

    Sneha