Interrupt during execution of interrupt handler?

Hi,

I was wondering what would happen if an interrupt was triggered while an interrupt handler was running.

I am interested in this both for the same interrupt pin and on different interrupt pins.

Some context - I have a purchased a tipping bucket rain sensor and a wind speed sensor which both causes switches to be switched so you can count the number of times the switch has been pressed and calculate the speed / rain fall.

What I was thinking of doing, is hooking these up to one of the interrupt pins on the Arduino so the ATMega can be sleeping most of the time and wake up on activity.

What I was wondering though, is what if there is a lot of wind/rain and while an interrupt handler is running and sending the values over a radio module to the base station, another interrupt came in.

Is it possible to handle this, so no events are missed?

For the same reason, would it be wise to use a separate Arduino for each sensor rather than different interrupt pin on the same board for each.

Thanks,

Ian

I was wondering what would happen if an interrupt was triggered while an interrupt handler was running.

By default, interrupts are disabled while an ISR is running. Unless you enable them in the ISR (not a good idea unless you know what you're doing), this situation can't arise.

I am interested in this both for the same interrupt pin and on different interrupt pins.

Same answer.

What I was thinking of doing, is hooking these up to one of the interrupt pins on the Arduino so the ATMega can be sleeping most of the time and wake up on activity.

Do they really change often/fast enough to need interrupt handling? By all means, use the interrupt pin to wake the Arduino. But, then you don't need interrupt capabilities to read the switch(es).

and while an interrupt handler is running and sending the values over a radio module to the base station

Whoa. Halt. That's NOT what an ISR is for. Quick is what an ISR needs to be. Sending stuff over a radio module is NOT quick.

Thanks for the reply.

So would you use the ISR to purely wake up - and then read the switches and send the radio signal in the loop?

So would you use the ISR to purely wake up - and then read the switches and send the radio signal in the loop?

I would use the interrupt pins to wake up, and read the sensor data, but that’s because I know how to use interrupts (and how not to). Definitely, sending the data happens in loop().

ok, thanks.