Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attachInterrupt() current consumption #153

Closed
d00616 opened this issue Apr 26, 2017 · 4 comments
Closed

attachInterrupt() current consumption #153

d00616 opened this issue Apr 26, 2017 · 4 comments

Comments

@d00616
Copy link
Contributor

d00616 commented Apr 26, 2017

When the MCU goes into sleep mode after attachInterrupt() it consumes 1mA. This is too much for a battery powered application.

I prefer to switch from Config Channels to Pin Sense. This allows sleeping with uA current. Pin Sense is not so flexible like Config Channels. This requires a logic to find out what pin was changed. Falling and Rising detection is easily possible. Pin change needs some logic.

Switching to Pin Sense allows monitoring of more Pins than Config Channels.

If it not possible to switch to pin sense, I need handling of NRF_GPIOTE->EVENTS_PORT, so I can implement my own routine.

When it is acceptable to switch to Pin Sense, I create a Pull Request.

Btw. I think the actual implementation will fail when multiple pins are inserted and removed in different order.

@sandeepmistry
Copy link
Owner

@d00616 how are you making the board go to sleep?

@d00616
Copy link
Contributor Author

d00616 commented May 8, 2017

@sandeepmistry I use the __WFE(); __SEV(); __WFE(); sequence.

When GPIOTE channels are disabled, I measure a sleeping current around 3uA. When enabled the current is around 950uA. -> https://devzone.nordicsemi.com/question/2471/gpio-wakeup-low-power-workarounds/

@d00616
Copy link
Contributor Author

d00616 commented Jul 2, 2017

Hello @sandeepmistry it seems the high current consumption is a nRF51 specific problem documented as PAN #39. It's marked as fixed in PAN v 3.0 and later: http://infocenter.nordicsemi.com/pdf/nRF51822-pan_v3.0.pdf

@jeanmatthieud
Copy link

jeanmatthieud commented Jun 27, 2019

Hi,
It's not a problem, it's a known limitation of the chip, cf. PS 8.11 and RM 15.1.2 :

Setting up one or more GPIO DETECT signals to generate PORT EVENT, which can be used either as a wakeup source or to give an interrupt, will not lead to an increase of the current consumption.

This feature is always enabled although the peripheral itself appears to be IDLE, that is, no clocks or other power intensive infrastructure have to be requested to keep this feature enabled. This feature can therefore be used to wake up the CPU from a WFI or WFE type sleep in System ON with all peripherals and the CPU idle, that is, lowest power consumption in System ON mode.

I agree with the initial issue: with the current implementation, it's not possible to switch to pin sense (sometimes called "low accuracy") and get the callback from the interrupt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants