2024-08-21 10:11 AM
I'm working on my first STM32 project and have an stm32h725rg configured as a SPI master. Ideally, I'm aiming for a clock frequency of 60 MHz but had to slow it down to 12 MHz (the lowest that my sensor can be configured for) after an initial round of testing showed that the signal wasn't reaching the full power rails. Now at 12 MHz, I can see the clock signal but it is still sinusoidal in shape (the purple line). I've also tried using GPIO pins to emulate the clock and writing directly to their registers (BSSR), but I still saw a similar shape.
From what I read in the datasheet, 125 MHz is the max. SPI clock frequency which I am no where near. As such, I'm wondering if there are other considerations in the datasheet that I missed that are affecting the quality and max. achievable clock frequency. For reference, the system clock is running at 480 MHz with power operating conditions VOS0. It is being externally powered directly to Vcore and VDD respectively with the SMPS being bypassed.
2024-08-21 10:35 AM - edited 2024-08-21 10:35 AM
Hmm first seems as first SPI too. Signals integrity is based on line impedance params. From your image here is big capacity and serial resistance... Too used GPIO maybe require setup right speed mode = push pull driver strength
2024-08-21 11:14 AM
Are pins being initialized as very high frequency? There are some pins with lower specs, but the vast majority of pins can do 12 MHz without issue. Which pins are you using?
Is this a custom board or an ST board? Anything else hooked up besides the STM32 and the SPI slave chip?
2024-08-21 11:26 AM
When using the GPIO pins I set pin PA5, which is the same pin as SPI1 SCK, to very high frequency using cubeMX.
In regards to the board, it is a custom board with the SPI slave sensor, an HSE oscillator, USB connector, a few LEDs and some breakout pins for other communication protocols in case I needed them.
I also forgot to mention that it is running in SPI half-duplex mode if that makes a significant difference.
2024-08-21 11:29 AM
Nothing special with PA5 that I know of, should work. Definitely looks like you have some capacitance on that line. Perhaps remove the slave chip for debugging to see if the signal improves. Half-duplex mode won't affect this.