I decided to build a small USB to RS485 converter after struggling to find a decent one on the Internet, something simple and cheap at the same time.
I’ve edited a schematic diagram based on the FTDI 232R datasheet and prototyped on a piece of bare PCB (with holes and copper strips) using an FTDI demo module from Farnell (found sitting idle in my drawer) and a RS485 driver chip.
I’ve added two LEDs for RX and TX, very useful when you need to know if data is flowing through the interface.
Another LED was added on the TX_EN line to signal if the bus is driven from the interface (master mode).
The 120 Ohm resistor can be connected via a link on the RS485 bus when we want to terminate the bus (which is the case in most applications).
Programming the function of CB0 to CB3 pins (see the FTDI232R Datasheet) is done using a small utility software downloadable from the the chip manufacturer http://www.ftdichip.com/Support/Utilities/FT_Prog_v1.12.zip
the assignments are as follows:
CBUS0 = TX_LED
CBUS1 = RX_LED
CBUS2 = TXDEN
CBUS3 = PWREN#
Everything worked, so we decided to build a few boards…
…and a little bit of testing at different bit rates, here are the results
and a bit, showing the rise and fall edges of the signal and lack of reflections.
we decided to repeat the tests increasing the bit rate to 500.000 bits /s to see if the bits are propagated correctly and the oscilloscope captures are looking good.
actually the signal was looking a little better than before…
And a detailed view of a bit @500.000 bits/s, no nasty reflections
And finally we decided to go a little extreme with 1 Mbit/s over 30m of cable
Conclusion: it worked well exceeding our expectations, at least for a point to point connection over 30m, next will try to add devices on the bus, and redo all measurements, and increase the length of the cable.
All tests were performed over 30m of cable terminated at bots ends with 120 ohm, signals were sampled with a 1 Gs oscilloscope at the receiver end (far end).
Update: Now available in the shop