I see the voltage across a 1 ohm resistor in series with my board (including STM32L476 without peripherals). A 3.3 volts power supply is used to power the system.
Measured by an oscilloscope, the minimum current (voltage across the resistor) is 6-7 mA.
To set all free pins as analog via Arduino IDE
Re: To set all free pins as analog via Arduino IDE
Last edited by mebab on Thu May 27, 2021 8:33 pm, edited 1 time in total.
Re: To set all free pins as analog via Arduino IDE
OK but this depends of your config.
Re: To set all free pins as analog via Arduino IDE
Thanks
My frequency is equal to 2 MHz and I don't have variable input voltage. My source voltage is 3.3 volts fixed. Then, I guess the only way is to disable some peripherals but I don't know how to do that in Arduino IDE.fpiSTM
Re: To set all free pins as analog via Arduino IDE
'clocking the peripherals' isn't that difficult. what you need are, you need to review the reference manual for your soc under reset and clocks control *RCC". stm32duino turns on clocks for the common / popular ones so that 'newbies' won't be clueless of why things like 'gpio' didn't work. you would otherwise have to do that yourself if the core didn't turn on the clocks before hand.mebab wrote: Thu May 27, 2021 3:09 pm Thanksagain for the useful link and comments!ag123
Whatever I do with pins, clock frequency, etc. doesn't reduce the consumed power! I still have 6 mA (supplying 3.3 V with ST-Link) only for running STM32L476 in the full load situation!
It is hard for me to transfer whatever is needed from the following generated code in CubeIDE to Arduino code:I have included the contents of the SystemClock_Config in the Variant.cpp file. However, I cannot figure out how to deactivate peripherals in Arduino IDE. Would you mind please provide me a piece of Arduino code to disable for example I2C1 or SPI2?Code: Select all
HAL_Init(); SystemClock_Config(); MX_GPIO_Init(); MX_I2C3_Init(); MX_SPI1_Init(); MX_USART1_UART_Init(); ....
Thanks again
you did not mention your soc so here is one for stm32f4xx. review the registers for peripheral clock enable.
https://www.st.com/resource/en/referenc ... ronics.pdf
then you can review the codes in SystemClock_Config() andn the MX_XXX_Init() codes to see how it is done. Instead of changing the codes there.
you could call functions to disable the pheriperial clocks in setup(). In that way you won't need to change the core codes directly. But if you insist, you could edit your local copy.
Re: To set all free pins as analog via Arduino IDE
ag123: 'clocking the peripherals' isn't that difficult. what you need are ...
Thanks a lot for all your helpful comments. Finally, I could turn off the unused clocks and got great results!fpiSTM: OK but this depends on your config.
I couldn't find the 'Mark as answer' item to highlight your comments.