Cycle Counting on Kinetis K64F

cancel
Showing results for 
Search instead for 
Did you mean: 

Cycle Counting on Kinetis K64F

121 Views
Contributor III

Hi

I would know if there are functions to cycle counting on MCUXpresso SDK.

I have seen that ARM processors contains a special register called DWT for this purpose.

Can I use it on my fw release to time elapsed couting or is it meant for debugging only and isn't it a good practice?

Thank you very much!

Labels (1)
2 Replies

57 Views
Senior Contributor II

Hi Fabio,

you can use it in the debugger (see Measuring ARM Cortex-M CPU Cycles Spent with the MCUXpresso Eclipse Registers View | MCU on Eclipse ) or in the application too (see Cycle Counting on ARM Cortex-M with DWT | MCU on Eclipse ).

For the later see McuOnEclipseLibrary/McuArmTools.c at master · ErichStyger/McuOnEclipseLibrary · GitHub  which is an implementation using the MCUXpresso SDK.

I hope this helps,

Erich

57 Views
Contributor III

Hi Erich,

thank you very much for your support and also for your great blog where

we can learn so many things!