PC serial port problem

David J. Bryant djb at cbterra.ATT.COM
Fri Apr 29 03:57:44 AEST 1988


Anybody out there knowledgeable in the ways and secrets of PC serial
ports?  In particular, with AT&T PC serial ports??  I'm working on a
custom terminal emulator and am having problems I can only figure are
associated with the serial port hardware.

According to my experiments, the problem occurs when the 8250 tries
to send a character out at the same time it receives a character.
The most common trouble situation arises when the host is sending down
a long stream of text.  Eventually the receive buffer fills above
the high-water mark and the software instructs the serial port to transmit 
an XOFF.  Most of the time the XOFF gets out o.k. and flow control is 
successful.  At some point, however, the XOFF gets out but everything seems 
to hang.  My terminal emulator software can drain the buffer and request
an XON be sent, but the transmitter is unresponsive.  I end up with a
wedged condition that can only be cleared by drastic action such as forcibly
resetting the serial port hardware.

The same problem can be produced if you type rapidly while the PC/terminal
is receiving characters from the host.  Sooner or later you somehow lock up
the COM port and have to destructively reset things. 

I've tried disabling interrupts to guard against them piling up, and have
been through my code a zillion times.  The intermittent nature of the problem
and the inability to get software modifications to change or eliminate the
behviour have led me to suspect the hardware.  (I know, I know, that's the
typical software person's first whining act of finger-pointing, but I think I'm
pointing in the right direction here.)

Lowering the baud rate makes the problem appear less frequently.  Raising
the clock rate of the CPU makes it happen more often.  (A slow PC (e.g. the
6300) at 4800 baud never seems to have the problem at all.  A fast PC
such as the 6300+ at 9600 baud has it all the time.)

Any PC serial port wizards out there?  Anybody had this problem with other
similar applications?  Does anybody know how the 8250 *really* works? 

	David Bryant
	AT&T Bell Laboratories
	Columbus, Ohio
	614/860-4516
	cbosgd!djb



More information about the Comp.sys.att mailing list