Cycle counter on ARM Cortex M4 (or M3)?

Take a look at the DWT_CYCCNT register defined here. Note that this register is implementation-dependent. Who is the chip vendor? I know the STM32 implementation offers this set of registers. This post provides instructions for using the DWT Cycle Counter Register for timing. (See the post form 11 December 2009 – 06:29 PM) This Stack … Read more

Looking for an efficient integer square root algorithm for ARM Thumb2

Integer Square Roots by Jack W. Crenshaw could be useful as another reference. The C Snippets Archive also has an integer square root implementation. This one goes beyond just the integer result, and calculates extra fractional (fixed-point) bits of the answer. (Update: unfortunately, the C snippets archive is now defunct. The link points to the … Read more