One-way errors in USB / RS-485 converter - Page 1
Forum section: electronics / projects

author: Electrole
author_rank: Contributor
timestamp: July 13, 2020, 02:25:23 pm
content: I have implemented a USB to RS-485 converter using the FT232RQ from FTDI, based on their Figure 7.2 ("Application Example Showing USB to RS485 Converter") in the FT232R USB UART IC Datasheet. The level translator I use is an ADM485EARZ from Analog Devices. The CBUS signals are routed as in the Figure 7.2.Sadly, it does not work as intended, and I'm trying to find out why.The data from the USB input through the FT232RQ and the ADM485EARZ seems to be in order. However, the data I read from an RS-485 device (a laser controller) is plagued by intermittent errors.I can see that there's a wrong checksum when an error occurs. Typically, I read 10 bytes from the RS-485 device. Of these the first 4 bytes are always correct, but errors may then occur in the bytes to follow. It also seems that I read one more byte than expected when an error occurs. The error rate is about 2 % or so. The RS-485 signal appears to be in order with no strange levels or overshoots, etc.Anybody got a hint on what to look for?

author: langwadt
author_rank: Super Contributor
timestamp: July 13, 2020, 02:46:46 pm
content: Quote from: Electrole on July 13, 2020, 02:25:23 pmwhen no one is transmitting the bus is floating, add failsafe bias resistors on the bus,https://e2e.ti.com/blogs_/b/industrial_strength/archive/2016/12/06/rs-485-basics-two-ways-to-fail-safe-bias-your-network

author: Electrole
author_rank: Contributor
timestamp: July 20, 2020, 01:12:12 pm
content: Thanks for the suggestion about adding pull-up/down resistors to the RS-485 lines!!I added the resistors, and thought indeed that they had gone rid of the erroneous readings. However, after a while (and to my huge disappointment) I encountered bursts of reading errors. My impression is that the resistors may indeed be needed, but they are not sufficient to get rid of the reading errors. I assume there may be another issue lurking somewhere. Perhaps a driver / setup / timing issue??BR

author: digsys
author_rank: Unknown
timestamp: July 20, 2020, 01:32:38 pm
content: Coincidentally, I've been working with USB <> RS485 converters this week, even made my own in the past. I was in a hurry today and just bought a couple from the local electronics shop, to diagnose a fault on a machine I'm fixing. Got that sorted and have JUST started to compare the wave forms with my PCBs. Also had odd issues.Agree with the termination suggestion - but sometimes, the default H,L and mid resistors need tweaking (or removing). The issue I'm working on now (tomorrow my time) is actually a TXE delay / collision. Some systems switch from half to full duplex depending on timing tests etc etcCan you grab an off-the-shelf one to compare, like I did?All I can offer for now, more tomorrow :-)

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: July 22, 2020, 09:17:02 pm
content: You need to look at the bus with a scope to see what's going on, e.g. there could be slight collisions if the driver enable isn't released quickly enough, or too quickly

author: langwadt
author_rank: Super Contributor
timestamp: July 22, 2020, 10:55:44 pm
content: Quote from: mikeselectricstuff on July 22, 2020, 09:17:02 pmyes it is probably easy to spot the problem with a scopefrom the datasheet FT232RQ assert txen one bit before the startbit and de-assert at the end of the stopbit, that should be perfect and the first few bytes are supposedly always correct