Content originally posted in LPCWare by MikeSimmonds on Sun Aug 04 11:53:15 MST 2013
RS485 transmits (and receives) using a differential bus (the cable between the devices).
What people call RS-485 actually coveres two diferent standards: 4-wire (full duplex) and 2-wire (half duplex)
Check wikipedia for RS422.
4-wire uses two differential pairs, one to transmit, one for receive.
In this setup, the receive is always enabled, the transmit is like
a walkie-talkie, push to talk. I.e. only enabled when actually transmitting.
2-wire uses just the one pair; the TXEN will enable the transmitter AND disable the receiver
When the transmission is done, the transmitter is disabled AND the receiver is enabled.
When I say the transmitter/receiver is ..., I am refering to external hardware -- the micro
can not drive a differential pair (or generate the voltage levels required by the standard).
The external device (google LTC485) handles a single differential pair out/in and 'gates' this
pair to the rx and tx pins (from/to the cpu) depending on the level of the TXEN pin.
On the LTC485, there are separate drive enable/ receive enable pins. One is active high
the other active low. The cpu TXEN pin is wired to both to achieve the enabling/disabling
that I described above.
NOTE Depending on how the PCB is actually wired, you may need to invert this signal.
There is a bit (OINV) in the RS485CTRL register to choose this.
Also, you need to set the RS485DLY register so that the last bit of your outgoing
character stream is not cut off.
4-wire systems have two 485 chips, one permenantly receive enabled driving the cpu RX pin,
one (with TXEN controling the drive enable) driven by the cpu TX pin.
As we often want multi drop (three or more devices on the same bus -- i.e wires) only one device
may transmit at any one time [or no device may be transmitting].
This is not a direct answer, but I hope it will give the required background (or at least hints)
so that you can interpret your schematic/user manual yourself.
Regards, Mike