Skip to main content
Associate III
January 23, 2024
Question

Problems with clock prescalers and saleae on an STM32H563ZI nucleo board when using SPI

  • January 23, 2024
  • 1 reply
  • 1507 views

Hello,

we are using the saleale logic 8 to read data transfer between an STM32 MCU and an IC through SPI (ADS8166 ADC).
The CLK frequency is 1.5 for the SPI configuration with a prescaler of 2 so at the end we have  CLK of 750 kHz. 
For some reason SOMETIMES we can't read the data properly through the MISO channel with this configuration, even though the saleale has a sample frequency of 50 Ms/s. The saleale configuration is correct and the MOSI signal is always read accordingly. The debugger always reads the correct values so the data being transfered is correct but the saleale reads it wrong. Find attached screenshots of the measurments.
Any idea of what could we be doing wrong?
should be reading 0xAA:

massimoperdigo_0-1706011612538.png

 

 

1 reply

Michal Dudka
Lead
January 23, 2024

Probably arrow symbol on clock is edge used by sealae to read data value. But in signal you can see that transmited data use rising edge to set and falling edge to read. You have wrong SPI mode used on transmitter (STM32) and reciever (Sealae).

Associate III
January 23, 2024

IMG_9567.png


this is my configuration, i think it is correct.

 

Michal Dudka
Lead
January 23, 2024

One of your configuration is not correct. If you need to read on rising edge, change configuration in MCU (CPHA). If you need to read on falling edge, change configuration in Sealae.