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.

CCS/LAUNCHXL-CC2640R2: Measuring nanoseconds

Part Number: LAUNCHXL-CC2640R2
Other Parts Discussed in Thread: CC2640, SYSBIOS, CC2640R2F

Tool/software: Code Composer Studio

Hi

Is it possible to measure nanoseconds of wait time? I am using the CC2640 LaunchXL board. Is there some inbuilt function like Timestamp to measure this? I wasn't sure if we could change the Timestamp frequency from 65536Hz. If I'm missing something, please let me know.

Thanks.

  • It would be great to be able to measure as low as 40ns. If that's not possible, what's the minimum time period that can be measured?

  • Tushar,

    Are you running TI-RTOS?  If so I can loop in the TI-RTOS team to see if it offers a solution.

    John

  • Yes John, I'm running TI-RTOS.

    Thanks.

    Tushar

  • Tushar,

    By default the Timestamp module on these devices is configured to use the RTC as a time base; it is slower but will continue to run across all sleep states.  

    If you want a faster timestamp you can reconfigure Timestamp to use the CPU’s SysTick timer as the time base.  This runs at the CPU rate (48MHz), but will not be updating when the processor is in deep sleep.

    You can add something like the following to the application configuration file (with the .cfg extension) to switch the Timestamp provider:

    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var SysTickTimestamp = xdc.useModule('ti.sysbios.family.arm.m3.TimestampProvider');
    SysTickTimestamp.configTimer = true;
    Timestamp.SupportProxy = SysTickTimestamp;

    If you are using ROM for your app you will need to disable this, and run your app from flash. (Because the ROM image uses the slower timestamp).   Comment out the following from the application .cfg file:

    var ROM = xdc.useModule('ti.sysbios.rom.ROM');
    ROM.romName = ROM.CC2640R2F;

    Then rebuild your app and Timestamp resolution will be the CPU clock rate.

    Regards,
    Scott