Logging the CPU time on an interrupt automatically?

Status
Not open for further replies.

kdharbert

Well-known member
I have an application where an swarm of interrupts will hit a set of pins. The application is to communicate timing data over the air as finely in time as possible. I need to log the CPU time for the interrupts on each pin...but they are closely spaced in time and can hit during the same clock cycle...and I need to detect if that happens.

It seemed plausible that there is a way to do this behind the scenes without ever running an ISR...instead the CPU time is simply saved to a memory location and the regular program can poll it. Does functionality like this exist?
 
Closest thing might be the ARM DWT cycle counter. You can read it at any time to get a 32 bit count of the number of cycles since started. Not sure if that can be used to detect when 2 interrupts are pending at the same instance, but maybe you can get close?
 
Sounds to me like you want "input capture", where the hardware records the time when pins change.
 
Status
Not open for further replies.
Back
Top