Bugs/features of the Amstrad serial interface ============================================= These pertain to the "Amstrad RS232C Serial Interface (v1)". 1) If fewer than 5 arguments are given to |SETSIO, the receive datarate is set to the transmit datarate. Reason: Buggy comparison at &c2bc. Solution: Compare with 2, not 5. 2) If a |BLOW or |SUCK fails, garbage is output to the screen. Reason: The routine which closes the input and output streams and then prints a string at &c93c overlooks that closes corrupt HL. Solution: Print string (call &c21e) first. 3) Hardware handshaking doesn't work. Reason: The software permanently activates RTS to request to send data, activating DTR to request to receive data. Nowadays RTS is used to request to receive data (CTS is used to verify permission to send); DTR (and DSR) are not normally used. This means that although the interface obeys flow control when sending, flow control is not obeyed when receiving. Solution: Use RTS in the modern way (the code at &c4fe onwards needs tweaking). Note that DCD must be active to enable receiving (Z80-DART hardware feature). 4) Hardware handshaking still doesn't work. Reason: The 16550A SIO used in modern serial interfaces is buggy. It has a 16-octet transmit FIFO. Once it starts sending data from this FIFO (when it sees CTS become active), it doesn't stop until the FIFO is empty, even if CTS becomes inactive during this time. The code can't cope with 16 octets at 9600 bps, since the Z80-DART FIFO is only 3 octets deep. Solution: Drive the receive channel under interrupt. Or activate then deactivate RTS, and buffer received octets, waiting for them to stop arriving (the time to wait can be computed from the receive datarate and the number of data and framing bits). 5) Not a bug! Easter egg! |ROMCAT, -1 Mark RISON, mrison@hotmail.com, 1999-05-31