SERIAL CONNECTIONS ((third revision, July 1995)) How to connect almost everything -›by Mark J Swift and Simon N Goodwin. PART 1 - A tricky business? If you have ever tried to connect two pieces of hardware via a serial interface, you will know that things can get pretty tricky. The problem is compounded by the fact that no matter how many leads you have made up in the past, making a new one is like starting from scratch. With a little foreward planning however, making up a lead can be as simple as putting together a two-piece jigsaw... These articles explain in words and pictures how you can make cheap and reliable connections between many Sinclair computers, near relatives like the Thor XVI and SAM, and other common machines like Amiga, Atari ST, BBC Micro, Apple Mac, Amstrad PCW (with CPS add-on) and PC-compatibles. This part includes details for SAM, Interface 1, IBM PCs and clones, BBC Micro and many printers and plotters. The second part includes details for QL, Spectrum 128, Apple Macintosh and the S5/8 standard. The JIGSAW solution Each of the accompanying diagrams is drawn as a single piece of a two-piece jigsaw. To discover the cable connections required to connect two machines, simply take the relevant pieces - and snap them together! Other variations Not all the machines have their own picture - for instance, ST, Amiga and Amstrad PCWs all use the same 'standard' 25 pin connection. This was the old RS-232 'standard', used on old PCs, TRS-80s and many terminals. This fell out of favour because of the bulky connector with a large number of unused pins, sometimes assigned to conflicting 'extra' signals, and rather confusing names for the signals. Some 'AT' PCs and add-on serial boards for various micros replace the 25 way connector with a nine pin connector wired as for the SAM, but with the addition of DSR on pin 6 and a small voltage, usually between 5 and 9 volts, on pin 7. This is nominally RTS, but finds its most common use providing power for a serial mouse! You can connect a PC mouse to SAM's Communications interface if you supply +5V on this pin, but you need to poll the serial port about every 7 mS or characters get lost, and this makes it inpractical for use with many SAM programs. Making your own pieces If you have a machine that is not featured here then you will need to make up a jigsaw piece of your own. You should be looking for which lines are DATA and which lines are HANDSHAKE. You should also take note of the GROUND line and whether the signal lines are INPUT or OUTPUT. It is wise to leave power connections, usually marked +5V or similar, well alone, as these are not needed for serial communications between computers and are most likely to cause damage if wrongly connected. If your machine does not match any listed here - and many with 9 pin or 25 pin D connectors correspond to the SAM and DTE diagrams - you need to copy the diagram from one of these machines and replace the signal lines with corresponding ones for the new machine. In the manufacturers notes, the machine will be described as either DTE or DCE, and this will determine whether a line is input or output. DTE devices 'Data Terminal Equipment' is generally intellegent equipment such as Computers, Terminals and Printers. There should be at least FIVE signal lines as follows: TxD (output) / CTS (input) / GND / RxD (input) / DTR (output) Note that both SAM and Spectrum Interface 1 are DTE devices, but SAM requires a female connector and the Interface 1 expects a male plug. DCE devices 'Data Communication Equipment' is generally dumb equipment such as modems, but the second QL serial port SER2 falls into this category. The signal names are taken from the intelligent end, so you will find for example that the Transmit Data (TxD) line is actually an input! This was one of the most confusing aspects of the original RS-232 serial standard. Again there will be at least FIVE signal lines as following: TxD (input) / CTS (output) / GND / RxD (output) / DTR (input) Further information This article is based on graphics and text released as part of the Amiga Qdos Emulator, so you can find machine readable files of the diagrams - in monochrome packed IFF format - on the Amiga Qdos 3.20 SOURCE disk, in the sub-directory SerialConnections. The authors would bve interested to hear of details for third-party Spectrum serial interfaces such as the Swift Disc, Rotronics Wafadrive, and any others that may be in your collection. Please send details, care of the Editor, so that we can prepare graphics for these as well. Next issue we shall cover the serial ports on Apple Macs and the remaining Sinclair machines, and a cheap way to link lots of machines serially. M.J.SWIFT April 1993, extended by Simon N Goodwin 1994-1995. ************************************************************************* SERIAL CONNECTIONS How to connect almost everything -›by Mark J Swift and Simon N Goodwin. PART 2 - MAKING A STANDARD This is the second part of our all-purpose plug-and-play guide to micro serial connections. The accompanying diagrams are intended to be fitted together or onto the ones printed last issue, to identify the plugs and connections to link any pair of machines. Last issue we covered ST, Amiga, PC, QL, ZX Interface 1 and SAM, plus TRS-80, Amstrad PCW, and other systems with optional 25-pin serial ports. In a rare moment of standardisation, Sinclair used the same connector and pinout for the Spectrum 128K and QL SER1. We have successfully used cables and serial-to-parallel converters made for the QL with original 128K and Plus Three Spectrums. Note that the QL's SER2 port is differently wired - it uses the DCE standard rather than DTE, as explained in Part 1.. The CST Thor 1 and Thor 20 were built around Sinclair QL circuit boards, so they have the same SER1 and SER2 connections as a 'real' QL. The CST/Dansoft Thor XVI uses the S5/8 standard, like some micros made by Philips. This may seem an obscure choice, but it's well thought out and an ideal way to link a mixture of machines. Too many cables? The jigsaw solution introduced last issue eases the problem of making cables, but there is another problem. As you acquire more and more machinery, you will need more and more cables - to the point where you could literally be lost in cables. For example if it is necessary to be able to connect any machine to any other then: with 2 machines - 1 cable is required with 3 machines - 2+1 = 3 cables are required with 4 machines - 3+2+1 = 6 cables with 5 machines - 4+3+2+1 = 10 cables with n machines - (n-1)+(n-2)+...+2+1 = n(n-1)/2 cables So you'd need 28 separate cables to link all the machines covered in these articles! There must be a better way, and emulator enthusiast Mark J Swift has found it. The ideal solution if you have lots of machines is to standardize the serial connector on each machine by fitting an adaptor, and then to use a SINGLE cable to connect between machines. The S5/8 Standard The S5/8 standard for serial connections came out of a Government study in the eighties. The S5/8 standard is based on an eight pole DIN connector and specifies nine signals as follows: 1 - DINP data input 3 - DOUT data output 4 - HINP handshake input 5 - HOUT handshake output 6 - SINP subsidiary input 7 - SOUT subsidiary output 8 - V+ power supply 2 - GND signal ground (common) SHIELD - EARTH earth A device containing an S5/8 connector should contain a socket, and each device is connected to another with a simple cross-over cable. Of the eight signal lines only 5 are necessary (hence the name S5/8 - five lines from eight), these lines are: 1 - DINP data input 3 - DOUT data output 4 - HINP handshake input 5 - HOUT handshake output 2 - GND signal ground (common) Handshaking The handshake lines are optional controls, used to temporarily pause the flow of data to make sure that none gets lost at high speeds. If these are not available you can usually ask your system to use 'software handshaking', sending special flow-control characters, often known as XON and XOFF, but this is less reliable and no good at all for binary data like program code, where the reserved control characters might appear anywhere. There are two versions of the S5/* cable diagram, for hardware and software handshaking. Another advantage of standardising on S5/8 is that you can swap any link from one type to the other by replacing the single S5/8 cable in the middle. Making an S5/8 adaptor This article is accompanied by a set of 'jigsaw' diagrams for various computers. To find the cable connections required to convert one of the serial definitions into S5/8, simply snap this 'jigsaw' piece into place underneath the 'jigsaw' piece for the relevant hardware. This will standardize the hardware to be S5/8. The simple cable required to connect two S5/8 devices has its own diagram. You can use this cable to link two Thor XVI computers, as the serial ports on that machine use the S5/8 standard. Less cables - less hassle Now if it is necessary to be able to connect any machine to any other, you will need to make up the following leads: with 2 machines - 2 adaptors + 1 cable with 3 machines - 3 adaptors + 1 cable with 4 machines - 4 adaptors + 1 cable with 5 machines - 5 adaptors + 1 cable ... with n machines - n adaptors + 1 cable As you can see, the number of cables required no longer increases exponentially. With just four cables you can connect all three Sinclair serial ports, PC-ATs, SAM and Thors. Add one more (DTE to S5/8) and you can include Amigas, PC-XTs, Atari STs, Amstrad PCWs and TRS-80s in your collection - probably enough to start up a data-transfer agency! Other aspects These articles have concentrated on hardware connections and skipped over software. You should make sure that both ends of the link are using the same speed and data size. Most machines default to 9600 baud and 8 data bits, with one or two stop bits. Extra stop bits do no harm. You may need to reduce the rate (at both ends) for flakey interfaces - particularly if you are not using hardware handshaking or transmitting to a Sinclair machine. Many links can work at 1200 baud or lower speeds with no need for handshaking. If you're hungry for further reading, check out the August 1986 issue of Electronics & Wireless World, for an article entitled 'S5/8 the technical details' by Andrew Hardie. This was the inspiration for our 'standard cable' system. While we cannot sort out your serial communications problems on an individual basis, these articles should at least ensure that you get the connections right. If you run into configuration problems you should consider writing a letter to the editor - it's quite likely that one of the other readers has encountered your problem and found a way round it. If you do write in, be sure to include full details of the software configuration commands and menu selections that you've tried at each end of the link. Good luck, and happy handshaking! M.J.SWIFT April 1993, extended by Simon N Goodwin 1994-1995.