2017-03-22 09:39 AM
Hello,
In the application I'm developping I'm going to Stop1 mode and waking-up by RTC every 31.25ms.
Before setting up all the peripherals (I2C, USART2, LPTIM, ADC) I set all ports as analog inputs
At this moment, I have I2C disabled and ADC is taking some measurements every 5 seconds. With the USART I manage a device that is most of the time sleeping: MCU has to wait for an answer that is received when this device wakes up (now, every 10 seconds): I have set up USART2 and HSI to wakeup from Stop1 mode when receiving something via this USART2.
Taking into account the above described scenario, min power consumption is about 60uA.
In this situation, I have also disabled ADC, and now power consumption has gone down to 30uA. So, if ADC is not working in Stop1 mode, why have I seen such reduction in power consumption when disabling ADC?
Is it necessary (for power consumption purposes) to Deinit de ADC after each measurement and Init it again before carrying out a new measurement?
Best regards.
#stop1 #adc #stm32l4 #current2017-04-13 01:26 AM
Hi
TARRAGO.DANIEL
,The ADC of STM32L4 serie has several levels of disabling: ADC deep power down, ADC internal reference voltage, ADC block enable.
This is a matter of trade-off between current consumption and start-up time:
You can let your ADC enabled in low-power mode 'Stop': benefit will be short start-up time at wake-up, drawback will be higher current consumption.
You can disableADC in low-power mode 'Stop': benefit will be lower current consumption, drawback will be longer ADC start-up time after wake-up from low-power mode.
Using HAL driver, you can can enable all or disable all using HAL_ADC_Init() and HAL_ADC_DeInit().
Using LL driver, you have more flexibility to controlADC internal levels or enabling or disabling:
To enable ADC:
LL_ADC_DisableDeepPowerDown(ADC1);
LL_ADC_EnableInternalRegulator(ADC1);
<wait for ADC internal voltage regulator stabilization>
LL_ADC_StartCalibration(ADC1, LL_ADC_SINGLE_ENDED);
<Poll for ADC effectively calibrated>
#LL_ADC_Enable(ADC1);
To disable ADC, perform ADC disable as deep as you want to:
LL_ADC_Disable(ADC1);
LL_ADC_DisableInternalRegulator(ADC1);
LL_ADC_EnableDeepPowerDown(ADC1);
Best regards
Philippe