Hi there,
Outstanding, Nice tracking that down. Glad to provide some extra POV.
Very NICE, 2.5uA YOWSA!!!
GL PJ
Hi mate! I’m thinking about buying also a Nordic PPKII.
Could you please provide further insights on how exactly did you connect the XIAO to the PPK in order to measure current? I was trying to measure with a KEITHLEY Electrometer in series with a USB-C cable whose Vcc was cut (as in the video @daCoder introduced earlier), but either my USB-C is weird (only 3-wires, I guess ground is in the shield I could kind of messed up when I cut everything) or I’m doing it wrong as I’m running your codes with non-mbed
board version and only reading as min as 2 mA…
Thanks a lot!
Hi there,
Sure,
The PPKII comes with some wires to connect it in two possible ways, One the PPKII provides power to the battery pads on the bottom of the Xiao’s DUT(device under test) This is adjustable also with a slider to select the Exact Voltage for testing different levels. (source power)Amber lit LED.
Second Method and probably the most usable and flexible is to (sync power) Blue lit LED and like an AMP meter in-line with the device allowing a battery to be the Source Voltage and monitor the current running through the PPKII . hence showing the current draw of the DUT. awake or sleeping.
This allows testing diferent battery types and sizes.
NOTE: You must use the Battery +/- PADS on the bottom ALWAYS
I use the little jst connector with flying leads soldered to the pads, See the pictures for more.
It the PPKII and the Nordic BLE Dongle are one of the most used test kits fo rme to date.
the extra’s too are nice , a built in logic analyser of sorts is useful for monitoring the state of other pins while debugging and testing effects of hardware changes on program operation and power consumption. The PPKII is $99 and a VERY good investment. The Dongle is $9 and is invaluable for testing BLE connections and code debugging in real time. Add in some other abilities like a BLE Sniffer and is compatible with wireshark.
I love Nordic devices , because they build the TOOLS first then the Devices, not the other way around as many companies do. There Dev boards are almost too powerful for tinkerer’s but Fit like a glove for a developer. They update there software and maintain a HIGHER level of support than any in the space, Including Expressif who just cranks out the same tired basic ESP32 stuff with only some being low power in real use cases. Nordic is the leader in LOW power, has been for a while.
There N54L Series triples the cpu speed and cutting in half the power requirements. BLE they rule the world with the MOST BLE devices in the world today.
that’s my rant and take on it .
HTH
GL PJ
seeed needs to get with the program and refresh it’s Nrf offering the 52840 is 2 generations behind so…
my hope is they (Nordic) release there soc that has WiFi and BLE on the same silicon.
i need to get one of those power profilers…
Thanks a lot! I will get the two dongles then
Therefore, red and black jumper cables to the bottom of XIAO go to +/- BATT pads, right? But then the red probe connector with the black jumper is supposed to be GND from the bottom of XIAO as well?
And the ammeter is within the PPKII itself and measures the current drawn by XIAO as you mentioned. This last part I got it, I just wanted to make sure about the connections.
Thanks again!
Ht there,
The red test hook is from the logic analyzer function to look at the state of the pin I was testing for output.
Normally not connected unless your looking at signals separate from monitoring the Battery and sleep current.
Yes, PLUS(+) and MINUS(-) from battery pads are all you need. the other is the advanced course…LOL
HTH
GL PJ
there’s a small diagram on the PPK as to which to use for what…
Hi there,
I have the issue that my powerconsumption is arround 10mah in deep sleep.
I tried many diffrent codes.
The last was from a guy on this page.
#include <bluefruit.h>
#include <Adafruit_FlashTransport.h>
//
void setup()
{
//
Adafruit_FlashTransport_QSPI flashTransport;
Bluefruit.begin();
flashTransport.begin();
flashTransport.runCommand(0xB9);
flashTransport.end();
//
delay(10000);
NRF_POWER->SYSTEMOFF = 1;
}
void loop()
{
}
even with this code I still get 10mah.
Setup:
3v3-Button-Pin3
Batterie with 100mah
UF2 Bootloader 0.6.1 lib/nrfx (v2.0.0) lib/tinyusb (0.10.1-293-gaf8e5a90) lib/uf2 (remotes/origin/configupdate-9-gadbb8c7)
Model: Seeed XIAO nRF52840
Board-ID: Seeed_XIAO_nRF52840_Sense
SoftDevice: S140 version 7.3.0
Date: Nov 12 2021
Arduino V. 1.8.57
Moreover it is a board without “Sense”.
I hope someone can help me quick.
Please!
Hi there,
and Welcome here…
Did you read any threads about Low Power , You missed one…
Which BSP are you using?
You got EVERYTHING else though it looks like.
HTH
GL PJ
Do you have the USB connected? ie. battery charger activated. are you using the Battery Pads on the Bottom?
Go again and report Back choose the correct board too PLS.
Hi
In Arduino, I’m using the Board Manager from Seeed. The correct board is selected (nRF52840 without Sense). I’ve read most of the threads. USB is not connected. The battery is connected to the battery pads under the board. The battery charger is activated. The board is fresh out of the packaging, and the library is unchanged. Everything is essentially in a new condition.
I use DFU as Programmer.
Hi there,
Ok so that sounds good or close,You know there’s embed and non right?
ie 2.9.2 or 1.1.7? lets say?
Given yes, can you show the first three lines of the compiler output and maybe the last 10 before upload?
using the code tags above </>
your close ,
SO
HTH
GL PJ
Thank you for your response. As I am relatively new to this topic, I do not quite understand what is meant by 2.9.2 or 1.1.7. I suspect, however, that I know what you are trying to tell me, but I am not sure.
Thank you for your time.
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware -hardware ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries -libraries Arduino\libraries -fqbn=Seeeduino:nrf52:xiaonRF52840:softdevice=s140v6,debug=l2 -ide-version=10819 -build-pathAppData\Local\Temp\arduino_build_6853 -warnings=none -build-cache AppData\Local\Temp\arduino_cache_753562 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=ArduinoData\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.arm-none-eabi-gcc-9-2019q4.path=ArduinoData\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.CMSIS.path=ArduinoData\packages\Seeeduino\tools\CMSIS\5.7.0 -prefs=runtime.tools.CMSIS-5.7.0.path=ArduinoData\packages\Seeeduino\tools\CMSIS\5.7.0 -prefs=runtime.tools.nrfjprog.path=ArduinoData\packages\Seeeduino\tools\nrfjprog\9.4.0 -prefs=runtime.tools.nrfjprog-9.4.0.path=ArduinoData\packages\Seeeduino\tools\nrfjprog\9.4.0 -verbose AppData\Local\Temp\arduino_modified_sketch_596344\sketch_aug06a.ino
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\arduino-builder -compile -logger=machine -hardware C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware -hardware ArduinoData\packages -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\tools-builder -tools C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\hardware\tools\avr -tools ArduinoData\packages -built-in-libraries C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.57.0_x86__mdqgnx93n4wtt\libraries -libraries Arduino\libraries -fqbn=Seeeduino:nrf52:xiaonRF52840:softdevice=s140v6,debug=l2 -ide-version=10819 -build-path AppData\Local\Temp\arduino_build_6853 -warnings=none -build-cache AppData\Local\Temp\arduino_cache_753562 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arm-none-eabi-gcc.path=ArduinoData\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.arm-none-eabi-gcc-9-2019q4.path=ArduinoData\packages\Seeeduino\tools\arm-none-eabi-gcc\9-2019q4 -prefs=runtime.tools.CMSIS.path=ArduinoData\packages\Seeeduino\tools\CMSIS\5.7.0 -prefs=runtime.tools.CMSIS-5.7.0.path=ArduinoData\packages\Seeeduino\tools\CMSIS\5.7.0 -prefs=runtime.tools.nrfjprog.path=ArduinoData\packages\Seeeduino\tools\nrfjprog\9.4.0 -prefs=runtime.tools.nrfjprog-9.4.0.path=ArduinoData\packages\Seeeduino\tools\nrfjprog\9.4.0 -verbose AppData\Local\Temp\arduino_modified_sketch_596344\sketch_aug06a.ino
Using board 'xiaonRF52840' from platform in folder: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8
last
Zip created at AppData\Local\Temp\arduino_build_6853/sketch_aug06a.ino.zip
Bibliothek Bluefruit52Lib in Version 0.21.0 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Bluefruit52Lib wird verwendet
Bibliothek Adafruit_nRFCrypto in Version 0.0.5 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_nRFCrypto wird verwendet
Bibliothek Adafruit_TinyUSB_Arduino in Version 1.7.0 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_TinyUSB_Arduino wird verwendet
Bibliothek Adafruit_SPIFlash in Version 4.2.0 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_SPIFlash wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SPI wird verwendet
Bibliothek Adafruit_LittleFS in Version 0.11.0 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\Adafruit_LittleFS wird verwendet
Bibliothek InternalFileSytem in Version 0.11.0 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\InternalFileSytem wird verwendet
Bibliothek SdFat in Version 2.2.1 im Ordner: ArduinoData\packages\Seeeduino\hardware\nrf52\1.1.8\libraries\SdFat wird verwendet
non mbed, BSP versoin 1.1.8 have you tried 1.1.1 ?
do you know how to roll it back (select older one in boards)?
GL PJ
You’re close ,you’ll get there.
I have installed 1.1.1, but there is no change. The current is still at 10mA. Additionally, Adafruit_FlashTransport.h is no longer usable.
Seeeduino\hardware\nrf52\1.1.1\libraries\Bluefruit52Lib wird verwendet
have now flashed another nRF52 board with the same code. On that board, the current drops to 0.01mA. I can’t explain why the other board does not go below 10mA.
Hi there,
Look for shorts to the can on that board, Magnifier from any of the pins. they are BLE’ versions NOT the Sense version with PDM mic on it?
GL PJ
I have a board that flew too close to the sun (battery mishap) it stays at 60ma. so
Hi
I just soldered 2Pins and the battery to the board. Everything works fine. (deepsleep dos not work fine )
Its like 2 Days old
they are BLE’ versions NOT the Sense version with PDM mic on it? on all boards I have bought…no
Hi there,
I’ve tested with this one , whenever I’m looking to save Power. usually les than 13 ua.
// Lowest power BSP 1.1.8 less than 20 ua.
// d:\Users\Dude\Pictures\ppk-LoPower_ Sketch_.png
//
#include "Adafruit_SPIFlash.h"
#include <nrf52840.h>
#define DO_WORK_PIN D2
#define SHUTDOWN_PIN D3
Adafruit_FlashTransport_QSPI flashTransport;
SemaphoreHandle_t xSemaphore;
bool gotoSystemOffSleep = false;
int work_LED_status = HIGH;
void setup()
{
pinMode(LED_RED, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
pinMode(LED_BLUE, OUTPUT);
digitalWrite(LED_RED, HIGH);
digitalWrite(LED_GREEN, HIGH);
digitalWrite(LED_BLUE, work_LED_status);
pinMode(DO_WORK_PIN, INPUT_PULLUP_SENSE);
attachInterrupt(digitalPinToInterrupt(DO_WORK_PIN), doWorkISR, FALLING);
pinMode(SHUTDOWN_PIN, INPUT_PULLUP_SENSE);
attachInterrupt(digitalPinToInterrupt(SHUTDOWN_PIN), shutdownISR, FALLING);
//start bluefruit (this also starts the soft device if you don't start the sd then none of your sd_* calls will do anything
//Bluefruit.begin();
QSPIF_sleep();
xSemaphore = xSemaphoreCreateBinary();
// Flash green to see power on, reset, and wake from system_off
digitalWrite(LED_GREEN, LOW);
delay(1000);
digitalWrite(LED_GREEN, HIGH);
delay(1000);
digitalWrite(LED_GREEN, LOW);
delay(1000);
digitalWrite(LED_GREEN, HIGH);
NRF_POWER->DCDCEN = 1;
NRF_POWER->TASKS_LOWPWR = 1;
uint32_t dcdcen = NRF_POWER->DCDCEN;
//uint32_t tasks_lowpwr = NRF_POWER->TASKS_LOWPWR;
//Serial1.print("DCDCEN: 0x");
//Serial1.println(dcdcen, HEX);
//Serial1.print("TASKS_LOWPWR: 0x");
//Serial1.println(tasks_lowpwr, HEX);
}
void doWorkISR()
{
xSemaphoreGive(xSemaphore);
}
void shutdownISR()
{
gotoSystemOffSleep = true;
xSemaphoreGive(xSemaphore);
}
void loop()
{
// FreeRTOS will automatically put the system in system_on sleep mode here
xSemaphoreTake(xSemaphore, portMAX_DELAY);
if (gotoSystemOffSleep)
{
//Flash red to see we are going to system_off sleep mode
digitalWrite(LED_RED, LOW);
delay(1000);
digitalWrite(LED_RED, HIGH);
NRF_POWER->SYSTEMOFF=1; // Execution should not go beyond this
//sd_power_system_off(); // Use this instead if using the soft device
}
// Not going to system off sleep mode, so do work
work_LED_status = !work_LED_status;
digitalWrite(LED_BLUE, work_LED_status);
//Serial.println(" working");
}
void QSPIF_sleep(void)
{
flashTransport.begin();
flashTransport.runCommand(0xB9);
flashTransport.end();
}
getting this PPK power on battery…
here is the DUT…
HTH
GL PJ
Add the D2 D3 jumper to ground (touch) to switch modes, Work , and Power down.
Works well.
Power down average is 2.72uA.
Hi
Now everything works fine. Just one laste thing. I am using connection led but it will not shut off.
If the board is advertising and you shut the board in deepsleep the light stays on.
digitalWrite(XX, HIGH); dos not work.
Bluefruit.Advertising.stop(); no effect on the light.
void enter_deep_sleep() {
// Print a message before entering deep sleep
Serial.println("Entering deep sleep...");
pinMode(BUTTON_PIN, INPUT_PULLDOWN_SENSE); // Set the pin to pull-down and sense high level
nrf_gpio_cfg_sense_input(BUTTON_PIN, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
delay(500);
Serial.println("Qspif");
Bluefruit.Advertising.stop(); // Stop advertising
delay(100);
Serial.end();
QSPIF_sleep();
// Enter deep sleep mode
//NRF_POWER->SYSTEMOFF=1;
sd_power_system_off();
}
It is not the lowest consumption if the led stays on.
edit:
Bluefruit.autoConnLed(true);
Bluefruit.autoConnLed(false);
found it
Hi everyone. This seems like great progress. I noticed however that still while the controller is not in deep sleep the Interrupts still consume extra power. If I was for instance broadcasting BLE Beacon data and I wanted to attach an interrupt on a pin. How would I go by not having the power usage increase?
Hi there,
So I read that some of the interrupt pins use more power if latched or if Edge vs, level for the interrupt to be generated there’s that and also if you use the pull up or pull down during sleep.
HTH
GL PJ