Attaching multiple internal-interrupts to the same timer

Hi guys!
I'm rather new to the community, so I'd really appreciate the help.
Can you attach multiple interrupts to the same timer?
I need to read 3 packs of sensors on 3 different periods. So I figured I'd use timers and this is my problem. and I know that when each pack is done I can set a new timer interrupt for the next pack. but I thought maybe there's a better way?
Tnx a lot in advance.

I thought maybe there's a better way?

Why do you need to use timer interrupts at all? Is it that important to read the data at exactly some interval?

You can only have one interrupt handler for each type of interrupt (pin change, external, timer, etc.). You can do lots of stuff, conditionally or unconditionally, in the one ISR.

That doesn't mean that you should, just that you could.

That doesn't mean that you should, just that you could.

You could get three interrupts at different times from one timer if you use compare match A, compare match B, and overflow interrupts.

You could get three interrupts at different times from one timer if you use compare match A, compare match B, and overflow interrupts.

Can you attach different handlers to each of those three events?

Yes. For example Timer1 AT328

TIMER1_COMPA_vect
TIMER1_COMPB_vect
TIMER1_OVF_vect

Hi Cattledog,

do you know, if anybody posted an Arduino Timer-Interrupt-Library to the board?
I could do it on my own, but why re-inventing the wheel, if there is something ready?

Thx a lot for prompt answer, even after this long period
kr, sepp2gl

do you know, if anybody posted an Arduino Timer-Interrupt-Library to the board?
I could do it on my own, but why re-inventing the wheel, if there is something ready?

There are simple libraries for Timer1 Timer2 and Timer3, but they are not full featured for multiple interrupt handlers.

https://www.pjrc.com/teensy/td_libs_TimerOne.html
https://www.pjrc.com/teensy/td_libs_MsTimer2.html

I didn't find anything else through the library manager when filtering for "timer interrupts".

@cattledog:
Thx a lot for the links.
I will examine tomorrow esp. with respect to compare functionality.

Sorry for late response: I noticed your reply just now.
Will update my notification settings right away.

kr, sepp2gl