AnsweredAssumed Answered

Get tick count (CPU cycle count) with SysTick

Question asked by concerned12345 on Jun 26, 2013
Latest reply on Mar 31, 2015 by EARL GOODRICH


Hello,

 

I want to get some timing information from my code and see how long certain algorithms run. I do not want to do this through debug. So, I have been looking at SysTick and I'm trying read the CVR register with the macro SYST_CVR. I keep getting zero as a result. From reading I am under the impression that this by default increments every clock cycle. Please let me know if I need to setup any of the other registers, if so which ones and with what values.

Also, if there is a nother way to get accurate CPU clock cycles please let me know.

I am running a K70 on a TWR-K70F120M rev. B tower board.

 

printf( "CVR: 0x%X\n", (unsigned int)SYST_CVR );     //Always prints: CVR: 0x0

 

 

Outcomes