2017-08-08 04:35 AM
I used CubeMX code generator,
Internal Clock 4.194MHz MSI / ADC / LCD / RTC / TIM2 / TIM3 / USART1
Before Stop Mode Enter,
void Before_Stop_ST(void)
{ //--- LCD Off LCD_All_Display(0,1); HAL_LCD_MspDeInit(&hlcd); HAL_LCD_DeInit(&hlcd); //--- Port Off Backlight_Off(); Buzzer_Off(); CTLHY_Off(); CTL2V_Off(); //CTL3V_Off(); CTLA_Off(); CTLB_Off(); CTL1_Off(); //--- ADC Off ADC_ConversionStop_Disable(&hadc); HAL_ADC_Stop(&hadc); //--- UART Off HAL_UART_MspDeInit(&huart1); HAL_UART_DeInit(&huart1); //--- Timer Off HAL_TIM_Base_Stop_IT(&htim2); HAL_TIM_Base_Stop_IT(&htim3); HAL_TIM_Base_DeInit(&htim2); HAL_TIM_Base_DeInit(&htim3);//--- Disable PVD
HAL_PWR_DisablePVD(); __HAL_PWR_CLEAR_FLAG(PWR_FLAG_WU); //--- Enable Ultra low power mode HAL_PWREx_EnableUltraLowPower(); //--- Enable the fast wake up from Ultra low power mode HAL_PWREx_EnableFastWakeUp(); HAL_RCC_DeInit(); __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3); __HAL_RCC_MSI_RANGE_CONFIG(RCC_MSIRANGE_0); __HAL_RCC_SYSCLK_CONFIG(RCC_SYSCLKSOURCE_MSI); __HAL_RTC_WAKEUPTIMER_DISABLE_IT(&hrtc,RTC_IT_WUT); //__HAL_RCC_PWR_CLK_DISABLE();//--- Configure all GPIO as analog
Configure_Analog_All_GPIO(); //--- External Interrupt Setting External_Interrupt_Set(rRotaryPoint); //--- Wake-up Pin (PD7)}/* Power Save ----------------------------------------------------------------*/
void Sleep_Mode_Power_Save(void){Before_Stop_ST(); //-----< Power Save mode >--------------------------------------------------// /* Disable Wakeup Counter */ HAL_RTCEx_DeactivateWakeUpTimer(&hrtc); //HAL_RTCEx_SetWakeUpTimer_IT(&hrtc, 0xB4D8, RTC_WAKEUPCLOCK_RTCCLK_DIV16); /* Enter STOP mode */ HAL_PWR_EnterSTOPMode(PWR_LOWPOWERREGULATOR_ON, PWR_STOPENTRY_WFI); }Prospective consumption current : 10uA under (
Include all adjacent circuits)
(Because it was 10uA when I use the STD library.)
But, Now current 30uA...
I don't know what I'm missing.
Ask for help. Thank you.
#current #stop-mode #stm32l12017-08-08 04:39 AM
Hello!
What module you use?
Is something standard as nucleo or discovery or custom mode?
2017-08-08 06:51 AM
I use this board
At first, it was programmed into the Standard Library.
Changing to the HAL library now.
There is a lot of difference in current consumption in the stop mode.
2017-08-08 07:44 AM
Hello again ..I didn't found the schematic for your board.
I observed that you use ADC . In case you use VREFINT or temperature sensor, the current increases.
You deactivated some other devices with gpio pins probably (displays, backlights, control lines , etc). After this you called Configure_Analog_All_GPIO();
This is in contrary with previous deactivation.