Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

XMEGA UART TO RS485 problem

Status
Not open for further replies.

karbiuch

Junior Member level 1
Joined
Feb 10, 2016
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
208
Hi

I wrote simply program to send data from uC to PC. I use PIC UART and ft232. It works.

Now, I would like to transfer my weather measuring system from my room to the garden. USB does not work at such distances (20m). That's why I decided to use RS485. I think, the easiest solution is to use RS485 in full duplex configuration. Unfortunately, the microprocessor does not send or receive messages from PC. My connection cables are very short, 0.2m. In my opinion, this is a hardware problem. I cant find solution to fix it. Could you check if I have a mistake in the electrical schematic?

I tried to add a 120ohm resistor and a 3.3V to 5V converter. It doesn't help.


https://datasheets.maximintegrated.com/en/ds/MAX1487-MAX491.pdf

rs_485fullduplex.jpg
 

You haven't enabled the MAX489!
Tie '/RE' to ground and 'DE' to 5V to enable the receiver and transmitter circuits. You should ideally add a resistor of about 120 Ohm across the receiving end of each pair. It might work without them over short wire lengths but you certainly need them if the distance between ends is greater than about 5m.

Incidentally, this is RS422 not RS485, electrically they are very similar but full-duplex.

Brian.
 

DE and RE are on constant potential:
DE - 5V
_RE - 0V

I added resistors: 2x 120ohm to AB and 2x to ZY.
Still no transmission. Is the wiring diagram correct?

QlY0hWwl.png.jpg

Why this is not RS485 but RS422?
 

RS485 uses only two wires and has a protocol for deciding which direction the bus information is traveling, it also specifies how devices in parallel on the bus are addressed so only one device at a time tries to drive the bus.

RS422 is electrically almost the same but it uses four wires (as in your schematic), two for transmit and two for receive. Because there are different wires for outgoing and incoming data, there is no need for the bus direction to reverse. The idea behind the 'DE' pin is it electrically isolates both the transmit pins so other devices can share them. Obviously, only one device on a shared bus should have 'DE' enabled at any time or there would be a data collision.

Your schematic should work. Try temporarily removing the MAX489 and linking the TX and RX wires from the FT232. It should echo back everything sent to it from the PC. If that works, refit the IC then remove the uC and link the RO and DI pins that were connected to it. Again, it should echo back as before. If it does, the problem is in the uC, if it doesn't the problem is in the connections between the two MAX489s.

Note that you only need the terminating resistors at one end of the wire pair, normally the end receiving data.

Brian.
 

Hi,

You need to add a GND connection.

Do you have a proper twisted pair cable with about 120 Ohms characteristic impedance?

Klaus

Additionally I recognized: you crossed the differential lines: --> connect A with Y and B with Z.
You should use a 3.3V RS422 device for the right hand side 3.3V logic circuit.
Each device needs to be connected to the same GND (uC, both RS422, FT232, PC)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top