gpio speed #4708
Replies: 1 comment
-
Posted at 2018-10-24 by @gfwilliams ...this is on an Espruino Original? It's probably because the peripherals run at different clock speeds in different parts of the chip. Even though the chip is running faster, the GPIO will run slower so any accesses will take a few cycles. Generally because Espruino isn't super fast anyway, the GPIO peripheral clock is lowered more than it has to be so you get better power consumption. On the F4 boards there's a method called E.setClock where you can tweak it on the fly - however it's not implemented on the F1. The clock domain you need is for the APB2 bus, and it's called PCLK2. Looks like the default is to divide by 4, and you can change that to use the clock as-is. It's in the Maybe try:
And see if that helps at all? Posted at 2018-10-24 by Georg Yesss, that's cut it almost in half, now it's only 139 ns. Are there still wait states for other reasons? Thanks!
Attachments: Posted at 2018-10-25 by Wilberforce Is it a square wave you want or Is this testing? You could use the pwm output and not use any loop code at all. Posted at 2018-10-25 by Georg Testing, yes, trying to find where the limits of this little cute chip are. Speaking of which... can I overclock it by setting the PLL multiplier to more than 9x? Posted at 2018-10-25 by @gfwilliams
Not that I'm aware of. Also, if you just want a crazy fast clock, looks like you can turn on the 'Microcontroller clock output' :)
Possibly, yes :) I seem to recall that using I believe there may be other registers (there were on the F4 IIRC) that allow you to tweak the core voltage up a bit, which will let you hit the higher speeds. Having said that, you may need to do some fiddling if you want USB to stay working :) Posted at 2018-10-26 by Georg Great! Now I have to learn the sequence of clock source swapping that works to change that, it seems I can't just poke the new multiplier value there, right? Posted at 2018-10-26 by @gfwilliams
I can't remember... Maybe you can - but you might have to swap the clock source to the internal oscillator, do it, then swap it back... It might be easier just to make your own build? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-10-24 by Georg
With this:
loop()
It takes 223 ns to loop once, but three cpu cycles @72MHz are 31e91/72e6= 41.6 ns, can I touch some clock setting somewhere to make it toggle faster?
Thanks,
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions