STM32L431RC MSI oscillator drift.
- October 1, 2020
- 5 replies
- 2902 views
I have an application who requires a stable clock source in the whole temperature range but the power budget is tight, so we chose to use the MSI in sync with an external low power 32khz clock.
To save extra power we send the core to sleep while it's not needed and wake on interrupt with the line (MSI is 2Mhz):
HAL_PWR_EnterSLEEPMode(PWR_LOWPOWERREGULATOR_ON,PWR_SLEEPENTRY_WFI);
then while testing the device we saw the output of one of the timers drifting too much.
I connected the MSI to the microcontroller clock output and measured with the oscilloscope, the result can be seen in the second video attached.
The clock is drifting with a sawtooth shape, the period of this sawtooth is about 220ms at room temperature and decreaeg with temperature, to about 1ms at 100°C.
The same period can be seen on the input current of the system.
This causes too much disturbances for my application.
Then I found that if I enable the 'main' power regulator with this line:
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON,PWR_SLEEPENTRY_WFI);
then the clock drift less, but at random rate, it can be seen on the first video attached. The drifting with temperature now can be corrected with the use of the synchronization function against the 32khz reference. The current variations at the input also become random. Then the system becomes usable up to 140°C.
The only drawback 100uA more on the current consumption.
Is there any other way to get rid of this periodic drift? is the output of the low power LDO bounded to any pin where I can solder a capacitor? (I already increased the decoupling capacitors to 10uF each with no effect).
Any other ideas I can test?