Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Larger power consumption when the display is not cleared before uBit.power.off() #378

Open
microbit-carlos opened this issue Sep 20, 2023 · 1 comment
Assignees
Milestone

Comments

@microbit-carlos
Copy link
Collaborator

When something is shown in the display and we go into "power off" mode in battery power, we see a much larger power consumption.

We expect an average of around 35 uA @ 3.0V, but in this case we see around 850 uA.

Simply running uBit.display.clear() before uBit.power.off() resolves the issue, so we probably have some event running on the background to do with the display pins.

#include "MicroBit.h"

MicroBit uBit;

int main() {
    uBit.init();

    uBit.display.printChar('X');
    uBit.sleep(100);
    // uBit.display.clear();    // <-- Uncommenting this fixes the power consumption

    while (true) {
        if (uBit.buttonA.isPressed()) {
            uBit.sleep(500);
            uBit.power.off();
        }
        uBit.sleep(100);
    }
}

It's quite possible this might be a side effect of 03c05e2 from PR #366, so we might have to look into a way to ensure the pin events are disabled without disabling GPIOTE completely.

@microbit-carlos
Copy link
Collaborator Author

Looking at the time between high current peaks confirms that we have something running on a 4ms interval:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants