Shop OBEX P1 Docs P2 Docs Learn Events
VGA "wavy-ness" when connecting ground from RS232... — Parallax Forums

VGA "wavy-ness" when connecting ground from RS232...

DToolanDToolan Posts: 11
edited 2011-08-13 02:47 in Propeller 1
I am working on a text mode VGA display project connecting some computers to a prop through MAX232 level shifters. The VGA is connected to an LCD display. While initially writing the code and debugging, I was using a laptop as the RS232 source (sending RS232 streams captured from the intended host).

After getting everything working, I plugged in the actual host RS232 cables and it caused the VGA display to produce wavy vertical pixels (wavy vertical lines through some text) in various places. It is not terrible but is noticeable. If I disconnect the RS232 ground pins coming from the host, the VGA vertical wavy-ness goes away. The RS232 still works but I don't see this as a solution. I know that for reliable RS232 communication, RX, TX and the reference communication ground should be connected between the two devices. The RS232 cable distance is perhaps 20 ~ 30 feet and the prop is powered via wall wart.

Any suggestions?

Comments

  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-08-12 14:08
    When you say that the gound connection has been disconnected did you mean the Pin 5 connection or the shield/shell connection of the lead? The Pin 5 connection is for signal path but the shielding is just that, and should only reqires connection at one end. It sound as if you have got some form of ground/earth loop going (I get one from my usual PSU (9 V SM with earth connection passed through) so that when I have the RS232 connected my 'scope being switched on or off does a reset to the Prop.

    Some VGA cables are very poorly constructed internally an are nothing more than a multicore with an overall shield. Any ground currents would transfer to the core easier on these.
  • DToolanDToolan Posts: 11
    edited 2011-08-12 14:36
    Yes, I mean the Pin 5 (on a DB9 or Pin 7 on a DB25) ground. The RS232 cables do not utilize any shielding.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2011-08-12 16:19
    "Ground loops" are where you can trace some sort of circular path with the grounds. An example might be a RS232 ground wire, and a ground wire from say, the download cable to a propeller chip.

    I learned about ground loops when I was a teenager playing around with audio amplifiers - they are really obvious because you suddenly get a loud hum when you plug one device in. A quick and dirty solution is to remove all but one ground link, but then you have to remember which cables have ground connected and which don't.

    Another solution is to use a "star" configuration where all grounds come to a common central point.

    I'd be interested to know if the wavyness goes away if you disconnect the prop download cable. That will test if it is a ground loop problem or not.

    If that does not solve the problem then we need to think more about it. RS232 per se should not cause wavyness if there is no data flowing.

    There are other causes for wavyness too - I get it with two VGA monitors side by side, but they are old-school CRT monitors.

    There is always an opto-isoloated solution, but it will involve some more components and soldering and probably is not necessary.

    A 30 foot cable is fairly long and will start acting as an antenna, picking up hum from mains wiring in the house. If this is the problem there are solutions but they are different to the ground loop solutions.

    And another problem I once saw was a preamp my dad built that was powered by a wallwart with a long lead. There was all sorts of hum until my dad added some fancy filtering as the DC came out of the wallwart. If I recall it was some inductors and capacitors as well as some ferrites. It worked really well because it was designed by some electrical engineers at the local university.

    Could you post a photo of your setup by any chance?
  • DToolanDToolan Posts: 11
    edited 2011-08-12 17:26
    It is a standard Prop USB Proto board. It doesn't matter if the USB download cable is connected to the board or not. The VGA cable has molded clamshell EMI filters at both ends. In the pic, I have the ground pin removed from the RS232 connections. The remaining connected pins are RX, TX and DSR.

    RS232-VGA.jpg
    800 x 600 - 281K
  • edited 2011-08-12 18:06
    DToolan wrote: »
    Any suggestions?

    Are you willing to experiment?

    I read that ferrite beads are a power supply filter. Some need to be carefully selected. Why don't you try one or two with your circuit and watch how it behaves. Other than that, try a capacitor.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2011-08-12 19:08
    I gather that your laptop is plugged into the mains? Try running on batteries. You will find that standard mains switch-mode supplies are rather nasty when it comes to grounds, you know how the end of the DC plug can "bite you", there is some leakage current present there. But just try that, troubleshooting is all about making any assumptions and eliminating variables such as running on batteries, etc.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2011-08-13 01:37
    A long time back when processors were less greedy most of the laptop supplies were just two wire mains input and the laptop remained mostly isolated from the mains and its earth. Then safety and power greed raised their heads and the PSUs has three pin mains plugs fitted this was the start of a lot of loops on presentation systems, audio and VGA. Some times those ferrite chokes can help, bu only for higher frequency problems

    As Peter says the identification of this is easy as the PSU just has to be disconnected and the change in the interference observed, or not.

    There is that possibility that you are within range of some interference source, such as a MF transmitter etc, and the cable lenths have just happened to be some magic length that allows that to be picked up. Shortening or lengthening the lenths would show this. I had a local church that complained of Sky News coming out of its simple PA system. It turned out to be a LW transmitter about 15 miles away that used Sky as its news source (not the searing radiation from a satellite as the Vicar thought). That problem could only be got around by adding another 10 yards of mains lead into the PA supply, nothing else touched it!
  • RaymanRayman Posts: 14,349
    edited 2011-08-13 02:47
    I would double-check your solder job on the VGA connector... It's fairly easy to not get some of the vga pins not soldered good enough.
    I must admit that one time I had a similar strange VGA issue and this turned out to be the problem...
Sign In or Register to comment.