# How to find RS485 UART pins are inverted in the data sheet?

I want to know, how we identify the RS485 pins are inverted. I am using at91 microcontroller?

This sam9260 board has four rs485 in which two of them are inverted. How to know which ports are inverted, I didn't find such information in the datasheet also?

This is the simple code:

rs485ctrl.inverted = 1;
rs485ctrl.pin = -1;


EDIT: other serial device configuration:

rs485ctrl.inverted = 1;
rs485ctrl.pin = 0x40 + 2;


I didn't understand where this 0x40 +2 magic number came from? I interpreted if the pin is inverted it set as -1, perhaps what I understood is wrong?

I used the multimeter to verify the positive wire is greater than negative wire during idle but don't know if there any other way to find the polarity of RS485?

Don't know, is this the right forum to ask such a question.

• What do you mean "inverted", the differential signals? Your microcontroller should only need to concern itself with the UART part, or are you also using handshaking signals over RS485? Why is there 4 signals? Is this actually RS422 (full duplex)? Please post (a link to) the schematic. As for data sheets, you need to check the data sheet of the RS485 transceiver and nothing else. The lines are usually called A and B, where I believe B is the inverted one. – Lundin Aug 15 '18 at 8:00
• @Lundin, I will check the schematic that will give information about line A and B polarity. – danglingpointer Aug 15 '18 at 8:09
• I still don't get why your program needs to know this? This is handled by the RS485 transceiver, not by software. Or are you "bit-banging" an UART (why on earth would you do that)? – Lundin Aug 15 '18 at 8:13
• I just reread the wiki page of rs485, know I learned A is non-inverting pin and B is the inverting pin. It's hardware that takes control of it. I am not doing the bit banging, I was unaware of the A and B polarity. Thanks for the information. – danglingpointer Aug 15 '18 at 9:17