cancel
Showing results for 
Search instead for 
Did you mean: 

Dummy bits with SPI and DMA.

rubenles
Senior

Hello,

I am using ESP32-wroom-UE as master and a SPI connection with stm32h743zit6 as Slave. I am using DMA for communication between micros.

I am using those microcontrollers on a custom board, done by me. I used the first prototype with SPI4 and it works perfectly. I add 10 bits of dummy data on the string i want to send and it works perfectly. But when i tried to use my second prototype with SPI1, is doesn't work fine, i have a disorder of digits. I was going crazy when i realize dummy data could affect.

I rise the value of 10 bits to 20 and it started to work well. I think the master starts to send clock cycle and the master needs to wait to the slave to start and synchronize correctly but i have a lots of doubts...

How can i know how many dummy bits i have to send? In the future maybe i change the number of SPI and it happens again. If anyone can tell me things about how to calculate dummy bits needed on SPI it will be awesome.

 

Thank you so much to everybody,

Best regards.

1 REPLY 1
Andrew Neil
Evangelist III

Previous thread on this:

https://community.st.com/t5/stm32-mcus-products/is-there-any-difference-between-spi1-and-spi4/td-p/706161

 


@rubenles wrote:

I am using those microcontrollers on a custom board, done by me


Please show schematics.

Also a minimum but complete code example which demonstrates the issue.

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228 

 


@rubenles wrote:

I think the master starts to send clock cycle and the master needs to wait to the slave to start and synchronize correctly but i have a lots of doubts...


If that's the case, you should be able to see it happening by using a logic analyser on the SPI lines.

The slave needs to be ready to accept data immediately the master starts clocking - that's fundamental to how SPI works.

Do you use NSS (slave/chip select) to synchronise the transfer?