How to do UART communication between two STM32F446RE boards.

Thread Starter

Hamza.Ansari

Joined Jun 29, 2019
7
I want to apply encoding on input speech on one board and send the parameters to other board via UART and then apply decoding on the second board. How can I do this serial communication??
 

Analog Ground

Joined Apr 24, 2019
460
First, determine the speed you need for your data in Megabits or Megabytes per second.
Second, are the two boards in the same chassis? Separated? What is the distance?
Third, are you using pre-made boards or custom. The microcontroller has many serial interfaces but not all may be supported on the board.

Then, if you want asynchronous as in your title, look at either RS-232 (single ended) or RS-485 (differential) signalling. Depends on the distance. RS-485 goes farther. I prefer RS-485 but it is an extra wire. Determine a baud rate to meet the first consideration above. Sending and receiving the signals is fairly straightforward. You cannot get too "creative". Lots of choice in the software. Interrupt driven or not? What type of buffering? I like circular buffers and interrupt driven.

Then, you will have to specify a message format. I like a simple block format with a header followed by the data and some sort of error detection at the end (checksum or CRC).

Perhaps you could answer the three questions above to narrow down your choices?

Edit: Here is an article discussing some of the buffering issues.

https://www.allaboutcircuits.com/te...ouble-buffering-technique-interrupt-friendly/
 
Last edited:
Top