8-Bit Software Online Conversion

      Part 1 by Steven Flintham (15A) Introduction Judging by some of the comments in issue 32, it seems that there is some confusion about how to link two computers together. The easiest way of doing this is to use their serial or RS423 ports. This is also probably the best way, apart from using an Econet which would be considerably more expensive. The link consists of two parts - the hardware and the software. Note that this article assumes that both machines are Acorn computers - in principle, almost any two machines equipped with RS423 or RS232 ports can be linked, but this introduces extra complications and also reduces the flexibility of the link. The hardware The hardware is very simple in principle, consisting of a lead which connects to the socket labelled RS423 on the back of each computer. The lead has to transmit several signals between the two computers, the exact number depending on the nature of the link. The simplest two-way serial link requires only three wires - one for data travelling in each direction and one (called the ground or earth) to complete the electrical circuit. However, a full RS423 link also provides two extra wires to allow the two computers to control the flow of data. This process is called handshaking and although it can be implemented by sending special signals over the data connection, it is more convienient to provide separate connections. There is the additional advantage that the operating system used by Acorn computers will handle this form of handshaking automatically, while handshaking over the data connections would require extra programming. If this doesn't make sense, don't worry. You do not need to understand how the link works to make the cable (or buy one) and once the cable has been connected between the computers the operating system takes care of all the intricate details. The link will therefore need a cable with at least five wires and of sufficient length to reach between the two computers. I have used around 20m of 6-core telephone cable to link my Archimedes and Master together and it seems to work fine. Almost any cable will do, provided it contains sufficient wires. If you plan to use telephone cable, note that most telephone cable sold for home use has only four wires and is therefore not suitable. The cable can be almost any length, although if it is extremely long (50m or more, say) then you may encounter problems. In addition to the cable you will need two plugs, one for each end of the cable. To be precise, you need two 5-pin C DIN plugs. There are three different 5-pin DIN plugs and only type C (also referred to as domino or 360 degree) will work, so be careful not to get the wrong sort. If they are not labelled, you can recognise them by the pattern of the pins, which is: * * * * * Now for the worst bit - soldering the plugs onto the cable. If you consult your User Guide (or Welcome Guide for Master owners) you will find a diagram of the RS423 port somewhere in the appendices. You should wire the lead as follows: Connect a wire between the CTS pin at one end and the RTS pin at the other Connect a wire between the RTS pin at one end to the CTS pin at the other Connect a wire between 'data in' pin at one end and 'data out' pin at the other Connect a wire between 'data out' pin at one end and 'data in' pin at the other Connect a wire between the 0v pin at one end and the 0v pin at the other. i.e. link RTS to CTS, data in to data out and 0v to 0v. Note that the data in pin may also be labelled Rx or receive, the data out pin may also be labelled Tx or transmit and the 0v pin may also be labelled ground or earth. Take care not to misread the diagram - it is probably the view from the back of the plug as you are soldering, not from the front as you look at the pins. Actually, provided you misread it at both ends, it shouldn't matter. Due to a bit of poor design on someone's part, the plug will actually fit into the RS423 socket either way up and only one of these will work. You should therefore plug the lead into both computers and test it (as described below). If it doesn't work, try rotating the plug by 180 degrees at either end and test it again. If it still doesn't work, fiddle around futilely for a while and then wearily disassemble the plugs and check the connections. When you do get it working, I would advise you to mark the top of each plug with Tippex or nail varnish so that you know which way round to put them in the next time. Of course, you can leave the lead permanently connected if you wish, but if the computers are in different rooms and you can't hide the cable then you will have to disconnect it when not in use, making it particularly important that you know which way round to put the cable in - running back and forth between rooms to fiddle with the plugs can be very tiring! Earlier I mentioned briefly about the possibility of buying a lead, so you might wonder why to go to all the trouble of making one. Firstly, commercial leads tend to be quite expensive. Secondly, they are usually fairly short - 5m or so. This is fine if the computers are next to one another, but if they are a long way apart then this is not much use. However, if you don't need a long lead and you want to avoid the stress and strain of making your own a commercial lead should be perfectly satisfactory, although you may still need to go through the business of working out which way round the plugs go and marking the tops to indicate this. Testing the lead To test the lead, run the accompanying program TestRec on one computer and then run TestSnd on the other (no harm will result if you run TestSnd first, but the test may not work even if the lead if OK). You should see Zarch-style landscapes being produced on both computer screens, albeit rather slowly. The lack of speed is not due to the serial link itself - if you really want to know, it is due to the receive program being deliberately slowed down to make sure the handshaking is tested. TestSnd is a modified version of Duncan Lilly's Zarch landscape generator from issue 26. If this works then you should try it the other way round, with the computer which was running TestSnd running TestRec and the computer which was running TestRec now running TestSnd. If it works both ways then the link is almost certainly OK. If it fails to work in either direction then try modifying the lines *FX7,7 and *FX8,7 in both programs to read *FX7,3 and *FX8,3 respectively. This slows down the rate of data transmission and may solve the problem, particularly if you are using a long cable - if it does then you will have to make similar changes in all the examples given and you should also experiment to find the highest value which works reliably. However, this may only solve the problem because it removes the need to use handshaking, so you should check the cable even if slowing down the transmission rate helps as it may indicate incorrect connection of the CTS and RTS pins. On all except the longest cables, *FX7,7 and *FX8,7 should work perfectly. If this does not help then the link is probably at fault - see the hardware section above for further advice. If you have trouble getting the link to work with *FX7,7 and *FX8,7 and cannot find any problems with the cable, send a 999 message to 8BS giving full details so that myself and other members can see if we can see what's wrong. Warning Apparently, some Masters have RS423 hardware which apparently overheats on occasion and sometimes corrupts the bytes passing through the RS423. I have no personal experience of this, but having seen it mentioned in Archive (volume 1, issue 1) I felt that I ought to mention it just in case. If you are using a Master and the link appears to be faulty for no reason, you might want to try it after the computer has been off for a while or while blowing cold air over the computer with the lid off. If this cures the problem then it strongly suggests that overheating is the cause, but I have no idea how to cure this problem permanently. Software I will cover software to use the link in part 2. However, if you want to reassure yourself that the link is not so slow as to be useless, try using the test programs but with line 110 of TestRec deleted. You may also like to experiment with changing the *FX7,7 and *FX8,7 commands to *FX7,8 and *FX8,8 commands - this gives the highest possible speed over the link but is 'not guaranteed' according to the manual although it has always worked reliably for me. Disclaimer Note that neither the author nor 8-bit Software can be held responsible for any damage which may be incurred as a result of the instructions contained in this article. The information provided is not guaranteed correct and although we apologise for any time or money wasted as a result of incorrect information no liability can be accepted.