Mirror of CollapseOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.7KB

  1. # Asynchronous Communications Interface Adapters
  2. Machines talking to each other is generally useful and they
  3. often use ACIA devices to do so. Collapse OS has drivers for
  4. a few chips of this type and they all have a similar approach:
  5. unbuffered communication using RTS/CTS handshaking as flow con-
  6. trol.
  7. The reason for being unbuffered is simplicity and RAM. The logic
  8. to implement input buffering is non-trivial and, alone, doesn't
  9. buy us much in terms of reliability: you still have to signal
  10. the other side when your buffer is nearly full.
  11. Because we don't really need speed, we adopt a one-byte-at-once
  12. approach: The RTS flag is always high (signalling that it's not
  13. ready for communication) *except* when calling the ACIA driver's
  14. "read" word, which is blocking.
  15. That "read" word will pull RTS low, wait for a byte, then pull
  16. it high again.
  17. This slows down communication, but it's simple and reliable.
  18. Note that this doesn't help making communications with modern
  19. systems (which are much faster than a typical Collapse OS
  20. machine and have their buffer output faster than the RTS flag
  21. can be raised) very much. We have to take extra care, when
  22. communicating from modern system, not to send too much data too
  23. fast. But for COS-to-COS communication, this simple system
  24. works.
  25. # Broken hardware
  26. Some designs are broken with this scheme. For example, the
  27. RS2014 SIO module hard-wires CTS to GND because the FTDI
  28. connector doesn't have such a pin (modern computers can always
  29. handle the load).
  30. In these cases, a solution would be to use Break signals as a
  31. workaround, but I prefer avoiding complexity for now. So when
  32. you deal with broken design, you'll have to sidestep it either
  33. by implementing your own Break handling or by lowering com-
  34. munication speed.