[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Read full 8-bit character from serial port?
Jorge Chamorro Bieling <bieling@terra.es> wrote:
> David Empson <dempson@actrix.gen.nz> wrote:
>
> >
> > It should also be noted that direct access to the SCC doesn't give you
> > any buffering
>
> Why not? the scc itself has an rx buffer (8 bytes deep IIRC).
The standard Z8530 SCC has a 3 byte rx buffer. The ESCC (Z85230) has an
8 byte buffer.
Assuming 9600 bps with 8-n-1 data, if you aren't using interrupts, you
will have to poll the SCC at least once every 3 milliseconds (on
average) to avoid losing characters, and if you are polling it less
often than once every millisecond, you may have to receive several
characters in a loop to avoid running out of buffer space.
The IIgs serial firmware receive buffer (interrupt driven) allows a lot
more bursty behaviour when reading from the serial port, e.g. going off
and doing something for a few hundred milliseconds without paying
attention to the serial port, as long as you catch up again afterwards.
> > so you have to poll it often enough to avoid losing
> > receive characters.
>
> Of course. As whenever you're polling ?
--
David Empson
dempson@actrix.gen.nz