I have two devices, both using the same STM32L452RE chip as the main (and only) MCU. It's the Nucleo 64 L452RE board, and a custom PCB.
When I put both into sleep modes (using STM32LowPower library), the custom PCB consistently draws more power .
In "deepSleep" the Nucleo uses about 2.8 μA, for the custom PCB it is about 200 μA.
When I then put the devices into "shutdown" mode, the Nucleo goes down to 0.5 μA whereas the custom PCB consumes a whopping 5 mA (!!).
The custom PCB contains a bunch of extra components such as ADXL etc, but through carefully setting each component to sleep I've concluded that the high current consumption must be coming from the MCU and not the other components.
The only difference I can really see between the Nucleo and the custom PCB is that the custom PCB has an 8 MHz crystal attached to the PH0 and PH1 pins (where X3 on the Nucleo board would be), whereas the Nucleo has nothing attached to those pins.
N.B. I have not made any changes in software to accomodate for this added crystal.
So my question is:
1. Could this added crystal account for the increased current usage?
2. If yes, should I be making changes in the Arduino code to accomodate for the crystal on PH0 and PH1? I came across this thread. Would it be wise to follow the rough procedure in there? viewtopic.php?p=11540&hilit=configure+oscillator#p11540
3. If yes, In the event that I don't want to use the crystal, but also don't want to physically remove it, is there a way to disable it in software? So that I'm not faced with the high power consumption. I already tried doing the following but that didn't do anything to the power consumption.
Code: Select all
pinMode(PH1, OUTPUT);
digitalWrite(PH1, LOW);
pinMode(PH0, OUTPUT);
digitalWrite(PH0, LOW);
Many thanks