-
• #2
@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. -
• #3
Hi @Gordon,
thanks for the feedback - I will try to go the first way first (maybe add external USB<=> Serial for accessing the board without USB).
Regarding the compile time way: I do not really understand what the
chip.speed
setting in the.py
file is good for? Is it used somewhere during the build to e.g. generate header files or code? Or is it only used to generate the (really nice) web pages?Thanks!
-
• #4
I can't honestly remember if the
.py
file is used in compilation or not. The idea was that eventually it would be, but currently there's still a mix of that, stuff defined in the Makefile, and even#defines
in the code.
Hi,
i would like to match the SPI clock frequency to some given value. From the STM32F103RCT6 hardware manual it looks like the SPI clock is generated from the AHB clock (PCLK) using a prescaler (divide by /2, /4, /8, ...). To get a more exact match to my required SPI clock, I can only think of changing the AHB clock...
I have the following questions:
Thanks!