Power consumption of XIAO MG24

I’m not sure there is one - some of the other devices have xlsx files shown on the wiki page…

WikiSheetD21

I just use the schematic.

Hi everyone,

I’ve conducted some power consumption tests on the XIAO MG24 and wanted to share my results and methodology.

Test Setup:

  • Power supply: 3.8V via battery pads
  • USB disconnected
  • Measurement using current meter

Optimization Approach:
I focused on systematically disabling all onboard peripherals and putting the flash chip into deep power-down mode. Here’s the complete test code:

#include <Arduino.h>
#include "ArduinoLowPower.h"

#define CS_PIN PA6
#define CLK_PIN PA0
#define MOSI_PIN PB0
#define MISO_PIN PB1

#define READ_DATA 0x03
#define WRITE_ENABLE 0x06
#define PAGE_PROGRAM 0x02
#define SECTOR_ERASE 0x20

void sendSPI(byte data) {
  for (int i = 0; i < 8; i++) {
    digitalWrite(MOSI_PIN, data & 0x80);
    data <<= 1;
    digitalWrite(CLK_PIN, HIGH);
    delayMicroseconds(1);
    digitalWrite(CLK_PIN, LOW);
    delayMicroseconds(1);
  }
}

void writeEnable() {
  digitalWrite(CS_PIN, LOW);
  sendSPI(WRITE_ENABLE);
  digitalWrite(CS_PIN, HIGH);
}

void setup()
{
  //Serial.begin(115200);
  pinMode(PA7, OUTPUT);
  digitalWrite(PA7, LOW);

  pinMode(CS_PIN, OUTPUT);
  pinMode(CLK_PIN, OUTPUT);
  pinMode(MOSI_PIN, OUTPUT);
  pinMode(MISO_PIN, INPUT);

  //SW
  pinMode(PD3, OUTPUT);//VBAT
  pinMode(PB5, OUTPUT);//RF_SW
  pinMode(PD5, OUTPUT);//IMU
  pinMode(PC8, OUTPUT);//MIC
  pinMode(PA6, OUTPUT);//FLASH
  digitalWrite(PD3, LOW); //VBAT
  digitalWrite(PB5, LOW); //RF_SW
  digitalWrite(PD5, LOW); //IMU
  digitalWrite(PC8, LOW); //MIC
  digitalWrite(PA6, HIGH);  //FLASH

  //Serial.println("Deep sleep timed wakeup");
  writeEnable();
  digitalWrite(CS_PIN, LOW);
  sendSPI(0xB9);
  digitalWrite(CS_PIN, HIGH);
}

void loop()
{
  delay(10000);  
  digitalWrite(PA7, HIGH);
  delay(500);

  //Serial.printf("Going to deep sleep for 10s at %lu\n", millis());

  // LowPower.idle(600000);        //EM1 TIM wake-up
  // LowPower.sleep(600000);       //EM2 TIM wake-up
  LowPower.deepSleep(600000);   //EM4 TIM wake-up
}

Key Implementation Details:

  1. Peripheral Shutdown: Explicitly turned off all onboard peripherals (VBAT_EN, RFSW_EN, IMU_EN, MIC_EN) by setting their enable pins to LOW
  2. Flash Deep Power-Down: Used SPI bit-banging to send the 0xB9 command to put the onboard flash chip into deep power-down mode
  3. Sleep Mode Testing: Tested different sleep modes using ArduinoLowPower library

Results:

  • Normal operation: 6.71mA
  • Sleep mode (EM2): 1.91mA
  • Deep Sleep (EM4): 1.95µA

Conclusions:
The flash deep power-down command and peripheral shutdown are critical for achieving sub-2µA consumption.

4 Likes