Skip to Content

The Serial Port

Hardware Connections


Z88 9 Way D Type

(Male)

Printer

25 Way D Type (Male)

1Unswitched +5v at 10 uAoutput
2TXTransmit dataoutput3RX
3RXReceive datainput2TX
4RTSReady to sendoutput5CTS
5CTSClear to sendinput20DTR
6Reserved for future use
7GNDSignal ground7GND
8DCDData carrier detectinput20DTR
9DTRData terminal readyoutput6,8DSR, DCD

DTR is high when the Z88 is awake. The Z88 is always awake when the screen is active. Even if the Z88 is asleep, it will wake every minute or so to carry out various housekeeping tasks (checking the alarms, for example). At these times, DTR will go high.

Pin 1 can be used to indicate that power is available to the Z88.

You can use the PANEL (□S) to set up the parameters of the serial port (speed, parity, etc).

Flow Control

Output from and input to the serial port can be controlled either by software or hardware. The hardware handshaking is always active, so if you only want to use software handshaking, you will need to wire a cable to set the handshaking lines high at all times. You can do this by connecting pins 5, 8 and 9 together on the Z88 9-pin connector.

Output

An external device (printer, modem, etc) can ask the Z88 to stop sending by either bringing the CTS line (pin 5) low or sending an XOFF (CHR$(19)) character to the Z88.

There is potentially a slight delay when using software handshaking. Transmission will stop only after the XOFF character has been recognised and, since the Z88 has an input buffer, this can only happen after previously received characters have been processed. With hardware flow control, transmission stops at the end of the next character.

Transmission is resumed when an XON (CHR$(17)) character is received or the CTS line is brought high.

The output buffer is around 95 bytes long.

Input

If software flow control is used, the Z88 will send XOFF to an external device once the receive buffer is more than half full. Characters will continue to be received until there are only 15 spaces left in the buffer. At this point, an XOFF character will be sent for every character subsequently sent by the external device. If the receive buffer overflows, then the received data is lost. The Z88 will send the XON character when the receive buffer has been cleared to less than half full.

If hardware flow control is used, the Z88 will bring RTS low when the receive buffer becomes more than half full and bring RTS high when the receive buffer is less than a quarter full.

The input buffer is around 127 bytes long.

Last updated on