LowPowerLab Forum

Hardware support => Low Power Techniques => Topic started by: tavalin on February 13, 2015, 10:30:21 PM

Title: LowPower and RFM69 receive interrupt
Post by: tavalin on February 13, 2015, 10:30:21 PM
Hi all,

I'm trying to reduce the energy consumption of my RFM69 node.  What I'm trying to achieve is that the node runs in low power mode (power down) between sending transmissions every x seconds. I'd also like it to come out of low power mode if it receives a message or ack in order to process it and then go back to low power mode.

I had tried to use the built in interrupt on D2 but it seems like the library depends on this so I didn't want to override the interrupt handling method.  I've looked at MotionMote example which uses an interrupt on D3, would I be able to connect D2 and D3 and then create the interrupt on D3 so I can create my own additional handler for the interrupt?

Any tips or feedback appreciated.

Thanks,
Daniel
Title: Re: LowPower and RFM69 receive interrupt
Post by: Felix on February 14, 2015, 09:03:00 PM
Daniel,
Always keep interrupts separate. There are 2 hardware interrupts on the atmega328/Moteino - D2 and 3. D2 is used by radio, if included on Moteino. So you're left with D3, use it as shown in the MotionMote code. You can always use any other pin as a pin change interrupt but then you have to check which pin caused the interrupt. That's all.
Title: Re: LowPower and RFM69 receive interrupt
Post by: tavalin on February 15, 2015, 03:40:58 PM
Hi Felix

Having read and thought about your reply (which initially confused me) I've now realised that even though the library handles the interrupt 0, it will still wake my loop code that is/was blocked at powerDown().

I was under the assumption that I had to implement my own interrupt for this to happen.

Thanks for your help.
Title: Re: LowPower and RFM69 receive interrupt
Post by: Felix on February 15, 2015, 05:08:41 PM
Interrupts will wake the MCU, run any interrupt that was configured for that particular type of interrupt, and then resume execution from where it left of before sleeping. Then you have the option to put it back to sleep if you want to.