cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H723 SPI clock issue

carloV
Associate III

In my project I've set the SPI clock to 125MHz; with a SPI prescaler value=4 all works good, when I set it to 2 the SPI stops working and ther is no clock signal.

Any helps ?

 

Thank you

CarloV

7 REPLIES 7
LCE
Principal II

Check the datasheet - maybe 62.5 MHz is above the limit ?

carloV
Associate III

I configured the SPI1 as "Master Transmit only", the maximum clock frequency should be 133MHz; kernel clock=500MHz, SPI1 clock=125MHz, prescaler=2 ---> 62.5MHz

TDK
Super User

Ensure GPIO pin speed is set to VERY HIGH. This is not the default.

If you feel a post has answered your question, please click "Accept as Solution".
carloV
Associate III

Yes SCLK and MOSI are VERY HIGH...

TDK
Super User

Should work. It's possible that you aren't measuring it correctly, perhaps sample rate is insufficient. It's also possible changing this caused something else in the code to break and SPI commands no longer get executed. To address those:

How are you measuring it and what does "no clock signal" look like? How do you know the code is being executed?

Could also be something else wrong in the code but if you're only changing the prescaler, unlikely. The more info you provide the more likely someone is to spot the problem.

If you feel a post has answered your question, please click "Accept as Solution".
carloV
Associate III



<meta charset="UTF-8" />



 


Hi,if I set a prescaler=4 all works good...I measure the clock using an oscilloscope...


 


 


@TDK has totally valid points. If its custom hardware, as it sounds like, then I think you need to look carefully at electronic signals quality. If the slew rate is low (e.g. due to bad traces/wires) then raising clock frequency lowers the peak-to-peak amplitude. If you try to trigger oscilloscope on such signal at half the nominal voltage like it's done with digital signals, then it wont trigger.

You should share the oscilloscope images at prescaler 4 and 2. Oscilloscope shall have at least 50 MHz bandwidth (better if 100 MHz) and few hundred MHz sampling rate (better 1GHz). Use 1 MOhm input impedance. Trigger on falling CS with one channel and measure SCK on another.

These measurements should be done anyway to be sure there are no hardware issues to avoid banging head to the wall.