2025-08-12 7:49 AM - last edited on 2025-08-12 8:40 AM by Andrew Neil
Hi,
I am using differential SPI communication with an STM32G474. The master sends the clock (SCLK) to the slave and data through the MOSI line. However, the slave responds on MOSI using a delayed clock (DCLK), which is derived from the master clock with some delay (DCLK = SCLK*Delay).
This means the master must read from the slave using DCLK instead of SCLK. I’m sure this cannot be handled through the normal SPI peripheral.
Could someone suggest a solution for this scenario?
One idea I had was:
Use another SPI peripheral on the STM32, configure it as a slave, and use the delayed clock (DCLK) from the slave device as the input clock to capture the return data.
Would this approach work, or is there a better method?
Thank you in advance
2025-08-12 7:58 AM
Please give details of the slave.
Does the device manufacturer give any suggestions on working with standard SPI Masters? It must be a common question!
@Keerthi wrote:the slave responds on MOSI using a delayed clock (DCLK), which is derived from the master clock with some delay (DCLK = SCLK*Delay).
So does the Slave send this DCLK back to the "Master"? ie, is this an actual output signal from the "Slave"?
@Keerthi wrote:
Use another SPI peripheral on the STM32, configure it as a slave, and use the delayed clock (DCLK) from the slave device as the input clock to capture the return data.
Certainly sounds like something to try!
Or just bit-bang it?
2025-08-12 7:59 AM
Should work, just try it.
2025-08-12 8:05 AM
Hi @Andrew Neil ,
Sorry that is typo. "However, the slave responds on MISO using a delayed clock (DCLK), which is derived from the master clock with some delay (DCLK = SCLK*Delay)."
DCLK is copy of of SCLK because of the transceiver and some other components that add delay. So, sampling data with SCLK cause issue for reading data from Slave through MISO. SO DCLK is output from the slave.
2025-08-12 8:09 AM - edited 2025-08-12 8:10 AM
Again, it would help if you just provided details of the slave so we can see for ourselves!
@Keerthi wrote:because of the transceiver and some other components that add delay.
What transceiver?
Please post the schematic
2025-08-12 8:11 AM
It sounds like your slave is effectively running its MISO line on a different clock domain than the master’s SCLK, so you’re right that the standard SPI peripheral can’t just “switch clocks” mid-transaction.
2025-08-12 8:13 AM
Hi,
I cannot post the schematic. But the overall concept is I have to handle data from slave using clock send by it and get the data.
2025-08-12 8:16 AM
>>Use another SPI peripheral on the STM32, configure it as a slave, and use the delayed clock (DCLK) from the slave device as the input clock to capture the return data.
That was my initial thought. uSart synchronous mode might be an option, and if not too fast, one might be able to used EXTI or TIM Input Capture
2025-08-12 8:18 AM
Thanks for the reply. The SPI runs at high frequencies that is 60MHz. I don't think USART works
2025-08-12 8:18 AM
This is not differential signaling. Sounds much more like "delayed".
Differential signalling - Wikipedia
Yes, a separate slave SPI instance will work to receive data.