Update: To use power_on sleep I need to use softdevice which uses bluefruit library, but bluefruit library is compatible with v.1.0.0 for board manager. This version is toggling with the IMU sensor on the board. Can I have any other way to not use softdevice and put the device in system on sleep mode to save the data. Something similar to NRF_POWER->SYSTEMOFF = 1 command.
Hmmm, Not that I’m aware of maybe someone else can comment, I would think the QSPI flash is where you can store the data before a sleep and system reset as the only wakeup method? I use only Mbed afaik it’s the only way to get BLE and IMU together and patch or hack Battery reading and Sleep mode lameness.
I’m looking toward getting RTC low power INT generated and save data in Flash for my next push. The BLE IMU data notify and connectivity to the MIT AI2 is very good and reliable for me. It’s battery reading and sleep ALL or nothing that SUCK. Nordic has it figured out and so does adafruit, SEEED ?
Hi!
I wrote a very simple code to check the current in sleep mode, measured the current - 8 µa.
According to the manufacturer’s specification, you can get less current.
How to do this ?
Who was able to get a current of less than 8 µA ?
my test code:
void setup()
{
delay(10000);
NRF_POWER->SYSTEMOFF = 1;
}
Here is a rough demo program that draws approx 1uA when idle.
Seeed XIAO nRF52840 (not sense).
LEDs a turned on after a couple of push button switches are polled in Setup after switch interrupts.
Program needs an expert to comment and tidy up.
Hi !
Thank you for your advice.
My project uses a bare nRF52840 chip (there is no spi flash on the board and there is no microphone and there is no sense module).
But the current in sleep mode is still 8 µA.
Here are a couple my of tests and current results following NRF52 simple code for shutdown:
// Basic_Shutdown_20230522_01.ino
// 3.2 volts on 3V3 to GND
// current 21.2 uA during Delay
// current 18.0 uA after Delay
//
void setup()
{
delay(10000);
NRF_POWER->SYSTEMOFF = 1;
}
void loop()
{
}
// Basic_Shutdown_20230522_02.ino
// 3.2 volts on 3V3 to GND
// current 4.4 uA during Delay.
// Current 1.1 uA after Delay
// #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()
{
}
I am not familiar with the Data Logger you are using.
I used a DMM on the uA range connected between the 3.2v battery and the 3V3 terminal on the XIAO nRF.
I was careful to make sure that the USB connection to the XIAO was removed.
how do You connect xiao for making measurements ?
Maybe there is an issue when You power the xiao board via different paths
1: USB port with 5v
2: battery port with 3,6 - 4,2 v
3: 3v3 pin
(this is for whoevery wants to do internal RTC wakeup with out external interrupt)
So i have read the whole thread and tried everything, and i can tell that these 2 functions are totally useless and they probably are the default power mode for the chip , and the wait function is the same as using delay(***) whatever number , so if you need a program to wake up internally every couple of seconds , just use delay() in loop and You are all set.
sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
sd_app_evt_wait(); // puts the nrf52 to sleep when there is nothing to do
Small note: the turning off external flash code saves around 18micro amps
BTW, as a first step to low power, I want to use the demo provided by seeedstudio : Power Consumption Verification. I opened deep_sleep.ino in arduino IDE (1.8.18). I can’t compile it:
low_power:81:12: error: 'class Adafruit_SPIFlash' has no member named 'deepPowerDown'
81 | if(flash.deepPowerDown() == false){
| ^~~~~~~~~~~~~