MAX 485 very weird performance!!!

Discussion in 'Electronics Resources' started by mamech, Apr 26, 2011.

  1. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0
    Hello

    I bought 2 MAX485 to make a network between 2 micros as a test.

    Before getting involved with micros I decided to test the Max using my laptop. So I brought usb to rs232 converter and I decided to make a test in the following manner:

    1-To connect Tx to DI of the first max
    2-To connect Rx to RO of the second max
    3-To connect A & B of the maxs to gether.
    Now the test is done if I send a serial data using terminal program on my labtop, then I receive its echo.
    In other words, the sequence should be :
    from tx rs232--->rs485--->to rs232 rx

    I did the test and I was satisfied.

    But I found something very strange later.

    I discovered that I receive the echo on the terminal program even if there is no supply to maxs and there is no connection between A1-A2 and B1-B2 !!!!! (Look at the attached photo)


    I thought there is short circuit somewhere, and I disassembled the whole circuit and reassembled it again, and I got the same result.


    Is this normal ? if yes, then how I ensure that the echo is from the conversed rs485, not from the rs232 ? and if no, then what is wrong?
     
    • 4.jpg
      4.jpg
      File size:
      29.8 KB
      Views:
      41
  2. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    Maybe the signal gets coupled via the Vcc and Gnd lines, which will be floating with no input from the supply.

    With no supply voltage connected, parasitic (and perhaps protection) diodes leading from the inputs and outputs to the supplies will not have the normal reverse bias.

    If you restore the power supply, but leave the A and B lines disconnected, do you still get transmission?

    PS Where are the supply decoupling capacitors? They may not affect this issue, but generally they are a good idea.
     
  3. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0

    Yes!!!! I still get the transmission !!!!!!!!!!!!!!

    sorry to ask, but what are decoupling capacitors? But anyway, as you said, this does not affect the main problem.


    I was so pleased in the beginning when I received the transmission back, but what is happening now makes me in doubt in the first test I made.
     
  4. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    I did not say that decoupling capacitors would not affect the problem: they might or might not, but they are almost universally used. That said, your particular circuit using balanced drivers and receivers may not have such a critical requirement for low supply impedance.

    Power supply decoupling (aka bypass) capacitors are relatively large value capacitors normally connected between supply lines and ground. They are typically placed as close as possible to the power connections to active devices such as ICs, with the aim of minimising the power supply impedance, particularly at higher frequencies where the effects of supply wiring inductance and resistance might otherwise be problematic.

    This is a technique which is worth knowing about, so a "sticky" permanent notice thread has been written about. I think that it is worth reading: http://forum.allaboutcircuits.com/showthread.php?t=45583

    What happens if you swap the data lines A to B, B to A, and try the circuit with power on? This should give you an inversion - does it?
     
  5. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0

    I have put first A & B in the right order , but I got nothing. I remembered that both RE and DE should be grounded in rx side and should be connected to supply in tx side. When I did this I got the echo again.

    When I inverted A & B , I got nothing again.

    Does this means anything??
     
  6. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    It sounds as if the circuit is basically working, but there may be a crosstalk path via the power supply.

    Does this really persist with A and B disconnected, but with the power on?

    If so, I would strongly suggest adding supply decoupling capacitors of (say) 100nF from Vcc to Gnd as close as possible to each IC.
     
  7. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0
    I tried this with power on and all wires connected EXCEPT A & B.
    it does not work in this case.
     
  8. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    It seems likely that the signal was going via the (unpowered) supply lines during the earlier test you were worried about.

    The set-up may well be working acceptably as long as the power is turned on.
     
  9. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0


    I still have doubts that the echo signal is not originated from rs485 conversion.

    But I think if it is working properly, then the inversion should have worked, or what do you think ?
     
  10. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    Time to have a look with an oscilloscope, if you have access to one. Otherwise, make up another physically separate circuit, with an independent power supply. Connect them by the data lines only and see if you get transmission.

    Does the fact that the mode enable connections have to be set right give a clue that you have proper transmission?
     
  11. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0
    I do not know if there is hidden factor that makes things go wrong.

    I will explain what I did in details.

    I am using a 9V battery for supply.

    The pin configuration for the max485 is as in the attached photo. In the data sheet there where 2 pin configurations, one for DIP and the other is for something called umax. I built my circuit according to DIP config , because the Ic that I bought is DIP.

    As I said before, I used one max as driver and the other as receiver.

    I do not have serial port, so I use usb/rs232 converter

    In the driver side:
    RO-----Not Connected
    RE & DE -----Connected to supply
    DI-----computer tx
    GND-----GND
    VCC-----9V
    A1-------A2
    B1-------B2


    In receiver side:
    RO-----computer rx
    RE & DE -----Connected to GND
    DI-----not connected
    GND-----GND
    VCC-----9V
    A2-------A1
    B2-------B1

    I do not know what is missing. I thing the whole matter is supposed to be simple.

    In the beginning I supposed that an echo signal means that the test is successful.But What I need now is to capture the inverted echo from the inversion of A-B (i.e :A1-B2 & A2-B1).

    Any Ideas?
     
  12. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0
    I think that I new the source of the problem.

    I should have connected rs232 db9 gnd to the other circuit ground.

    trivial fault, but the effect was catastrophic :0
     
  13. mamech

    Thread Starter New Member

    Nov 3, 2010
    23
    0
    a final question please:

    I know that the output of micro is TTL. Will connecting micro directly to max485 will produce a 485 ? or should I convert the TTL to rs232 using max232, then connect its output to max485?

    thanks
     
  14. eblc1388

    Senior Member

    Nov 28, 2008
    1,542
    102
    No. the Max485 can be directly connected to the MCU pins, without the need of another conversion like RS232.

    If you powered the MAX485 with +5V, then the logic input voltage levels are +2V or more for HIGH, 0.8V or lower for LOW.

    Please noted that a single MAX485 can only do simplex communication, and you also have to take care of the control voltage on pin2&3(usually tied together) using another pin of the MCU or some additional circuitry, like 555.
     
Loading...