Article from Fred 40
Has anyone tried using or doing anything with the SAM network? My experiences linking two SAMs may be of interest:
Firstly the connecting lead. The handbook (p171) shows a lead that has pins 1&6, 3&7 joined at one end but only pins 6&7 used at the other. This single lead will give data transfer in one direction only.
A clue! P108 vaguely shows the SAMs connected in a closed loop, use a second lead and providing they're connected the right way round so that each SAM has an end that has the pins linked then two way transfer is possible.
We can now use LOAD/SAVE "n:XXXX" to transfer Basic, Code, Screens etc between the computers.
Incidentally, the data leaves the SAM via pins 6&7 and receives via pins 1&3. I have not worked out the implications of the same SAM having data fed back into itself by the linking of pins 3&7.
Unfortunately, a lot of programs seemed to lock up when both leads were connected. I found that many routines trigger the Network output and leave it high. It seems that if pin 3 is taken high then the keyboard is locked out, no doubt to prevent data corruption during network use. However, as pin 3 is connected to pin 7 then when the programs drive an output on network and leave it there things come to a halt and the computer is locked up.
Investigating Outwrite I found that it is the MC menu option routine that triggers the network. So selecting option "O" and returning to BASIC the network is held high and unuseable together with the keyboard locked up. Many other menu options also do the same.
However the BASIC command MODE resets the Network output to zero. The Network can now be used normally. Therefore using the MODE command in your Network programs frequently should solve this problem.
It was not at first obvious to me that Network and Midi are in fact one and the same as far as the computer is concerned in sending and receiving data. Using different pins on connectors only gives different levels of signal to suit use. The actual form of data is decided by the software/ROM/DOS routines to suit use. However input is via the same input circuit and seems to go to same input in ASIC. Likewise output is from the same point in the ASIC and just goes via different coupling circuits to Network or Midi.
So the info in the SAM Coupé Technical Manual
P3 as to ports is valid for networks.
The following test routines will generate a value in one SAM and display it on the second.
SAM 1 : 10 FOR x=0 TO 255: OUT 253,x: NEXT x: GOTO 10 SAM 2 : 10 LET A=IN 253: PRINT AT 0,0;A: IF A=255 THEN CLS 20 GOTO 10
Not very exciting, but at least it's a start!
I am still trying to find out if the network as such has been included as stated in the handbook where it refers to Channel 0 and 1 to 15 as stations, how "device n5 uses network station 5" and so on relate and how to define which station it is supposed to be.
I have in fact found that it is more reliable to use a 2 core plus screen cable for two machines where pins 1&6 connect to screen at each end but then each core connects to only pin 3 at one end and to pin 7 at the other end. This means that the machine does not lock out it's keyboard when pin 7 goes high and most times the system can be freed.
Since writing the last letter I think I have found the problem in Outwrite when I said the network output was being driven during certain programs and menu selections.
In Outwrite it is PORT 252. Bit 7 of 252 is used for MIDI/Network.
This port as example in MODE 3 can hold 222 ie PRINT OUT 252
IN 252,222 Drives network O/P high and leaves it there IN 252,222-128 " " " low " " " "
However an IN with bit 7 set to zero is not permanent as if the network output is off then it sets bit 7 back high it seems.
My conclusion is that OUT 252 to avoid triggering network should be bit 7 to zero even if the vale is obtained from the port in the first place.
IN a,(252) Set bit 7 to zero (whether high or low) OUT (252),a
Network Reply from Colin Macdonald
When at SAMCo last Summer, Adrian, Charles and myself did some experimenting and besides having fun we did actually produce some interesting results!
Yes, there does seem to be a problem with two SAM's in a closed loop but we didn't investigate as far as Malcolm as done. We successfully "daisy-chained" four SAMs together with each one being a different station number.
We wrote a message sending program which allowed one SAM to have control of the network. It could send a message to one specific machine, to all of them at once, or it could pass the control to another machine. If I remember correctly, this program worked on the network side of things as opposed to MIDI ie the messages were loaded / saved as code files between machines. Although I don't have a copy of this program, it is believed to be lying deep in Adrian's collection of discs so I'll try and get hold of it for a future issue.
When at SAMCo, myself and Adrian enjoyed playing computer Othello. So when the network was experimented with the first thing we did was create a networked version of Adrian's Othello program that was published in FORMAT some years ago. Because all that needed to be transmitted was the new position ie "C4" I think it was sent by MIDI ie simply using IN and OUT on port 253. Again, I'll try and get hold of the program sometime because although it was nothing exceptional, it was nice to experiment.
Thanks for your research Malcolm, if anyone else has experience in SAM networking I'd love to hear about it.