Electronic – RS485 implementation problem

rs485

I'm trying to implement RS485 link between mcu and pc. I'm using MAX485 for testing my setup.

Question: I can not receive bytes if I use termination resistor. Why? How to solve this?

History:

If I place a termination resistor (120 ohm), it is obvious that A-B pins are no longer high impedance. According to the datasheet, if A-B pins are not in high impedance, MAX485 ic's RO (Readout) is low while listening. If data line is low right before transmission starts, this sequence is not accepted as a valid sequence. That's why I can not receive any bytes if I use termination resistor.

I solved this problem by removing termination resistor. This put the MAX485 IC's A-B pins into a high impedance state, which turns RO pin (Pin #1, the TX pin of this IC) into high state while listening. Since the TX pin of this IC is high right before transmission starts, I can communicate as intended. But I know I will need to use termination resistor.

What is wrong with this setup?

Circuit Behaviour:

  1. On the PC terminal screen, a key is pressed
  2. The USB/RS232 converter generates a sequence from its TX pin.
  3. STM32F407 receives this character, and simply echoes it via its TX pin.
  4. MAX485 ic receives this character, converts it a differential signal.
  5. Other MAX485 ic gets this differential signal and converts to the character.
  6. USB/RS232 converter gets this character via its RX pin.
  7. Received character is shown in the PC terminal screen.

Test case: Setup is correct if you can see pressed character in the terminal screen on the pc.

(I know I mixed the TTL levels and CMOS levels since I don't have appropriate IC's right now. Conversions made by resistors.)

This is my test circuit:

Problematic circuit

This is the truth table of MAX485:

Truth table of MAX485

Best Answer

Coincidentally, I just completed a project using the same rs485. Add a pull-up resistor at DE, and a pull-down resistor at 'RE. This way, you will always be ready to either receive or transmit. (10k pull-up, 220 ohms pull-down) Do this for both ICs. Do not leave either of these pins floating. Good Luck!