Thursday, January 30, 2014

How much CPU am I using?

A little bit earlier I had decided to start keeping a keen eye on the amount of processing power my RTOS was using. It's way too easy to get all kinds of performance issues if one isn't really careful throughout the whole design process.

ARM Cortex based microcontrollers - like the one I'm using - all have something called a "SysTick timer". This is a timer specifically designed and dedicated for operating system usage. It runs on every cycle the microcontroller is running, counting down cycles. It can even create exceptions if the system designer needs them. This was the logical place to look into when figuring out how to profile the system performance.

It turned out that SysTick timer was designed to be super simple to use. Even better, it is identical on every ARM Cortex microcontroller out there! This includes even the memory address where its control registers are located. Superb!

I wrote a short example code snippet which demonstrates the basic usage of SysTick timer. The example is HERE.

No comments:

Post a Comment