Connect with us

Compatibility serial devices

Discussion in 'General Electronics Discussion' started by muffinman, Dec 10, 2012.

Scroll to continue with content
  1. muffinman

    muffinman

    17
    0
    Dec 10, 2012
    Hello all,

    I've got two devices which communicate through a serial interface (one with an actual rs232 port and the other a 4 pole minijack). I would like to know whether I can hook them up to each other without causing any damage due to incompatible voltage levels (or something else). However, I have a hard time interpreting the information I've got. I hope someone here can help me with this.

    What I know of the first device is the following (receiving data):
    - "The output is open drain, the input is 5 volt tolerant."
    - "The normal level is 5v. Its output is open drain with a weak pullup to 5v."

    From the second device I know the following (sending data):
    - It uses the MAX3243 driver (http://www.ti.com/product/max3243).
    - I can access its serial output at two different levels:
    -- "RS232 levels using a MAX3243 driver, the datasheet says RS232 levels at min 5V, typ 5.4V"
    -- "COM2 is also available at 3.3V CMOS levels"

    One observation:
    - Open drain seems to be related to Mosfets, so I guess also CMOS

    Questions:
    - What does "min 5V, typ 5.4V" mean? That its signal is minimal ±5v but typical (or on average) ±5.4v. Which could mean that possibly it is sometimes well above the ±5.4v and thus too high for the receiving device.
    - Assuming the first device can recognize ±3.3v as a valid 1 or 0 (I think most serial devices operating at ±5v do), could I connect the ±3.3v to the bus of the first device (without causing damage)?

    I hope I have made my problem clear and that someone has some answers for me, because this is out of my league and I wouldn't like to damage my equipment.

    Thanks in advance, Maarten
     
  2. Rleo6965

    Rleo6965

    585
    9
    Jan 22, 2012
    You can't directly connect rs232 signal and cmos level signal. rs232 signal have +12V and -12V while cmos was 0-+5V or higher. Even you use cmos w/ +12V signal level. It still can't accept -12V signal. That's the problem hardware side.

    For the software side. Both 2 device must have same protocol to be able to communicate properly.
     
  3. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Hi Maarten.

    To be able to communicate serially between two devices, you need compatibility on several levels. Obviously you need a matching protocol, baud rate and framing (number of data bits, stop bits, and parity), then you need electrical compatibility, which includes voltage, but also includes polarity (or inversion). A serial data line can be in two states; one of these is the "idle" state and is the state that's present when no data is being sent. It's also the state that represents a "1" data bit, and the stop bit. The "break" state is the opposite state. It is used for the start bit, and any "0" data bits.

    RS-232 uses the following levels:
    idle line state is negative voltage; usually between -3V and -12V;
    break state is positive voltage; usually between +3V and +12V.

    Normally, "logic levels" are:
    idle line state is "high", positive voltage; usually +3.3V or +5V;
    break state is "low", 0V.

    The words "the normal level is 5V" may be saying that this device uses an idle line voltage of 5V. In other words, it uses the conventional logic level voltages.

    A 5V-tolerant input will tolerate 5V but this doesn't tell us its actual voltage threshold. Most likely, a 3.3V signal will be enough to be considered a logic 'high" level.

    Assuming that the 3.3V CMOS levels also use the usual logic-level polarity, i.e. idle line = high, you will be able to connect the logic-level transmit data line from the second device to the receive data input of the first device.

    Even if the polarity is backwards, you won't damage the receiver, because the transmitter will only generate 0V and 3.3V logic levels.

    That refers to the voltage from the transmitters on the MAX3243. They will typically generate +/- 5.4V but is guaranteed to generate at least +/- 5V. This won't be an issue for you if you use the CMOS level output.

    The 3.3V CMOS output will not be +/- 3.3V. The levels will be 0V and 3.3V.
    If you have access to an oscilloscope, you can check that the CMOS transmitted data output from the second device is unipolar (doesn't go below 0V) before you connect it to the first device.

    Generally, serial data inputs are fairly well protected. As long as you don't connect 230VAC (or 110VAC) to them, it's hard to damage them. The worst that will happen is that it just won't work.

    Often, a serial interface needs flow control as well as data. Have you checked that you don't need any kind of flow control in this application?
     
  4. muffinman

    muffinman

    17
    0
    Dec 10, 2012
    Hello Kris,

    Thanks for your clear explanation, that's quite a help.

    I've hooked up both machines and figured I just try and see what happens. The serial output at ±5V works like a charm. However, the CMOS 3.3V does not work at all.

    Also I've tried to see how data in the opposite direction goes, thus from device 1 to 2. While the ±5V serial input receives data as expected, the CMOS input is distorted. Unfortunately I can not see in what way it is distorted as the data is in decimal my terminal shows it in ascii, which obviously is very hard to read (if at all).

    Question:
    - If device 1 were using CMOS levels, and I would send data from device 1 to device 2, using the ±5V input. Then device 2 shouldn't receive anything, right? If cmos levels doesn't go below 0V, the resulting output shouldn't be nothing but noise to a ±5V input, it will never register a binary 1. So can I conclude that it doesn't use CMOS levels?
    - If this is true, would the .4 difference in voltage level matter much. I suppose the risk involved is a personal matter, however, I have no experience to base the risk on.

    I do have access to a oscilloscope, but I have no clue on how to operate it. I did try it once, but that was not very successful.


    I've written the application (running on device 2) myself, so on the protocol and data send I have pretty much full control to accommodate device 1 (hifi amplifier). Though, just testing my updated version does seem to mix up something as the data send is not accepted, but that's a different (and solvable) problem.
     
  5. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    OK. This tells me that the receiver in device #1 expects RS-232 polarity/inversion, i.e. negative voltage or logic low = idle line, and positive voltage = break state. The CMOS output from device #2 will have the opposite polarity/inversion, i.e. idle high (you can check this with a voltmeter), so although the device #1 input is electrically compatible with CMOS (logic) voltage levels, it uses the opposite polarity/inversion.

    I doubt that the device #1 receiver will be damaged by negative voltage, so it should be safe to leave it connected to the RS-232 data output of device #2.

    So you can transfer data in the other direction (from device #1 to device #2) using the RS-232 data input on device #2?

    That makes sense. Although RS-232 is supposed to use positive and negative voltages, and the range between -3V and +3V is supposed to be "undefined", RS-232 receivers generally have their threshold between 0V and +3V, so they will regard 0V as equivalent to negative voltage, i.e. idle line. So they will usually work with 0V/5V (or even 0V/3.3V) voltage levels, as long as the polarity/inversion is right.

    Ah, I just answered that question. I think device #1 DOES use logic levels (0V/5V) and the RS-232 receiver in device #2 will accept that type of signal. You can measure the transmit data output from device #1 with a multimeter. I think you'll find it's 0V (or near to) when the device isn't transmitting.

    No, that's no problem. The 5.4V specification relates to the transmitters on device #2, doesn't it? It seems that device #1's interface is intended to be semi-compatible with RS-232 - it uses the same polarity/inversion, it just doesn't have the negative output voltage. As I explained, it will work with most RS-232 receivers. Since it seems to be designed to talk to an RS-232 device, it should also be tolerant to at least +/-12V on its receiver inputs. So I'm pretty confident it won't be damaged by +5.4V or -5.4V from the RS-232 transmitter in device #2.

    Oh, that's sad. It's a shame to see an oscilloscope that can't be used. They're such useful devices! But you can do some testing with a multimeter anyway.
     
    Last edited: Dec 10, 2012
  6. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Try typing "Oscilloscope tutorial" at youtube.

    Bob
     
  7. muffinman

    muffinman

    17
    0
    Dec 10, 2012
    I've tested it with a multimeter and all is indeed as you expected it to be. Device 1 is at near 0V and goes slightly up when sending data. Device 2 is at near 3.3V and goes slightly down as data is being send.

    Indeed it is. But as BobK suggested, a youtube course might solve that issue.

    Thanks for your help. I can't think of any new questions on this so I think its time to fix a nice permanent cable between the two devices instead of the loose and messy cables that connects them now.

    Kind regards, Maarten
     
  8. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    That's great!
    Yes, if you're doing any electronics experimentation at all, an oscilloscope is a fantastic aid to understanding what's going on. It's an essential piece of test/measurement equipment, second only to a multimeter.

    I'm glad you're interested in electronics. You certainly have the right kind of mind for it - analytical, observant, questioning. Best wishes, and good luck!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-