sandeepmistry / arduino-nRF5

Arduino Core for Nordic Semiconductor nRF5 based boards
Other
905 stars 279 forks source link

Enables GPIO low accuracy interrupt #367

Open jeanmatthieud opened 5 years ago

jeanmatthieud commented 5 years ago

using the PORT event and the pin SENSE register Linked to issue sandeepmistry/arduino-nRF5#153

jeanmatthieud commented 5 years ago

With the NRF51822, it reduces the consumption of the chip of around 1mA compared to GPIO IN events.

dlabun commented 5 years ago

Did you test these changes with a SD on the chip?

jeanmatthieud commented 5 years ago

What do you mean by SD ? (Sorry I'm not an English native)

dlabun commented 5 years ago

Soft Device, the pre-compiled Bluetooth executable

jeanmatthieud commented 5 years ago

Yes, I only use soft device S130 with a rev 3 chip (nRF51822). I do not own nRF52 chips.

dlabun commented 5 years ago

Before this gets merged I would like to see it tested on a nRF52

jeanmatthieud commented 5 years ago

I bought a nRF52 board, but didn't find the time to do it yet.

sullivanzheng commented 3 years ago

@dlabun @sandeepmistry @jeanmatthieud 2 years have since passed and wondered if the arduino-nRF5 has resolved the energy consumption issue?

See this pull request still not merged, guess the nRF51822 high current consumption issue during sleep was resolved somewhere else?

jeanmatthieud commented 3 years ago

Hi, Sadly, I never took the time to test it on the nRF52... But the branch was working for me on the nRF51822

sullivanzheng commented 3 years ago

Hi, Sadly, I never took the time to test it on the nRF52... But the branch was working for me on the nRF51822

Yes I used your branch. Works for me too. Thanks a lot for implementing this highly needed feature. After all, BLE without proper low energy features is nothing.

oryjkov commented 3 years ago

@jeanmatthieud Thanks for the blog post and this pull request. Worked for me as well, except for attachInterruptLowAccuracy() not clearing the SENSE field, so it did not work to switch between RISING and FALLING modes. I had to add this before the switch in attachInterruptLowAccuracy().

NRF_GPIO->PIN_CNF[pin] &= ~(GPIO_PIN_CNF_SENSE_Msk);