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.

CC2642R: Frequency and Resolution of Timestamp_get32() on BLE MCU CC2642R

Part Number: CC2642R
Other Parts Discussed in Thread: CC2640, SYSBIOS,

We are using: 

How do we find frequency and resolution of this Bios API: Timestamp_get32() that provides a 32 bit timestamp? Looking at the forum questions and replies, this seems to be a part number / chip related implementation. 
Do we need to use explicitly Timestamp_init(void) before using the above API?

In Timestamp.h I see an API:

* @brief get timestamp frequency
*
* Get the frequency of the timestamp counter in Hz. This
* function fills in a Types_FreqHz structure with the high
* and low 64 bit frequency.
*
* @param freq pointer to a 64-bit frequency structure
*/
extern void Timestamp_getFreq(Types_FreqHz *freq);

but it seems to be valid for 64 bit timestamp ?

What other alternative are available to get timestamps with resolution in range 30 microseconds to 1 ms?

  • Hello,

    I hope you are doing well! A few threads about this topic which I think will be helpful to look at:

    https://e2e.ti.com/f/1/t/650111/ (these two will be a little different as they are for the CC2640 device instead of the CC2642 device) 

    e2e.ti.com/.../

    You can maybe use the Timer_PERIOD_US field in timer params to setup a timer with microseconds. 

    -We can also use CPU_Delay to confirm that the timestamps works. 

    There is also this E2E post (https://e2e.ti.com/f/1/t/1247365/) which is about timer_getCount. 

    Thanks,
    Alex F

  • Thanks for the advice, here is a summary of my findings:

    We can determine the frequency (in Hz) of the clocks for the timestamp APIs:
       uint32_t Timestamp_get32(void) // get 32-bit timestamp
       void Timestamp_get64(Types_Timestamp64 * timestamp64) // get 64-bit timestamp

    by using another API:
    #include <ti/sysbios/runtime/Types.h>
    Types_FreqHz freq;
    Timestamp_getFreq(&freq);

    I wrote such a piece of code to obtain 2 frequencies:
    freq.hi and freq.lo : the clock frequencies used for te above 2 APIs (64 and 32 variants).
    I found the clock frequency on MCU cc2642R: freq.lo = 65536 Hz
    Period calculation: 1 000 000 / 65536 = clock period (tick) in microsecs = 15.258789 microsecs.

    freq.hi = 0 => Timestamp_get64() is not available on this MCU.