@user53771 yes, you're right - the F103 can only get the SPI clock right to +/- 50%.
You should be able to change the clock using peek32 and poke32 functions, but USB on the F103 is really picky, so you probably wouldn't be able to keep that going.
It looks like USART would be fine though - just set it up again with Serial1.setup and it'll use the updated clock speeds. You may find that getTime() behaves strangely afterwards though - it depends which board you're using.
As you say the other option is to do it at compile time. I'm not sure that changing the clock speed in the .py file will be good enough - you may also need to change this file. But after that it should work.
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.
@user53771 yes, you're right - the F103 can only get the SPI clock right to +/- 50%.
You should be able to change the clock using
peek32
andpoke32
functions, but USB on the F103 is really picky, so you probably wouldn't be able to keep that going.It looks like USART would be fine though - just set it up again with
Serial1.setup
and it'll use the updated clock speeds. You may find thatgetTime()
behaves strangely afterwards though - it depends which board you're using.As you say the other option is to do it at compile time. I'm not sure that changing the clock speed in the
.py
file will be good enough - you may also need to change this file. But after that it should work.