Bug update

This bug is now officially driving me nuts.  Just to review, for several years I have been working on building a lightning detector to shutdown my computer network during a storm when I am away from home. I learned a lot and have a pretty neat system. A few days ago, I went to solve what I figured was going to be a simple logic problem in the micro that runs the detector. The micro is an MSP430F2012. It does not have a UART, so I have been bit banging the output using TimerA. On my scope the timing for the serial train is dead nuts at 9600 baud. The level conversion from 3.3V is being done by Sparkfun level converters (http://www.sparkfun.com/products/133)
When I connect my detector to a laptop with a USB to RS-232 adapter without any extra cabling, the detector works fine. A Python program on the PC logs all the bytes sent and they all match what they should be.

If I add in 30 feet of cable it still works fine.

If I connect it to a much faster desktop PC running Fedora Core 12, running the same Python program using the exact same (30′) cabling, most 0x05 bytes get logged as 0x00. Many other bytes seem to get logged just fine. The results are the same if I use the USB-RS232 converter or a native RS-232 port on the PC.

So what was going to be a simple fix has turned into a three day marathon of making cables, moving computer, and a gazillion other tests. I am now at a loss.

At first I figured that the cabling I had to the desktop must have been poor or running past an EMI source. I have discounted that by using the same cables in the same path.

I figured that the baud rate was off a bit and would work on one machine but not the other. But this seems very unlikely as the same USB-RS232 converter (that would be sensitive to a baud rate problem) on different machines behaves differently. The problem is following the Linux PC not the Windows laptop.

I also figured that perhaps the Sparkfun level converters did not have enough drive for a long-ish cable. But the system works with the same 30 feet on the laptop.

So I am down the a problem on the Linux box. A quick search on the web for RS-232 issues on Linux Fedora Core 12 has drawn a blank. This same box drives a DVD burning robot over RS-232 at the same baud rate and I have never had a hipcup from it.

Tried a third computer (desktop Windows with same converter as the other computers) and it demonstrated the 0x5 bytes converted to 0x00. So what is magical about my old beater laptop? What is magical about 0x05 other than alternating bits? Tomorrow I will bring home an RS-232 serial protocol analyzer that may shed some light on this. I had hoped to solve this tonight as tomorrow we are due for a line of thunderstorms I could have finalized my testing on.

Any ideas for further tests?

This post is the subject of  a Forum post at: http://forum.sparkfun.com/viewtopic.php?f=14&t=29606
This entry was posted in Lightning detector, Projects. Bookmark the permalink.