2022-02-22 06:12 PM
I am using a Nucleo 303RE discovery board to try the SPI interface setting with STM CUBEMX, the setting is as below:
Problem: the SCLK clock shape is strange. The clock always has some extra pulse which makes the data sending is wrong. But if set the SPI mode is 0, there is no problem. But my project must use SPI mode 3. May I know what is the root cause? I have tried SPI1,2, 3. all have the same problem
2022-02-22 06:25 PM
Probably external noise on the line. What does an analog capture look like?
2022-02-22 07:21 PM
Is this the graphic you would like to check? Thanks for your help.
2022-02-22 07:33 PM
Yes, that's the capture, but it doesn't look like the analog bandwidth is sufficient to ascertain much here.
It's more likely to be external interference than anything internal to the STM32. The clock is steady except for the one glitch. Are these long jumper wires? Could be picking up spikes due to interference. You said you're testing multiple SPIs, which makes me think it could be a nucleo board or something with long leads that you're changing around.
Does the chip you're interfacing with experience problems consistent with this error? What chip are you interfacing with?
2022-02-22 07:45 PM
Thanks for your reply. I have tried on several Nucleo 303 RE boards and one F303K8 board. All have the same problem. The measurement is quite simple, there is no other board connected with it.
2022-02-23 12:25 AM
> SPI peed set: 4M/s
Where's your ground connection?
You can't handle megahertz clocks with long dangling wires.
JW