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 RCC.CFGR register if you look at the STM32F103 reference manual (if you're interested).
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
...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
RCC.CFGR
register if you look at the STM32F103 reference manual (if you're interested).Maybe try:
And see if that helps at all?