Using Hardware Interrupts while ultra low power mode

I have an empty loop and only two hardware interrupt functions. It is necessary to react really fast on interrupts. How can I reduce the power consumption to a minimum?

Consult the data sheet of your controller.

Don't you have better to do then writing not helpful answers? Poor you!

You are alone as long as you don't specify which controller you are using.

According to your attitude I suggest you better ask in this forum section.

Perhaps ask a helpful question ?

Do you not think that the answer to your question will depend entirely on the particular Arduino you are using ?

I did not select any MCU now. I just have the application from above and searching for the best solution now

Will an ATtiny be sufficient for your project?

Yes, definitely :slight_smile: my requirements are just the ability two have two hardware interrupts and I want to last a AA battery for a year.

The purpose is, to identify which pin gots triggered first. And there is very little time in between the two interrupts, so I need the mcu really responsive. So best would be sending it to deep sleep and wake it instand on hardware trigger.

But maybe there is a complete other way

Do you know what "very little time" actually is ?

Yes, I calculated it to be around 0,05 s in between IR on pin 1 and IR on pin 2

50 ms? That is a very long time. Maybe you want to tell us what the MCU should do next? Determining which input was first is useless without another action.

mmmm 50mS for the processor to come out of sleep mode and start timing stuff ..................

Just about any MCU will be fine, given 50 ms in which to act.

So yes, there is basically nothing else to do, than determine which pin triggers first.

Finally I would like to store this info to a database. I did take a look into the data sheet from an esp8266, but it’s not possible to wake it up by external interrupts except the wake up pin. So I thought maybe I have another mcu, which can sleep as long, it gets a signal, wake up fast enough to determine the order of pin rising and then wakes up the esp to tell him, which pin triggered first. Then the esp can do its internet database thing and go to sleep again.

I know it sounds overkill, but I don’t see a better way. Or what do you think? And which mcu can handle the 50ms determination while sleeping ?

None of them.

That’s what I was afraid of

Maybe you should rethink your question. In sleep mode, the processor clock is stopped, so the processor can't do any "determinations".

The AT series, running on an 8MHz internal clock, can take around 2 ms to wake up from power down sleep (if the fuses are set appropriately).

You mean 2 us for AVR to wake up?

I don't know if ESP is able to wake up quickly enough for this but surely some discrete logic could hold the information what was first until ESP wakes up.

I meant exactly what I wrote, although 2 us may be possible. Depends on the fuse settings.

Edit: I rechecked and it is 4 ms wake up, with the 8MHz internal clock (2 ms for 16 MHz). The clock fuses may be set to skip the delay, at the risk of unreliable processor functioning in the case of slowly rising Vcc.