Slowing things down

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
User avatar
RWLTOK
Posts: 47
Joined: Thu Dec 14, 2017 7:24 pm

Slowing things down

Post by RWLTOK » Sat Feb 22, 2020 11:22 pm

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

User avatar
deshipu
Posts: 1362
Joined: Thu May 28, 2015 5:54 pm

Re: Slowing things down

Post by deshipu » Sun Feb 23, 2020 9:21 am

Why do you need it to be slower? What are you trying to do?
Usually you do this by using some delays or timers.

chrismas9
Posts: 148
Joined: Wed Jun 25, 2014 10:07 am

Re: Slowing things down

Post by chrismas9 » Mon Feb 24, 2020 1:09 pm

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.

User avatar
RWLTOK
Posts: 47
Joined: Thu Dec 14, 2017 7:24 pm

Re: Slowing things down

Post by RWLTOK » Sun Mar 01, 2020 6:19 am

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.

Post Reply