Page 1 of 1

Slowing things down

Posted: Sat Feb 22, 2020 11:22 pm
by RWLTOK
I am trying the slow down my STM32L452RE application.

No luck with using the pyb.freq() function as it is not supported in that port currently. Is anyone aware of a fork that may have this implemented. Everything is hardcoded in system_stm32.c and it appears no user serviceable parts inside.

Anyone every taken a stab at implementing this function?

Code: Select all

>>> pyb.freq(8000000)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NotImplementedError: machine.freq set not supported yet
>>> >>>
Thanks for looking.

Rich

Re: Slowing things down

Posted: Sun Feb 23, 2020 9:21 am
by deshipu
Why do you need it to be slower? What are you trying to do?
Usually you do this by using some delays or timers.

Re: Slowing things down

Posted: Mon Feb 24, 2020 1:09 pm
by chrismas9
If you want to slow it down permanently, maybe to save power, you could edit the PLL values in moconfigboard.h and rebuild it. I suggest running the clock config utility in stm32cubemx to find the right values. Make sure the USB clock is still 48MHz if you are using USB.

Re: Slowing things down

Posted: Sun Mar 01, 2020 6:19 am
by RWLTOK
Thanks for the responses. I have played with the PLLs to slow things down. The goal is to save as much power as possible. I would like to run the MSI clock at 2MHz. In this low power mode, there will be no USB. I am not looking forward to debugging in this mode.