Why does Nano 33 BLE draw an extra 2mA when pinMode() is called?

Hi everyone, I'm working on a project that requires efficient use of the battery, so I would like to understand where this current draw is coming from exactly. I'm trying to understand why the current draw of the board increases when pinMode() is called? For reference, using Vin and a LiPo to power the board, I measured the current being drawn from the battery to the board when just a blank sketch was running.

void setup() {

}

void loop() {

}

With this sketch uploaded, there was a current draw of about 17 mA. Next, I just added a call to pinMode() in setup().

void setup() {
  pinMode(7,OUTPUT);
}

void loop() {

}

With this, I saw the current draw jump from 17 mA to 19 mA. Mind you, nothing is connected to pin 7 at this time. This 2 mA increase remains the same whether or not I define the pin to be OUTPUT, INPUT, INPUT_PULLUP, or INPUT_PULLDOWN. Does anyone have any idea what internal circuitry would be causing this? My guess is it has to do with something in the nrf52840 MPU, but I can't tell what specifically. Thanks in advance for any suggestions and help!

You have the source of the Arduino core. I think the file with pinMode() function is in ‘wiring_digital.c’.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.