Multiple compares on one intervaltimer?

Status
Not open for further replies.
Is it possible to configure an interval timer, such that it can support more than one compare interrupt?

In example,

[counter start]
.
.
.
.
.
[compare 0] -> irq_handler_0()
.
.
.
.
[compare 1] -> irq_handler_1()
.
.
[STOP (or retrigger if continuously running)]


Ideall, without breaking the intervaltimer library functionality? If so, I would like to add this functionality to intervalTimer.
 
You can do it the indirect way. Let the interval timer trigger an interrupt routine at the shortest needed interval. Within the latter, you increase a counter and then depending on the counter value, within a swich() statement, you execute the conditional code.
 
That capability does not exist in the PIT timers which IntervalTimer uses.

The FTM timers do have multiple compare units (2 in some FTM timers, 8 in others), so you could do this with those timers. FTM timers are normally used for PWM, and some libraries like FreqMeasure, PulsePosition, AltSoftSerial use them, so conflicts happen if you use any of those on the same FTM timer.
 
Status
Not open for further replies.
Back
Top