Electronic – Decode rs-422 without line reciever

differentialrs422signal

I have a encoder on a dc motor that outputs it's signals as RS-422. A, ~A, B and ~B so it just sends to raw ticks of the encoder and not serial data.

I didn't have a line receiver available so a colleague thought to test we can just connect the A and B lines to a microcontroller and use those. I thought this should work as well but we are seeing weird transition in the encoder pattern that shouldn't physically be possible.

So searching online I found discussion such as this:
Can I an RS422 interface to Arduino's serial pins?

which say without really explaining that you really do need to decode the signals for it to work. So my question is basically. Could the reason be that I see weird encoder transition be due to us not using a proper line-reciever? And also why isn't it the case that just connecting the positive signals is enough.

Be aware the cable from the encoder to the MCU is just a couple of inches.

Best Answer

So, your A and ~A form a differential pair – and as it's only required that the relative voltage of these reflect the data signal, a totally legal differential signal would fix A at 6 V, and make ~A alternate between 4.5 V and 7.5V (if you're going for a 1.5V differential voltage). AC coupling might also be part of the line driver - if the protocol ensures sufficient rate of state changes, e.g. through line coding, in which case the ground-referenced voltages on A or ~A might also be negative for short durations, even without anyone actually having any negative supply voltage.

So, long story short: you have differential line. Build a differential receiver!

That needn't be problematic or expensive. As said, if the protocol ensures sufficient numbers of bit transitions, just using something stupidly simple as

       +VCC
         |
       |10kΩ|
         |
A---||---+-------\   |\
         |        ---|+\
       |100Ω|        |  >--MCU
         |        ---|-/
~A--||---+-------/   |/
         |
       |10kΩ|
         |
        GND

Would probably suffice to receive differentially. Whether or not you use an external comparator or a comparator built-in to your MCU depends on whether your MCU has these. (many do, but then again, if you had one, you probably would have no problem.)

But honestly: get a darn RS-422 receiver. These are 3mm × 3mm including leads and cost something between 23 and 56 ct. This seems to be a no-brainer, unless you need to cost-optimize for > 10⁴ devices, in which case the answer might be: get a MCU with a differential RS-422 receiver built in.