On 06/03/2023 10:41, pozz wrote:
> Il 04/03/2023 12:06, David Brown ha scritto:
>> On 03/03/2023 17:15, pozz wrote:
>>> I think you already know this trick: connect DE/RE signals of RS485
>>> half-duplex transceiver to TX *negated* signal from UART and connect
>>> TX input of transceiver to GND.
>>>
>>> If the bus is not driven by anyone, A signal goes high and B signal
>>> goes low thanks to the pull-up/down resistors.
>>>
>>> The trick uses the fact that the undriven bus and transmitting 1 is
>>> the same thing: A is high and B is low. So, when transmitting 1 the
>>> driver is disabled (DE=0), when transmitting 0 the driver is enabled
>>> (DE=1). Because TX is set to 0, A goes low and B goes high.
>>>
>>
>> This arrangement is also known as a "CAN bus driver".
>
> CAN is a well-known and very reliable network. Does this mean I could
> use RS485 in "CAN bus driver" arrangement without critical problems?
>
Yes, you certainly can do so - within limitations. Since the return to
idle (logic 1) level is by terminating resistors, you don't have such
clean edges and the rate is highly dependent on the bus load,
capacitance, and termination resistance. Normal RS-485 is sometimes run
over kilometres of cable - CAN is rarely more than a few tens of metres.
And while CAN bus drivers are derived from RS-485 drivers with the
arrangement you describe, they are a bit more optimised for the task.
So you might consider using real CAN drivers rather than RS-485 drivers,
even if you have UART signalling rather than CAN controllers for the
protocol. (I did this myself on a project, long ago.)
Another alternative, of course, is to use full CAN - microcontrollers
with CAN controllers are no longer the premium they used to be.