I read the following page:
The author suggests to use a CAN transceiver, instead of a RS485 half-duplex transceiver, to create a serial multi-drop bus with nodes featuring normal UART peripherals. This should avoid the use of a third pin for direction control.
What do you think? Does this solution works without problems?
I think the control of the direction pin isn't simple. You should change the direction from tx to rx as soon as possible, because you need to free the bus. However, most of MCUs (at least the ones I used) lack the "automatic" control of the direction pin. In the best case, you have an IRQ when the last byte is really shifted out. But IRQ is processed with a certain latency, if other IRQs are active.
The solution is to introduce a short delay *before* starting transmitting an answer, just to be sure the other node has really freed the bus. However creating short delays isn't simple: you have to use a hardware timer, if you have one. One possibility is to use the same UART peripherla to transmit a couple of dummy bytes with direction pin in the receive state. After dummy bytes are really shifted out (they will not appear on the bus), the direction pin changes enabling the driver of the transceiver.
After all, the CAN transceiver solution should solve all those problems.
The only difference, from the firmware point of view, is you will have the echo of all the bytes you transmit on the bus... right?