From: dan@caofao.meca.polymtl.ca (Daniel Gour)
Subject: Re: 16550 uart chips question
Keywords: chip
Organization: Ecole Polytechnique de Montreal, Genie Mecanique
Date: Fri, 4 Sep 1992 00:58:05 GMT

In article <baloo.715548805@mik.uky.edu> baloo@mik.uky.edu (kevin s coupal) writes:
>
>  I have been considering buying a new serial card for my computer.
>  I have a 14.4 modem and run a multitasker.  I sometimes lose 
>  characters when downloading.  Wil this chip really stop that?
>
>Kevin

    Hello.  It would surely help, but you're not giving enough details
for a clear cut answer.  The kind of questions that would need to be
answered are:
- What's the communication package (does it uses interrupts?)
- Do you know if it's just a character here and there, or is
  it big losses?
- What's the communication package (does it uses interrupts?)
- What's the multitasker?
- What are the settings of the multitasker?
- Under what condition does it happens (always, when task in background)?


   I will suppose that your comm package uses interrupts, cause at
14.4 cps characters get here real quick, and if you're running a
program that does not use interrupts, if the multitasker takes away
the CPU for more than 0.2 ms, you will lose a few characters.
DesqView, for example, works in slices of 55 ms (!).  I don't know
what Windows uses, but it sure ain't god of speed either... (ok,
less opinion, more facts...:-).

   Now, with interrupts, your software still has to respond to 14 400
interrupts every second.  If it misses one, you just lost a character.
What the 16550 has is a buffer that can go up to 16 bytes (maybe a
little less in "real world", not sure).  That means that your software
can miss a few interrupts and not loose any character.  Now, your
software must enable those buffer, cause on power-up, these chips
simply emulate perfectly an 8250.  But most good software either do
it automatically or have an option to enable or not 16550 buffers if
those chips are detected.

   Another thing that you must check are your multitasker settings and
the buffer size of your comm program.  The interrupt routine of the
comm software usually just puts the characters in the buffer of the
software and the transfer to disk is done when the buffer starts to get
full.  If the multitasker takes away the CPU from the comm program too
long, then the software buffer may overflow.  DesqView, for example,
comes with the default of 9 ticks for foreground task and 3 ticks for
each background task (If I remember correctly), each tick being
1/18 of a second.  So your comm program may loose the CPU for half a
second, during which 7200 characters will come in the serial port.
Is your buffer big enough?  I don't think so.  Most comm buffers are
one or two Kilobytes, sometimes four.  What you should do is make
sure that your task gets enough CPU in background.

   I run a bbs with two 9600 cps modems, and I sometimes have six
tasks running.  My Desqview settings are 1 for foreground and 1 for
background, so each task should not loose the CPU for more than
5/18 of a second, during which not more than 3200 chars should
come in (v.42bis accounted for), and my comm buffers are 4K in size.

   So that about wraps things up, sorry for the long reply, but
your question wasn't very specific, I wanted to give you enough
information so that you can create your own answer by knowing how
it works inside...

   A side note:  What you really want is a 16550A.  The designation
                 16550 is the original version, and was a bit buggy.
                 You should not be able to find any 16550 on the
                 market, so don't worry too much about that. (I'm
                 95% sure of this note.  Assume correct unless
                 somebody is sure I am wrong and corrects me..)

Dan.

-- 
----------
dan@caofao.meca.polymtl.ca            The KISS principle:  Keep It Simple .Sig