2019-08-28 11:39 AM
I am using STM32G070 with CubeMX HAL code. The system runs into STOP mode from time to time. I need turn off the ADC before it entering the STOP. Here is my testing:
If running the MCU without ADC by commenting out MX_ADC1_Init(), the system shows 3.5 uA in STOP mode; This also proves the system was set right for both hardware and software.
If initiating the ADC by MX_ADC1_Init(), I shut down the ADC by running:
HAL_ADC_DeInit(&hadc1);
HAL_ADC_Stop_IT(&hadc1);
HAL_ADC_MspDeInit(&hadc1);
__HAL_RCC_ADC_CLK_DISABLE();
The system still shows 15uA in STOP mode, even by running these functions redundantly. I cannot figure out what caused this extra 12uA leakage. Which switch did I miss?
Thank you in advance!
2023-03-27 10:36 PM
In case you haven't figured it out, this extra 10+uA current comes from ADC's internal voltage regulator, which is turned on in HAL_ADC_Init (LL_ADC_EnableInternalRegulator) but never disabled in HAL_ADC_DeInit.