I published a sketch and a rewritten arduino interrupt module under this topic Getting lower power consumption on Seeed XIAO nRF52840. The sketch demonstrates an arduino loop() that operates at 3uA with gpio interrupts and no delay() calls using system_on sleep mode. It also demonstrates system_off and wake from system off.
is this board for “xiao nrf52840” on the market ?
this one?
I am working on a project which uses Li-Po 300mAH battery for powering up my seeed studio xiao nrf52840 ble sense board. I want to implement sleep mode in it so that my power consumption decreases, but it is important that my data stored is not lost when the device is in sleep mode as I will transmit it using ble later. It would be better if I can wake up my device from sleep mode when a external button is pressed. I have followed above code but unfortunately my board is getting bricked. Kindly let me know any resources to follow or look into.
Any help is appreciated. Thanks in advance
no.
I ask if this one is on the market
…what do You mean bricked ?
is it destroyed ?
… after deep sleep = “power off sleep” the device is waking up like after reset.
To keep some data on the device I think You should use “power_on sleep”
Look here
Hey Adam,
Thanks for the reply
My serial port was not able to read the board, but thankfully I was able to reupload the bootloader hex file to reset the board.
Coming to power_on sleep I will test it out and get back to you with any update.
LoL, No… its a roll your own.
I made it to address some of the poor design decisions by seeed imo.
Interrupts, rtc etc. I may mod it again to address the battery reading short-fall of the designs software hooliganism.
JLPCB is your friend.
GL ,PJ.
JLCPCB …never used this …long way ahead of me
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.
Thanks in Advance
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 ?
HTH
GL
PJ
Hey @PJ_Glasso ,
Thanks for a lead.
Tired to first test using a basic QSPI flash code present in SEEED_nRF52840_QSPI/QSPI_New.ino at main · PMCheetham/SEEED_nRF52840_QSPI · GitHub , got the expected output but unfortunately whenever I try to use flash of the seeed studio board it is getting bricked meaning I can’t detect the board on serial port anymore.
So i guess it’s a risk to toggle with flash memory of the board. Any other solutions or resources by yourself or anyone else is highly appreciated.
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;
}
void loop()
{
}
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()
{
}
Thank you very much!
I 'll check it tonight !
AdamM68, Gordy7 !
Thank you very much for your help !
Everything worked out, the current is less than 1 µA!