Hello, I am measuring sleep current of about 90uA (and also spikes up to about 600 uA) and was expecting to see < 20uA. I am trying to get this board to run a year or more on a coin cell battery. I have been trying to figure out what is causing such high current during sleep. My sketch blinks an LED on and off. To minimize sleep current, my sketch disables USB and stops Timer1. I have also set some of the floating IO pins to outputs (specifically, IO lines going to sensors which are un-populated on the Nano 33 BLE). In addition, I have cut the 3.3V jumper on the board and am powering the board with 3.3V directly on the 3V3 pin.
Current measurement is done with a 1x scope probe across a 10 Ohm shunt at the 3V3 pin with USB cable unplugged from the board. While the LED is off, I am measuring average sleep current about 5x higher than I was expecting. Any ideas what peripherals (aside from USB and Timer1) may be on by default and causing high current during sleep? The sketch was uploaded using the Arduino Cloud IDE.
/*
Blink LED using delay, for measuring sleep current
*/
#include <nrfx.h>
#include <nrf_timer.h> // reference: https://github.com/NordicSemiconductor/nrfx/blob/master/hal/nrf_timer.h
#include "usb_phy_api.h"
void setup() {
// initialize pin 2 and LED_BUILTIN as output
pinMode(2, OUTPUT);
digitalWrite(2, LOW);
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW);
digitalWrite(LED_PWR, LOW);
//stop non-low-power timer, this timer used for micros();
NRF_TIMER1->TASKS_STOP = 1; // Stop timer
// stopping timer0, timer2, 3 or 4 has no effect
// only timers 0 - 4 are defined
// NRF_TIMER0->TASKS_STOP = 1;
// NRF_TIMER2->TASKS_STOP = 1;
// NRF_TIMER3->TASKS_STOP = 1;
// NRF_TIMER4->TASKS_STOP = 1;
//nrf_saadc_disable();
//nrf_saadc_enable(); // adc I_sleep = 87 uA (saadc in default config has no effect on sleep current)
// with these I_sleep=91 uA; without these I_sleep=97 uA
pinMode(PDM_DIN, OUTPUT);
digitalWrite(PDM_DIN, LOW);
pinMode(PDM_CLK, OUTPUT);
digitalWrite(PDM_CLK, LOW);
pinMode(MIC_PWR, OUTPUT);
digitalWrite(MIC_PWR, LOW);
pinMode(VDD_ENV, OUTPUT);
digitalWrite(VDD_ENV, HIGH);
pinMode(INT_APDS, OUTPUT);
digitalWrite(INT_APDS, HIGH);
// pinMode(VDD_ENV, OUTPUT); //sleep : 1.1 mA
// digitalWrite(VDD_ENV, LOW);
// test with: 124 uA; without: 535 uA
//stop USB
//must have #include "usb_phy_api,h"
get_usb_phy()->deinit();
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(2, HIGH);
delay(5000);
digitalWrite(LED_BUILTIN, LOW);
digitalWrite(2, LOW);
delay(5000);
}