I am doing a project in which two MCU communicate to each other by RS485. I used a UART to RS485 IC on each side, so the communication is actually through UART.
I have done the hardware and software, after debugging for a long time, they can communicate now. However, in my protocol, if a package is dropped, the communication will stop.
My protocol:
1. 'A' go into Tx mode (as RS485 is halfplex)
2. 'A' start to send a byte to 'B'
3. 'A' wait for 10ms and then go into Rx mode
4. 'B' is in Rx mode at the begining, if 'B' received the byte, it wait for 50ms and then go into Tx mode.
5. 'B' send a byte to 'A', and then wait for 10ms and go into Rx mode again
6. If 'A' received the byte, it wait for 50ms and go into Tx mode again.
Can you suggest a better protocol for RS485 communication?