Problems with RS232 ports

Discussion in 'C-Bus Wired Hardware' started by dibble, Aug 28, 2011.

  1. dibble

    dibble

    Joined:
    Jan 26, 2011
    Messages:
    6
    Likes Received:
    2
    Location:
    UK
    Hi all,

    I'm having issues with the RS232 ports on a PAC unit and thought I would share my experiences and ask a couple of questions.

    This issue has been ongoing for a week or so and the testing I have carried out is fairly extensive, so please bear with me...

    I am working on an installation where a PAC will control a PA system. I understand the protocol to be used and have written code that executes flawlessly on the simulator that gives correct behaviour when connected to the PA. So far so good!

    However, when I come to transfer the code to a PAC I hit problems. No matter what I do I cannot not get the unit to send out data over the RS232 line.

    I quickly moved to testing the PAC with a PC, rather than with the PA. The PAC receives data OK over the line (and behaves as expected in response to that data), but I never see any return data (which should definitely be being sent as verified in the simulator).

    I have read the documentation thoroughly and understand that either a separate 24V AC supply is required, or the RTS/DTR lines can be oppositely biased. Initially I was using the RTS/DTR lines. This certainly appears to work, as the PAC receives data (although I actually now suspect that power is the issue - see below).

    Initially I suspected that my serial cable was wired incorrectly. However, I verified this pin-to-pin and am 100% sure it is correct and electrically sound. (Even going so far as to rig up a reverse test cable with a Cat5 socket to simulate the PAC using another PC).

    I then suspected some flaw in the code, so simplified it to a single 'writeserial' on each loop iteration. Again, in the simulator this works as expected and again on the unit is does not work.

    I then suspected that the RTS/DTR lines where not providing sufficient power to the unit to generate RS232 compliant output voltages and so connected a 24VAC power supply. I still saw the same behaviour: able to receive OK, but not able to send data.

    I then suspected that I had a faulty unit and so began experimenting with a second brand new PAC. Again, I started by powering the unit from the RTS/DTR lines (confirming the voltages on a meter) and again saw the same behaviour.

    At this point I began to wonder if the unit was in fact sending data, but that the signal levels where below thresholds and so broke out my oscilloscope. This confirmed that hypothosis - the unit is generating a signal, but at much reduced signal levels - only -3V to +0.8V, well outside the RS232 specification, which explains why I am unable to receive data on a connected terminal device.

    I then went back to the first unit to test in the same way and in fact saw no signal at all. My supposition is that either the unit was shipped faulty or that the transmit circuitry was damaged when I connected the 24VAC supply. I went back and checked that PSU and it is giving an output of about 27V RMS - slightly above the stated voltage.

    I am obviously somewhat hesitant to connect this PSU to the new PAC for fear of damaging it.

    My questions then are as below:

    1) What is the required input voltage on the RTS/DTR lines to give correct behviour? I am seeing approx -9V and + 9V...

    2) What is the actual limit on the input voltage for the 24V connection? Would 27V damage the PAC (and specifically just damage the transmit side of the serial circuitry)?

    3) Is there any current limiting circuitry on the 24V input? The PSU I am using is rated to 3.5Amps - way over the stated 30mA nominal current draw. Presumably the unit would not pull more current than it is rated for ? (Although I saw a post saying these units were easily damaged by short circuits on the serial side?)

    4) Is there a known good 24VAC PSU? A DIN mounted unit would be preferable as I am trying to keep everything in a single board and having an external plug style PSU would not be ideal (and may give issues from a building regulations point of view, as my reading is that all cabling that enters a board in which there are mains voltages should have insulation rated to mains voltage, which a simple wall plug-style power adapter may not have)....

    One separate observation as well, if I may. I understand the unit uses a separate power supply as it is internally optically isolated. However, 24VAC PSUs seem to be fairly difficult to obtain, particularly in a DIN form at anything like appropriate current ratings, and it is a unique power requirement, not shared with any other CBus kit, meaning more PSUs in a board...

    I wonder if there is any reason that some form of 5V powered RS232 driver IC is not used to drive the serial lines instead? Something like the Maxim Max220 family could be used which only require a single 5V supply and generate the -13V/+13V voltages using an internal charge pump. This could be coupled with a simple voltage regulator and then accept any voltage say 5V - 12V, making it compatible with other CBUS devices that are not bus powered.

    Just a thought!

    Thanks for any input - as ever the community's help is much appreciated.

    Kind regards

    Jon
     
    dibble, Aug 28, 2011
    #1
    Barry24 likes this.
  2. dibble

    Ingo

    Joined:
    Dec 2, 2006
    Messages:
    290
    Likes Received:
    1
    Location:
    South Africa
    Ingo, Aug 28, 2011
    #2
  3. dibble

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    I had a PAC driving an LG Plasma TV at one stage and the TV had a zener diode across the input so that RS232 signal going into the TV was constrained to +5V/-0.7V (or something like that). Essentially it was short circuiting the signal in one polarity. This is in violation of the RS232 standard which requires an input impedance of 3k to 7k and could damage the PAC.

    I wonder whether you have damaged your PAC(s) with something like that.

    That should be OK.

    I can't answer the other questions without a PAC circuit diagram. I will get back to you...
     
    Darren, Aug 28, 2011
    #3
  4. dibble

    dibble

    Joined:
    Jan 26, 2011
    Messages:
    6
    Likes Received:
    2
    Location:
    UK
    Reply

    Hi again,

    Thanks for the feedback.

    I think it is entirely possible that the PAC unit that is giving no output at all has seen a short circuit, although my understanding of the RS232 spec is that all lines should be able to withstand an indefinite short circuit, either to ground or to VCC... However, it's a while since I properly looked at the spec!

    However, the other unit on which I am seeing the reduced signal levels definitely hasn't. It has only been connected to a PC port via a breakout board. (I am scoping the signal levels from the breakout)

    Is the PAC circuit diagram in the public domain?

    Thanks and kind regards

    Jon
     
    dibble, Aug 28, 2011
    #4
  5. dibble

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    No.
     
    ashleigh, Aug 28, 2011
    #5
  6. dibble

    dibble

    Joined:
    Jan 26, 2011
    Messages:
    6
    Likes Received:
    2
    Location:
    UK
    Resolution

    Hi folks,

    Just a quick note to say that I finally fixed this problem. After replacing the PSU with a 50mA 24V A/C unit I was seeing improved signal levels, but still outside the RS232 spec. The positive voltage was circa 0.5V when the port was connected to the receiving DTE, which the DTE treated as invalid. Interestingly I was seeing correct voltages when the PACA was not connected to the DTE, which lead me to the conclusion that the PACA could not source enough current (I tried multiple DTE units, and confirmed that they were providing a compliant peak load, so goodness knows why the PACA was not able to source sufficient current to maintain voltage). I then introduced a RS232 repeater unit (http://www.datalinkcom.net/rs232_converters/dl-232lb9r.htm) and that was finally enough to give compliant signal levels to the DTE and to give me two-way communication... It all feels a bit like overkill, but it works and seems stable.

    Thanks to the community for previous help

    Kind regards

    Jon
     
    dibble, Oct 28, 2011
    #6
    Barry24 likes this.
  7. dibble

    Barry24

    Joined:
    Mar 3, 2012
    Messages:
    14
    Likes Received:
    0
    Location:
    Auckland, NZ
    Thanks Jon for your detailed write-up and explanations.
    I have recently installed a RS485 bridge to control some Dooya blind motors and was having a very similar experience - the receive/feedback from the bridge was coming into the PAC, but nothing was being transmitted (that I could see) from the PAC. However when running in PICED via the PC COM port (USB to RS232 cable), it was transmitting fine.
    Thanks to your thread I started rechecking the different components including the RS232-RS485 converter. I swapped this out with a "better" DTech converter, and hey presto - it is now working.
     
    Barry24, Jun 12, 2021
    #7
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.