You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • ...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:

    poke32(0x40021004,peek32(0x40021004)&~(7­<<11))
    

    And see if that helps at all?

About

Avatar for Gordon @Gordon started