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);
}
}
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()
beforeuBit.power.off()
resolves the issue, so we probably have some event running on the background to do with the display pins.It's quite possible this might be a side effect of https://github.com/lancaster-university/codal-microbit-v2/commit/03c05e2c881b5db73be04d3cb8b9da1a37144061 from PR https://github.com/lancaster-university/codal-microbit-v2/pull/366, so we might have to look into a way to ensure the pin events are disabled without disabling GPIOTE completely.