Communication between two MCU

Thread Starter

serdarzbk

Joined Apr 8, 2022
2
hi,
I need to establish between two mcu that are in two different boards.
Distance between the boards are 15-20 mt and enviroment is nosiy ( several motors and motor drivers operating)
Two board will be connected by a communication cable ( wireless solution is not needed)

which communication protocol is suggested in this situation.
 

Thread Starter

serdarzbk

Joined Apr 8, 2022
2
Thank you @AlbertHall
One one the boards is mainly a keypad board. It main fuction is to transmit human messages to the second board.
second board will have relays. Main operation of the system is On/Off from remote control.
So, speed is not so critical.
 

Ian0

Joined Aug 7, 2020
9,842
I'd recommend CANbus. I use it in very noisy environments, and it never loses anything. TI's transceivers will withstand an offset of 70V between the two supplies.
 

John P

Joined Oct 14, 2008
2,026
If you don't want to go to the hassle of setting up CANbus, you could use a serial port running over shielded twisted pair wires, with an opto-isolator at the receiving end. It sounds as if there's no need for high speed, so keep the baud rate low. Does this link only have to send data in a single direction? If so, a single wire pair is all you need.
 

cmartinez

Joined Jan 17, 2007
8,257
A simple pair of UARTs running through an RS485 converter should do. Most MCUs have UART capability. It's a very reliable form of communication in which a pair of twisted pair cables is used. Shielding adds for extra protection.

Just make sure that your protocol accounts for timeouts and adds a CRC at the end of every message.
 

Ian0

Joined Aug 7, 2020
9,842
If you microcontroller has CAN, then it will deal in hardware with error checking and acknowledge signals. When you send a message, it will keep sending it until it gets an acknowledge, and when it receives it you will know that it is error-free. If you use RS485 you will have to do all that in software.
 
Top