I am reading RS422 data into a computer. However, the data is only correct if I flip the bits (one's complement). Any ideas why?
I looked on an oscilloscope, and it looks like the ones are high and the zeros low.
I am reading RS422 data into a computer. However, the data is only correct if I flip the bits (one's complement). Any ideas why?
I looked on an oscilloscope, and it looks like the ones are high and the zeros low.
In reference to what?
>
OK. Common problem. Common solution -- flip the two wires. Happens all the time with twisted pairs. A and B reversed is by far the most common setup problem with RS422 and RS485.
Good luck Chris
Flipping the two wires does not work. That also flips the start bits, stop bits, and parity bits, which messes everything up.
That would seem to indicate that the hardware is okay and that you have a software problem, either with what you load into the transmit holding buffer or with a configuration bit instructing the UART how to handle the byte that's loaded into the outgoing buffer. What does the data look like upstream of the '422 line driver?
You'll have to add a harware inverter somewhere. RS485 is not RS232 and the RS485 data can be in any format that appeals to you. The UART in Micros such as PICs etc, expect RS232 format input, which means the static, line-idle, inactive, no data, level at the UART input pin is logic 1, ie +5V. A RS232 'start' bit then drops the pin to 0V. The UART making the assumption that the RS232 data has been inverted whilst coming off of the comms cable. john
OK. Bob. Please describe the hardware you're using on both sides. Also, did this work before, or is it a new setup?
Any additional information would be helpful, the more the better.
Thanks Chris
yup, thats normal.. it makes it easy for you to use a level Inverter. you can drive the computer with the level of voltage needed and invert it as you go.
Have something to add? Share your thoughts — no account required.
Ask the community — no account required