This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to create a timer without using interrupts?

Hi,

I am looking for a way to keep track of time while interrupts are disabled. I am using the Flash-API to program some data and it is advised to disable all interrupts during this time. Since this can take a long time, I still need to feed the watchdog. I can't use the API-Function to trigger the watchdog since it only has an upper boundary. My watchdog on the other hand has to be called within a time-window with lower and upper boundaries.

Is there a good way to do this?

  • Hello,

    You might wish to take a look at the Performance Monitoring Unit (PMU) embedded inside the Cortex R4 CPU.  The PMU has a free-running cycle counter as well as three user selectable event counters.  The CPU has internal event notification of cycles inside an exception handler, which could be very helpful in your situation.  Access is done via CP15 coprocessor instructions so the timers have very low latency.

    Regards,

    Karl

  • Thank you, this suggestion works very nicely.