2015-01-21 05:09 AM
Hi all,
i'm using STM32F407/F417 with 12MHz crystal, and i would like to save power as possible, because i need to run it on batteries, i need to have USB connected, i read in manual that i could underclock ... please could somebody direct me how to do it and to not loose usb connection ? so exactly: at one moment i need full swing and other moment i need to save power and it's not required to have fast execution, thanks for all replies ...2015-01-21 06:27 AM
Why wanting to ''underclock'' with USB connected ?
Wouldn't it be more appropriate to draw power from the USB host in this case, instead from batteries ? With some hardware support, you could even recharge batteries while USB is connected. My very superficial USB experience suggests you need a rather precise 48.0MHz clock for USB. I would rather run on 12MHz while on batteries, and reconfigure to 48MHz (or more) when USB power is detected. I implicitly assume your board runs on batteries most of the time, and connects to USB for data retrieval (and possible recharge).2015-01-21 06:40 AM
i have to explain connections:
i have ODROID-XU with linux, i'm running this device from batteries, i need to do ''the job'' with STM32F407 connected into ODROID-XU and after ''the job'' i need to save power as much as it is possible but it should be prepared to run ''the job'' anytime after first ''the job'', so there should be permanent usb connection due to drivers in linux, and i have batteries only to power the ODROID-XU and from it there is STM powered using USB cable, but i measured current more than 100mA for STM32 :(2015-01-21 06:50 AM
... but i measured current more than 100mA for STM32 :(
Don't know your ''job'', but when power consumption is of concern, wouldn't serve you a M0 with USB better ?
2015-01-21 07:01 AM
during the ''job'' i need SPI @ 38MHz and STM32F407 is having 42MBit/s and STM32F072 has only 18MBit/s :(
and i think that STM32F072 will not be fast enough for processing received data if i use some parallel interface if it's possible, i have tested that F407 is ok from processing speed point of view, but i'm looking for solution for saving power when the F407 is in idle ...2015-01-21 07:57 AM
Aside from the Sleep/Stop/Standby mode, you can add two additional lines to control the power to the STM, i.e. turning power on/off from the ODROID unit.
This would allow for a proper ''removal'' of the USB device on the ODROID side before powering off.2015-01-21 08:11 AM
it should be probably misunderstanding ... i don't want to disconnect STM32 from ODROID-XU because of the drivers and application, everything is stable when STM32 is connected on USB,
powering off the STM32 is not possible and also powering off ODROID is not possible, Sleep/Stop/Standby can be used only if USB connection will stay alive - and conditionally only when idle when the job is not in progress,2015-01-21 08:49 AM
100 mA seems like a lot, how much can you actually attribute to the core, vs stuff you've got attached to it?
You can't change the PLL while it's clocking. You could use WFI loops, you can change APB/AHB clock dividers. You can turn off peripheral clocks and pins. You can use an external clock up to 50 MHz, consider if running off the 16 MHz is an option, or a 8 / 25 MHz crystal, when not running at high speed. You'd need to maintain the PLL as the 48 MHz USB clock comes from there.2015-01-21 09:12 AM
Hi Clive1,
is it possible and correctly functional this plan: normally boot into HSE crystal 12MHz & PLL, work on job, when idle execute: RCC_CFGR->SW = HSI, ... so system clock now 16MHz from HSI and USB clock from PLL 48MHz from HSE, wait for instructions from master through USB, if the job is having to start then switch SW to PLL so system clock will be 168MHz, ? is 16MHz fast enough to receive some bytes from USB ?2015-01-21 09:37 AM
I would imagine 16 MHz would be sufficient, it's all going into DMA/FIFO type buffers. This is something you'd need to verify for yourself.