This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Systick precision

Hi all,

To prove that my code was configuring the systick counter correctly, I did a small test. To measure the interval length between each SysTick interrupt handler I used SWV in combination with my IDE (Atollic TRUEStudio), which provides a clock tick count for whenever the microcontroller enters or leaves the handler.

Now the silly thing, I am missing clock cycles. Depending on both the system clock frequency and the configured interval between the Systick interrupts I am missing clock cycles, hence the interval is shorter then expected. For a high clock frequency and short Systick interval, I am not missing any clock cycles, but for a low frequency with a longer systick interval I am missing up to 7 clock cycles.

As this is hardware and fairly simple to use I assume I either oversaw something or my measurement technique is not accurate. Does anyone has an idea?

Parents
  • I'm new here, but if you want precision measurements, the classic way is to use an interrupt to toggle a port bit, then use a scope or counter on that to measure the interval. Who knows what  might be happening inside a toolchain...

Reply
  • I'm new here, but if you want precision measurements, the classic way is to use an interrupt to toggle a port bit, then use a scope or counter on that to measure the interval. Who knows what  might be happening inside a toolchain...

Children
No data