Subject: Re: Serial corruption when cable is unplugged and then plugged back in
To: Bruce Martin <brucem@cat.co.za>
From: Jukka Marin <jmarin@pyy.jmp.fi>
List: port-i386
Date: 07/27/2000 19:18:12
On Thu, Jul 27, 2000 at 04:10:06PM +0200, Bruce Martin wrote:
> We have a piece of hardware that continuously outputs a 5 letter string
> (e.g. "ABCDEABCDEABCDE...") at 9600 8N1 asynchronous, with no flow control
> at all, just a Tx and GND pin. When I connect the board up to a serial port
> on NetBSD/i386 and run "minicom", it prints out "ABCDEABCDEABCDE..." as one
> would expect. However, if I unplug the connector and then plug it back in
> again, sometimes the information becomes corrupt: sometimes it transmits
> "&&&&&&&&&&&&&", sometimes ".~.~.~.~" and sometimes it prints a few "e e ee
> eee e e" and then just stops receiving totally.
> 
> I have tried the test with the board connected at the same time to
> NetBSD/i386 running "minicom" and "that other O/S" ;) running
> "HyperTerminal" - when I pull out the serial cable and replace it,
> HyperTerminal continues receiving the correct info all the time, while
> minicom get corrupt or stops receiving at all.

I can't tell why this would depend on the terminal software or OS, but
if the hardware is transmitting bytes end-to-end (no gaps in between),
the receiving UART can definately get lost and not detect the real start
bit of the bytes, but misinterpret a data bit for a start bit and after
that, if the data is "suitable", stay unsynchronized all the time.

If you can, try adding at least one character time of idle in the incoming
data and if I'm correct, the data will then be received correctly (after
the idle period).

  -jm