frankzappa
Well-known member
I'm new at programming, I'm still half way through a book on C programming and I'm learning so bare with me.
Is there a limit on how many timers you can run simultaneously with the teensy 4?
I'm measuring the width of peaks on a AC signals so I check when the value crosses above zero and when it comes back down. I have 10 sensors to measure. There are two ways I can think of doing this.
Either let one timer run indefinitely and just subtract the time when the peak went over zero from the time it went back down. This would give me the width of the peak.
Or set a timer to 0 when the value is rising over zero and store the elapsed time when it comes back down.
The first one would produce some insanely huge numbers quickly (because I'm measuring microseconds) and the second method would need 10 timers running because the peaks occur at the same time slightly shifted from each other.
I would prefer the second. Is there a limit to the amount of timers I can have running and are there any drawbacks?
Any better suggestions on how to do this?
One other method would be just counting the amount of ADC samples elapsed when the value is above zero, they come in at regular intervals.
Is there a limit on how many timers you can run simultaneously with the teensy 4?
I'm measuring the width of peaks on a AC signals so I check when the value crosses above zero and when it comes back down. I have 10 sensors to measure. There are two ways I can think of doing this.
Either let one timer run indefinitely and just subtract the time when the peak went over zero from the time it went back down. This would give me the width of the peak.
Or set a timer to 0 when the value is rising over zero and store the elapsed time when it comes back down.
The first one would produce some insanely huge numbers quickly (because I'm measuring microseconds) and the second method would need 10 timers running because the peaks occur at the same time slightly shifted from each other.
I would prefer the second. Is there a limit to the amount of timers I can have running and are there any drawbacks?
Any better suggestions on how to do this?
One other method would be just counting the amount of ADC samples elapsed when the value is above zero, they come in at regular intervals.