Digital pin always outputs current during deep sleep

Asked 2 years ago, Updated 2 years ago, 54 views

I have a question about deep sleep mode of spresense.

Deepsleep works, but the digital pins output current during deepsleep (even if the LED is turned off under Low's instruction in digital write before deepsleep processing, it is always on when deepsleep is turned on).

During deep sleep, I remember that ESP32 and other devices no longer have output from the digital pins, but is this a specification of spresense?
Also, is there a way to stop the digital pin output during deep sleep?

I look forward to hearing from you.

spresense

2022-09-30 14:37

3 Answers

During deep sleep, I think the output from the microcomputer board is disabled.I don't know which digital pin you're using, but if you're using an expansion board pin, it's pulled up to 3.3V or 5V via a level shifter on the board, so that's probably the reason.


2022-09-30 14:37

I'm going to repeat the answer, but I'd like to explain it a little more clearly.

As kzz pointed out, there is always a voltage on the expansion board pins.If you don't control anything on the main board, the current will flow if you apply an LED-like load.

(In other words, the expansion board can flash LEDs because the main board controls the pins to do so.)

Power Supply to Expansion Board

This is a little difficult to understand, so I removed the main board and tested to see if the LED would glow only on the expansion board.As you can see, the LED is shining only on the expansion board.

(The USB power supply on the main board and the USB power supply on the expansion board are the same.)

Light LED on expansion board only

On the other hand, I connected the LED to the main board and repeatedly started DeepSleep.As you can see, there is no current in GPIO during DeepSleep.

Spresense MainBoard DeepSleep LED Experiment

The sketches I used are as follows:

#include<LowPower.h>
#define LED_PIN0

void setup() {
  pinMode (LED_PIN, OUTPUT);
  digitalWrite (LED_PIN, HIGH);
  delay (2000);
  LowPower.begin();
  LowPower.deepSleep(2);
}

void loop() {
}

As a result, the main board must be loaded to reduce power consumption during DeepSleep.

I hope it will be helpful.


2022-09-30 14:37

Let's check the schematic first.
Generally, the GPIO port is asleep and open, but the circuit connected to it may be open and current flows.
Also, some ports have specific output during sleep, so you need to read the CPU datasheet to see how the pins work


2022-09-30 14:37

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.