2024-09-05 01:17 AM
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.
2024-09-05 02:06 AM
Previous thread on this:
@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.
@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?