AnsweredAssumed Answered

How to handle overflows in a register like DWT_CYCCNT

Question asked by mich.lei on Sep 6, 2016
Latest reply on Sep 6, 2016 by mich.lei
There are examples counting clock pulses with the DWT_CYCCNT, but it will overflow in time.
Counting pulses is easy if there is no overflow, but with overflow I am sure there nice way of doing it.
I could do something like this.
if old value>new value
Max count of DWT_CYCCNT-old value+ new value.
But how to get the max in DWT_CYCCNT and what happens if the DWT_CYCCNT overflows twice or more.

Outcomes