Skip to main content
A.Caliskan
Associate III
February 2, 2022
Question

SPİ SCK frequency ?

hello , I use spi and ı use slave mod spi. When I send a frequency of 500khz or more as a clock so data is shifting or I recieve wrong data but I send a frequency less than 500 khz I recieve true data. what is the reason of this.( use stm32h743zı)

This topic has been closed for replies.

5 replies

KnarfB
Super User
February 2, 2022

Hook up a logic analyzer, even a cheap USB one or better a scope and check the timing/waveforms. Maybe the waveforms are bad and the timing works only for lower clocks. Or the sampling point (SPI mode) is wrong. Do you handle a SS/CS pin? Maybe that handling is too slow.

hth

KnarfB

A.Caliskan
Associate III
February 2, 2022

I dont use cs/ss pin and ı check waveforms no problem appears,

KnarfB
Super User
February 2, 2022

> recieve wrong data

are bits flipped or shifted? Always the same pattern or random? Can you force specific bit patterns (0xFF, 0x55, 0xAA,...) for better testing?

TDK
February 2, 2022

Sounds like slave is not ready to receive when the master sends the first bit. And/or incorrect CPHA/CPOL settings.

>  ı check waveforms no problem appears,

Show them. The problem is somewhere and it's unlikely to be an STM32 hardware issue. Show relevant code.

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