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.

CC2340R2: millis() "like" function

Expert 3730 points
Part Number: CC2340R2

Tool/software:

Hi team, 

Is there a function available to use on CC2340R2 that would be similar to the millis() function? It would just need to return the number of milliseconds since reset or something that could be converted to that.

My customer needs it for a version of test code that they are developing that is executed before the OS runs. The timer would be based on SysTick instead of a timer controlled by the RTOS.

Best,
Luke

  • Hello Luke,

    We can make use of the RTC register(s):
    "The counter can be read from two 32-bit registers. RTC.TIME8U has a range of approximately 9.5 hours with an LSB representing 8 microseconds. RTC.TIME524M has a range of approximately 71.4 years with an LSB representing 524 milliseconds" 

    Thanks,
    Alex F