I’m about to make my first foray into RS-485. As long as I have an appropriate transceiver selected, does anyone know if there is anything on the G400 side that might prevent full-duplex operation with RS-485? And does anyone know what is the max baud rate that the G400 can support?
RS485 is not full duplex unless you have 2 driver ICs connected on a 4-wire bus. A lot of devices that are RS485 are generally 2-wire so half duplex. You can design for 4-wire and make it 2 but jumping TX and RX.
As you plan to use full duplex, you only have to control the transmitter on state. As you have 4 wires, you have no need to disable the receiver as there is no reception of your own transmission although it would be a good idea anyway if you think you will use on a 2-wire bus.
You can control the TX/RX with a GPIO pin or you can use Maxim’s auto transmit enable IC for this (Only available as 5V operation though). Having used RS485 for years, this little IC is so easy to use as you never have to worry about the control of TX/RX.
One last thing. Put a pull up resistor on the RXD line of the transceiver. This puts the bus in a known state when the receiver is disabled otherwise this line floats and your UART will not like this.
@ Dave - Thanks!
@ Dave McLaughlin - Do you recommend to use pull-up resistor for RX line within all Gadgeteer modules that communicate via UART? I have designed my own module and I was about to order PCB manufacturing, but now you got me thinking if I need to add pull-up resistor for RX line while it is not too late or will I be fine without it. :think:
@ iamin - If the protocol is RS-232 or TTL serial, I don’t think any pullups or pulldowns should be used.
For RS-485, the situation is a little different because differential signaling is used. When not transmitting, the master tri-states the bus, and this could lead to the erroneous impression of “0” being sent since the voltage difference between the TX and RX lines would be practically zero, unless a pullup is used to bias the bus to a known state.
The link below is a really good explanation of RS-232 vs RS-422 and RS-485. Take a look at the paragraph on “Fail-Safe” which gives a good explanation for the pullup resistor:
With RS232 I’ve found that the driver IC’s go to a high level on the output when there is no RS232 device connected but with RS485 driver IC’s I’ve found that the RX line floats when the RS485 driver is disabled for reception. If you have an also on receiver then you don’t need it.
With the auto transmit IC’s from Maxim,you need the pull up and pull down on the bus side otherwise they fail to work. The datasheet shows this. As iggnoe says, it’s good practice to bias the RS485 bus anyway for times when it’s in an unknown state and no device is transmitting.
By the way, even with TTL I would still put a pullup on the RX line simply because if the port is not connected and you have a serial port open, you are very likely to see lots of activity on the receive side.
I tend to add them as a belt and braces scenario these days as I’ve seen to many issues with serial development when the RX input floats. The cost of a 10K resistor is peanuts to the amount of faffing about timewise trying figure out what is going wrong