Simplest RS485 to RS232 conversion
william chan
Posts: 1,326
Hi Geniuses,
Can a one way RS485 signal ( from lets say from a Mifare Card reader ) be directly converted to RS232 ( TTL level will suffice ) by using just resistors and diodes?
Thanks,
William Chan
Can a one way RS485 signal ( from lets say from a Mifare Card reader ) be directly converted to RS232 ( TTL level will suffice ) by using just resistors and diodes?
Thanks,
William Chan
Comments
So, put a 120 ohm terminating resistor on and see what voltage is developed across that resistor using a scope.
First RS232 is a +12/-12 serial data transmission and reception convention; while RS485 is a twisted pair noise elimination serial data transmission and reception. That is all about the hardware.
Second, is the nature of the serial data. What exactly is the 'packet'?
If it conforms to what we traditionally think of RS232 (certain baud rates and 8 or 7 bit ASCII (or EBDIC) data and related parity and related stop bits), there should be little problem.
But one can just as easily have a serial packet that has a non-standard baud rate AND/OR more or few bits of data. These days, 16 bit transmission would allow UNICODE to be directly transmitted without conversion, or 24 to 32 bit would allow direct transmission of video information.
And of course, there are the devious that might choose 13 bits in one direction and 19 bits in the other confound those of use that use an oscilloscope to peek at what is going on.
You have to hook up an RS-485 reciever and see what is displayed on a scope to know what to do with it.
William, do you know what baud rate is required? Because large protective series resistance may limit the speed somewhat. Also how electrically noisy is the environment? Because I think you're going to lose many of the benefits RS485 normally provides, if you bias around a prop switching threshold
I'd use an RS-485 to RS-232 interface chip.
Since the RS-422 receivers come in a Quad chip, it might be easiest to get a RS-485 Tranciever chip and just have it tied to receive.
There are tons of varieties of these, but a 75176 is quite adequate.
http://www.ti.com/lit/ds/symlink/ds75176b.pdf
For caveats I point at what others have said above. The voltage swing will be much less if there is 120Ω resistor across the line, and of course you lose the advantages of RS485 signalling. RS485 to logic level chips are readily available in 8-pin packages.
Adding a resistor-divider network at the input will increase the common-mode range and terminate the signal properly.
If you just want to convert to logic levels, instead of RS232, an RS422/485 receiver is the best solution. Barring that, this circuit should work for you, assuming the grounds of the two systems are not connected:
If it's a commercial application, though, definitely make the extra effort and incorporate a differential receiver.
-Phil
Again, for this to work, the two system grounds should not be connected, else your signal amplitude will be halved, and you will not get a negative voltage swing. Here's what it looks like on my scope from a 5V RS422 driver:
Whether or not this actually works will depend upon your cable length and how forgiving your RS232 receiver is, since it does not quite produce a +/- 3V swing. You may have better luck if you bias the positive twisted-pair lead a volt or so above ground, rather than to ground level as shown here.
-Phil
Going the other direction, you have to bias the (+) RS485 input to Vdd/2. I once bought up a bunch of 2400 baud modems that were meant for use on the Apple Desktop Bus (RS485), and converted them for use directly from the i/o pins of a BASIC Stamp.
Thanks everyone.