collapseos/doc/hw/acia.txt
Virgil Dupras 3581beace0 rc2014: de-buffer MC6850 and SIO drivers
The buffer's implementation wasn't buying us much in exchange for its
complexity. A modern machine was still too fast for it (copy/pasting
text from a modern machine would send bytes too fast for the RC2014)
and in the (theoretical so far) case of COS-to-COS communication, the
buffer didn't help in cases where the baud rate was faster than the
processing of each byte received (for example, if the byte was written
directly to EEPROM).

I'm scrapping it and, instead, use the RTS flag to signal the other
side when we're ready to receive a new byte.

Also, implement driver for channel B in SIO. I will need it to talk
to my TRS-80 4P.
2020-12-29 21:36:19 -05:00

31 lines
1.3 KiB
Plaintext

# Asynchronous Communications Interface Adapters
Machines talking to each other is generally useful and they
often use ACIA devices to do so. Collapse OS has drivers for
a few chips of this type and they all have a similar approach:
unbuffered communication using RTS/CTS handshaking as flow con-
trol.
The reason for being unbuffered is simplicity and RAM. The logic
to implement input buffering is non-trivial and, alone, doesn't
buy us much in terms of reliability: you still have to signal
the other side when your buffer is nearly full.
Because we don't really need speed, we adopt a one-byte-at-once
approach: The RTS flag is always high (signalling that it's not
ready for communication) *except* when calling the ACIA driver's
"read" word, which is blocking.
That "read" word will pull RTS low, wait for a byte, then pull
it high again.
This slows down communication, but it's simple and reliable.
Note that this doesn't help making communications with modern
systems (which are much faster than a typical Collapse OS
machine and have their buffer output faster than the RTS flag
can be raised) very much. We have to take extra care, when
communicating from modern system, not to send too much data too
fast. But for COS-to-COS communication, this simple system
works.