2014-08-14 05:22 AM
I am running a sample code with while(1) loop running from flash using MSI @ 2Mhz and it takes 6mA, but the data sheet shows that it takes 1mA with MSI @ 4.2Mhz running from flash.
Are there any other configurations to be taken care to reduce power consumption?2014-08-14 02:12 PM
That performance is usually given with peripherals disabled, IOs not floating, OCD disabled, debugger not sucking current through nRESET/SWD, no pullups/downs conducting, without watchdog resetting every 2ms, etc, etc, etc.
2014-08-15 07:39 AM
disabling peripherals:- does disabling peripheral port clocks will suffice (RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOB, DISABLE)
IO's not floating:- what we should do with unused ports ie physically. so that power consumption reduces.thank you.2014-08-15 01:03 PM
2014-08-16 03:18 AM
yes in system_stm32l1xx.c uint32_t SystemCoreClock = SYSCLK_FREQ_MSI_2MHz;
is ''input'' the default state of the ports?2014-08-25 02:29 AM
The GPIO default state is Analog In i.e. high impedance. So yes the default state should be fine. However it is always good to tight the unused pins to defined level - e.g. ground.
There is many peripherals on STM32 cpu, that may have clocks enabled. It depends on when initialization code you used. Remember that there is a usually some code run before entering main. Look for a function ''SystemInit''.2018-03-19 03:14 AM
'
Are there any other configurations to be taken care to reduce power consumption?'
yes.