0

Can't put NRF52 Feather board into Low Power mode
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Can't put NRF52 Feather board into Low Power mode

by MasonStrong on Tue Jan 02, 2018 4:55 pm

I've been working with an Adafruit NRF52 Feather board for the last week, and have been struggling to get the board to go into a low power mode. At the moment, I am working within the Arduino IDE. Typically the board draws about 14mA just sitting in an idle loop. I have been able to reduce this usage to about 7mA, but this is not nearly enough for our needs, nor does it align with the expected power draw according to the nordic documentation.

I am using the BSP provided by Adafruit for the NRF52 Feather.

Based on the post here: viewtopic... I should be able to put the device into a low power mode using the low level API.

Based on this issue for the BSP, it seems that low power isn't implemented.. https://github.com/adafruit/Adafruit_...

I've tried the following:

Code: Select all | TOGGLE FULL SIZE
void loop() {
    sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
    waitForEvent();
}


Leads to a constant power draw of 14mA.

Code: Select all | TOGGLE FULL SIZE
void loop() {
   __WFE();
   sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
   sd_app_evt_wait();
}


Also has a constant power draw of 14mA.

Code: Select all | TOGGLE FULL SIZE
void loop() {
    sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
    __WFE();
}

Will draw about 15mA.

Code: Select all | TOGGLE FULL SIZE
void loop() {
    sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
    __WFI();
}


Draws about 6-7mA.

Code: Select all | TOGGLE FULL SIZE
void loop() {
    __WFI();
}


Just the wait for interrupt call has virtually identical power draw, 6-7mA.

Code: Select all | TOGGLE FULL SIZE
void loop() {
    NRF_POWER->SYSTEMOFF = 1;
}


Draws about 6-7mA, despite being the lowest power saving mode.

I've also tried explicitly turning off hardware in setup, and the main loop with the following. It has no influence on the power drawn.

Code: Select all | TOGGLE FULL SIZE
    NRF_UARTE0->ENABLE = 0;  //disable UART
    NRF_SAADC ->ENABLE = 0; //disable ADC
    NRF_PWM0  ->ENABLE = 0; //disable all pwm instance
    NRF_PWM1  ->ENABLE = 0;
    NRF_PWM2  ->ENABLE = 0;
    NRF_TWIM1 ->ENABLE = 0; //disable TWI Master
    NRF_TWIS1 ->ENABLE = 0; //disable TWI Slave

    NRF_SPI0 -> ENABLE = 0; //disable SPI
    NRF_SPI1 -> ENABLE = 0; //disable SPI
    NRF_SPI2 -> ENABLE = 0; //disable SPI

    NRF_NFCT->TASKS_DISABLE = 1; //disable NFC, confirm this is the right way


I was thinking perhaps this could be due to the board sitting in a debug mode, but triggering a reset via the hardware switch, and by shorting the reset pin, has no effect on current drawn.

I attempted porting the ArduinoLowPower library (which supports the arduino Primo but not the feather) without success (missing dependencies, maybe from the sdk, I'm a bit lost there).

I'm feeling lost and confused. Can anybody give me some guidance? There is a USB/TTL bridge on the board that draws 17mA at peak according to its datasheet, and 100uA when suspended. LEDs are off. The only other hardware on the board is some simple reset and charging circuitry.

MasonStrong
 
Posts: 4
Joined: Tue Jan 02, 2018 4:51 pm

Re: Can't put NRF52 Feather board into Low Power mode

by adafruit_support_mike on Wed Jan 03, 2018 12:59 am

The sleep current spec for the nRF52 only applies to the nRF52 itself.. not to any of the other hardware.

The Feather has a CP2104 USB-to-Serial converter that lives upstream of the voltage regulator, and that consumes 5mA to 7mA in normal operation. There's also the LiPo charger, voltage regulator, and various other parts that have small amounts of leakage current. The CP2104 is the major current load aside from the microcontroller though.

adafruit_support_mike
 
Posts: 60736
Joined: Thu Feb 11, 2010 2:51 pm

Re: Can't put NRF52 Feather board into Low Power mode

by MasonStrong on Wed Jan 03, 2018 12:23 pm

Is it possible to disable the CP2104? If I'm not using the Serial connection I would think that it should only be drawing 100uA.

EDIT: I've been trying to remove the IC from the board. This has been difficult due to size constraints. Absolutely butchered the leads, and still had to break off most of the plastic and cut deeper in order to see a power drop. Got the power draw for a simple LED blinking triggered by an interrupt to be <1mA.

Thanks for the help. I'll need to figure out a more efficient / easier way of reducing the power draw. I don't have the tools on hand to try and solder a lead to the enable pin to hold the chip in suspended mode.

MasonStrong
 
Posts: 4
Joined: Tue Jan 02, 2018 4:51 pm

Re: Can't put NRF52 Feather board into Low Power mode

by adafruit_support_mike on Thu Jan 04, 2018 12:10 am

If you're building a system that needs to wake periodically, we have the TPL5110 low-power timer breakout:

https://www.adafruit.com/product/3435

That controls power to a circuit, and with the power-on LED disabled, draws less than 100nA while idle.

adafruit_support_mike
 
Posts: 60736
Joined: Thu Feb 11, 2010 2:51 pm

Re: Can't put NRF52 Feather board into Low Power mode

by ktownsend on Thu Jan 04, 2018 8:23 am

We have a lower power version of the board in the works that offers better power numbers with the CP2104, which is the main culprit here, but it will likely be a few months before it is available (no exact ETA!). The CP2104 power supply was switched from external on the current revision to using the CP2104's internal voltage regulator so that it can shut itself off when not used.

ktownsend
 
Posts: 1447
Joined: Thu Nov 05, 2009 2:18 am

Re: Can't put NRF52 Feather board into Low Power mode

by vegarwe on Tue Jan 09, 2018 1:06 am

MasonStrong wrote:I've been working with an Adafruit NRF52 Feather board for the last week, and have been struggling to get the board to go into a low power mode. At the moment, I am working within the Arduino IDE. Typically the board draws about 14mA just sitting in an idle loop. I have been able to reduce this usage to about 7mA.


Thanks Mason for a great question. I was wondering the exact same thing. I've been comparing the consumption of the nRF52 Feather board with the nRF52 breakout board from Sparkfun (WRL-13990). It's not really a fair comparison since the latter doesn't have a charger on the board, but it gives me an idea of what the nRF52 chip is using.

I can get the WRL-13990 to spend something like 60uA at 4.2V advertising and waking up ever other second to sample a sensor. But the exact same hex file on the feather would use 6mA.

ktownsend wrote:We have a lower power version of the board in the works that offers better power numbers with the CP2104, which is the main culprit here, but it will likely be a few months before it is available (no exact ETA!). The CP2104 power supply was switched from external on the current revision to using the CP2104's internal voltage regulator so that it can shut itself off when not used.


Thank's Kevin, that's great news! I like the feather form factor and the fact that it has the charger circuit and UART on the board. But the current version is really problematic with the big current draw.

With the extra components on the feather, will you get close to the WRL-13990? The form factor and features makes the feather much more interesting, so I'm hoping for the best.

vegarwe
 
Posts: 5
Joined: Tue Jan 09, 2018 12:45 am

Re: Can't put NRF52 Feather board into Low Power mode

by ktownsend on Tue Jan 09, 2018 7:36 pm

I don't want to post any concrete numbers until the final boards are in production and have been fully tested with proper test equipment (measuring low power accurately is easy to mess up, especially when rapidly switching between power modes). BUT ... changing the CP2104 power scheme should make a night and day difference with the sleep current in terms of battery usage, since that's where most of the current leakage was happening. Sorry to be vague about this ... I just don't want to prematurely make false promises with specific numbers since there are a number of potential leakage sources on this board compared to some other simpler designs out there, and low power is something where /everything/ needs to be just right to get the kinds of number you're looking for.

ktownsend
 
Posts: 1447
Joined: Thu Nov 05, 2009 2:18 am

Re: Can't put NRF52 Feather board into Low Power mode

by ForceFitLabs on Thu Mar 01, 2018 12:58 pm

We are now about 2 months in and I see the original nRF52 is no longer in stock and hasn't been for a while. We are currently testing with the nRF52 Feather but we cannot move into large scale testing using these boards due to the low power issues on the original board. Any updates to the low power mode revision board?

ForceFitLabs
 
Posts: 1
Joined: Thu Mar 01, 2018 12:54 pm

Re: Can't put NRF52 Feather board into Low Power mode

by jubueche on Sat Mar 03, 2018 10:32 am

Hey,

I am not sure about the following: If I use NRF_POWER->SYSTEMOFF = 1;
what interrupts will wake up the controller?
Do I understand correctly that when I use sd_power_system_off(); the chip will still advertise? It says that any interrupt will wake up the device from this call, so I don't see the point of appending this statemnt by __WFI(); Why do we do this?

jubueche
 
Posts: 53
Joined: Mon May 15, 2017 4:49 am

Re: Can't put NRF52 Feather board into Low Power mode

by hathach on Mon Mar 05, 2018 9:41 am

when waking up from System off, nrf52 will require an full system reboot. One of the condition is an logic (high or low) on an hw pin.
Check out our helper here
https://github.com/adafruit/Adafruit_nR ... ing.c#L102

There are another means to wake up, you may want to check out Nordic nrf52832 product specification for detail.

Do I understand correctly that when I use sd_power_system_off(); the chip will still advertise?


No, the cpu enters hibernation. Nothing that require cpu such as running a nop statment could run util it wake up and reset. Some cpu-independent may run though e.g PWM. but you need to check the Nordic Spec to be sure.

It says that any interrupt will wake up the device from this call, so I don't see the point of appending this statemnt by __WFI(); Why do we do this?


CPU can handle an event in very quick time, e.g Let's assume the time it takes to send an advertising packet is 1ms, and you have to send it every 20ms. If you use wif(), you could sleep in 19ms and only wake for 1 ms. That is short but in term of percentage that is 95% energy saving for CPU (of course there is other factor e.g 1ms of on-air radio will consume more than 10 idling cpu).

PS: You don't need to call wfi() or waitForEvent() with our library since it is running tickless freeRTOS config now. RTOS kernel will call wfi() whenever there is no task ready to run. Just call delay() when you have nothing to do. Or even better write your code entirely to response to asynchronous event i.e callback and abandon code in the loop(). Then call suspendLoop() to terminate the loop(). We are still working on low power code and guide to how achieve it, so stay tuned.

hathach
 
Posts: 1039
Joined: Tue Apr 23, 2013 1:02 am

Re: Can't put NRF52 Feather board into Low Power mode

by jubueche on Mon Mar 05, 2018 9:53 am

Thanks. That sounds great. Are you currently working on a low power mode library for the nRf52? If that’s the case, it would be cool to see progress via github maybe. Do you think that’s possible?
My usecase is the following: I want to record data for a given time. If I am done recording, I want to start advertising (can I save power here as well or is it already implemented? I haven’t looked at the implementation yet). Once connected, I want to start sending my data via UART (I experienced some corruption of the data but that’s another story). Once I am done sending data, I want to sleep. For that sleep, I attached a circuit to an Interrupt pin. So I have an external interrupt. What power mode do you recommend for that? I would guess System off mode. Also does it make sense to disable other peripherals?
Thanks!

jubueche
 
Posts: 53
Joined: Mon May 15, 2017 4:49 am

Re: Can't put NRF52 Feather board into Low Power mode

by hathach on Mon Mar 05, 2018 10:12 am

jubueche wrote:Thanks. That sounds great. Are you currently working on a low power mode library for the nRf52? If that’s the case, it would be cool to see progress via github maybe. Do you think that’s possible?
My usecase is the following: I want to record data for a given time. If I am done recording, I want to start advertising (can I save power here as well or is it already implemented? I haven’t looked at the implementation yet). Once connected, I want to start sending my data via UART (I experienced some corruption of the data but that’s another story). Once I am done sending data, I want to sleep. For that sleep, I attached a circuit to an Interrupt pin. So I have an external interrupt. What power mode do you recommend for that? I would guess System off mode. Also does it make sense to disable other peripherals?
Thanks!


It is not a low power library, just a few helper functions such as systemOff(). It is more about software discipline, and how you write/design your code. We only test out and provide a how-to guideline that we think could save most of power. We are waiting for next revision board to test out the code and number. However, we are currently focusing on the nrf52840 board. So it may takes some time.

For your use case, if it is ok for nrf52 to reboot, re-advertise and re-connect then go with system off (deep sleep). Otherwise, you may only want it sleep and wake up to keep the connection active. Most of peripherals, if you don't use it at all, it default to power down along with the cpu. Though please check the Nordic specs to be sure.

hathach
 
Posts: 1039
Joined: Tue Apr 23, 2013 1:02 am

Re: Can't put NRF52 Feather board into Low Power mode

by ErnieC53 on Fri Mar 30, 2018 11:30 am

Deleted post
Last edited by ErnieC53 on Fri Mar 30, 2018 11:56 am, edited 2 times in total.

ErnieC53
 
Posts: 29
Joined: Sat Mar 17, 2018 2:38 pm

Re: Can't put NRF52 Feather board into Low Power mode

by ErnieC53 on Fri Mar 30, 2018 11:30 am

Some related info, based on these suggestions - I will try not to make this too long:

I made a circuit using the nRF51 version Feather. Simple application - used a PWM output into an RC filter to provide a set-able DC voltage. Tied that voltage to an analog input so I could both confirm the voltage, and calculate the current draw based on IR drop across the R in the RC. Works wonderfully/simply. That way I could also set a voltage limit and a current limit and actively control those. I used the bleuart example so I could read/set these via the Adafruit cell phone app. My first ever Arduino project, and it made me look like a hero to the customer. And it only took me a handful of hours.

That circuit would run for 4 hours on a 40mAh battery. A multi-meter measurement of the current confirmed about 12mA draw, and an o-scope measurement showed that the baseline (non-transmit) current was in that range, and that the transmit spike added a little to the average.

I then saw the promise in the nRF52 version, so I bought several. The latest version with the improved current draw. I had to re-write the code to match the library changes. Running without software optimization (to compare to the nRF51), it would run about 6 hours on the 40mAh battery, but ran a gazillion times faster. The o-scope indicated that the non-transmit current was about 7mA. Of course, this meant that the transmit had a higher percentage impact on the average.

Adding delay(100) in each process cycle reduced the non-transmit current to less than 1mA.

Long story a little shorter, I finally tried these:

Change the BLE advertise to every 1000us for both fast and slow mode.
Reduced the transmit power to -8dB, if I remember correctly.
For each process cycle (except when setting a new voltage), I added a delay(1000).
Turned off the LEDs.

The performance of the monitoring dropped a bit, but still plenty adequate for the application.

I connected it to the 40mAh battery, and it ran for more than 50 hours! Apparently less than 1mA average draw.

I have not yet tried to disable the onboard 3.3V regulator to see if it helps. At this point, it may be diminishing returns, depending upon the current draw of the load on the provided PWM voltage.

I have not tried any "sleep" states - that gets a bit more complicated, and I am very new at this.

I hope this info helps.

If I get time to measure the baseline current when in a delay() state, I will update.

ErnieC53
Last edited by ErnieC53 on Fri Mar 30, 2018 3:24 pm, edited 2 times in total.

ErnieC53
 
Posts: 29
Joined: Sat Mar 17, 2018 2:38 pm

Re: Can't put NRF52 Feather board into Low Power mode

by ktownsend on Fri Mar 30, 2018 11:39 am

Just a heads up that we now stock a new revision of the nRF52 boards that improves the power consumption by adjusting the way the USB Serial chip is powered. This should give you some additional current draw savings compared to the earlier revision.

ktownsend
 
Posts: 1447
Joined: Thu Nov 05, 2009 2:18 am

Please be positive and constructive with your questions and comments.