2024-01-30 09:47 AM - edited 2024-01-30 12:30 PM
Hello Everyone,
I'm reaching out for some guidance on a project that I've been working on. Despite considerable effort, I'm still struggling to find an effective solution.
My project involves developing a controller design to manage different models on each STM32 microcontroller. The goal is to synchronize these controllers. I have successfully built the models, and they are functioning well. The key task is for each board to transmit data to another board. This data is crucial for calculations, leading to the generation of new data. This process of data exchange needs to be continuous. The image below shows how the each stm32 work.
Here's the challenge: I'm having difficulties with the data transmission and reception between the boards. The data, which is in double format.
I would greatly appreciate any advice or suggestions on this matter, as I'm starting to run low on ideas.
Thank you in advance!
P.S. This is the code i am using for both boards. Just to check if i can transmit and receive at the same time.
2024-01-30 09:52 AM
Where is the entry point for the loop?
2024-01-30 09:57 AM
Each board has it own initial conditions. The it goes into he while(1) loop. Does this answer your question?
2024-01-30 09:59 AM
So how are you connecting the 2 boards - UART? Other?
They key to this kind of thing is to not try to do both ends at once!
Start by getting one end working & fully tested against, say, a terminal in a PC.
Then get the other end working & fully tested against, say, a terminal in a PC.
Then - and only then - bring the two together.
2024-01-30 10:02 AM
I have tired both SPI & and UART. When I loop the connection onto itself. It works fine. I checked this by sending the data the serial comms thru UART. The trouble happens when I make the connect from board 1 to board 2.
2024-01-30 11:49 AM
What trouble? You haven't given us any info on what is or is not happening. Nor have you shown any code (hint: use the code format button, click on "..." then "</>").
What do you see that you don't expect? What don't you see that you do expect?
2024-01-30 12:15 PM
i not sure where "..." is. The trouble is that i can figure out how to send and receive. The figure above shows that.
2024-01-30 12:19 PM
Sounds like a hardware issue possibly. Show us a diagram on how you're connecting the boards together with PS.
2024-01-30 12:23 PM
Sure can, what is PS tho? Do you want a picture? I connect MOSI to MOSI, MISO to MISO, NSS to NSS, and CLk to CLK on each of the boards, using spi.
2024-01-30 12:45 PM
Here you can find help with your project, both in hardware and software.