Z88 PCLink Client - an experiment

Click below to download the application:
PCLink2 Client

My previous work on Z88 serial communications was OK, but you need to use the Z88 and Windows at the same time – meaning that you need about 4 hands.  You can also only send one file at a time.  However, it does work with an out-of-the box, unexpanded Z88 without any additional EPROMs, which is why I wrote it.

But ... a lot of Z88’s have a PCLink2 or EasyLink EPROM installed.  This makes the Z88 act as a server, meaning that all the work could be done from the PC (with some client software).  So ... I’ve decided to have a go at developing a modern Client for that - one that will work on current versions of Windows.  After speaking to Vic from Rakewell we decided that it would be good to have the Z88 act like a memory stick ... to simply appear as a new drive in Windows.  You can then just use Explorer to access your Z88.  But can that be done over a serial connection?  Well I think so ... with the help of a library like Dokan.

So this is my proof-of-concept.  I have tried it on Windows 7 (both 64 and 32 bit versions).  It only uses the PCLink2 protocol, which should work with both PCLink2 and EasyLink EPROMS, but has limitations - it cannot create directories on the Z88 for example.  It works with the ‘official’ Z88 serial link cable.  When the client is running it puts a Z88 icon into your system tray.  Right clicking this icon allows you to browse to the Z88 or exit the client program.

You must connect the Z88 and run PCLink or EasyLink before starting my Windows client software.

Configuration options
There is a Z88.ini file which allows you to set the COM port and the protocol used (at the moment only the PCLink2 protocol is supported).  But you’ll need to edit the Port= setting in the .ini file if you’re using a COM port other than COM1.

WARNING!! this is a proof-of-concept and is very experimental.  It could crash your PC or corrupt the files on your Z88.  I’m only putting it here in case some brave people would like to test it and let me know if they find any problems.

To make it work, you will need to install the following components on your Windows machine:

.Net Framework 3.5
Dokan Library (download and install Dokan-0.6.0)

Z88 Serial Communication - part 2

I have been meaning to make a blog entry about this for ages, but haven't gotten round to it yet.  This is part 2 of my work on establishing serial communications with the Cambridge Z88.  In the first part I described how to install a small Basic program on the Z88 ... this part completes the process by running a matching program on Windows.  This allows data to be sent back and forth, but only a single file at a time.  It uses my own protocol, and allows binary files (like Basic programs) to be sent.

Z88 Serial Communication for Windows

This is program needs .Net Framework v2 (click here for the for the x86 version), so that needs to be installed first, but you've probably got it already.  I've only tried it on Windows 7, although I don't see why it shouldn't work on Windows XP or Vista.

If you have installed the Basic program on your Z88, you can now use this program on Windows.  Just copy the files to a folder and run the .exe file.

NOTE: anything above 9600 baud might work; but I have not found it reliable.  This program works with the genuine Z88 transfer cable, since it uses hardware handshaking to prevent the buffer from filling up.  The serial settings on the Z88 will be set up using the normal Panel settings.  I’ve been using these settings - Transmit baud: 9600, Receive baud: 9600, Parity: None and Xon/Xoff: No.

Sending from the PC
Run the Basic program on the Z88.  Press ‘R’ and <Enter> to say that you’d like to receive a file.  Then enter the name of the file, the name that will be used on the Z88 and press <Enter>.  The Z88 will wait for the file to arrive.  Now on the Windows program select ‘Send’ along with the COM port settings you’re using.  Click the ‘...’ button to browse for the file on your PC.  Finally, when you have selected the file click ‘Transfer’ and you should see the file being transmitted.

Sending from the Z88
In the Windows program select ‘Receive’ along with the COM port settings.  Click the ‘...’ button and select the file name and the folder where the file should be saved.  Then click the ‘Transfer’ button.  The PC will wait for the file to arrive.  Now, run the Basic program on the Z88.  Press ‘S’ and <Enter> to say that you’d like to send a file.  Then enter the name of the file on the Z88 that needs to be transmitted and press <Enter>.  The Z88 will now transmit the file to the PC.

Z80 C Compiler

z88dk logo

I like BBC Basic programming on the Z88, but I also wanted to write proper Z88 applications that appear in the main menu.  But I didn't really want to have to resort to Assembly Language.  This is where Z88dk comes in.  It is a C compiler that originally targetted the Z88 specifically.  So now I can write applications for the Z88 in C.  As a bonus Z88dk also works for many other Z80 based machines.

But rather than copy the resulting files straight to a real Z88; I've also found this rather good emulator:

Z88 emulator

...which seems a very easy way to test your code before sending to a physical machine. This emulator seems to work fine on Windows 7, even the 64 bit version.

Z88 serial communication - Part 1

When I got my Z88 I had problems backing up my Basic programs.  The Import/Export program on the Z88 does not like binary files, including basic programs, so I decided to write my own solution.  Here are some instructions on how to transfer my own Basic communication program to the Cambridge Z88:

Firstly, on the Z88 you need to configure the communication settings, by going into Panel.  You’ll need to set both the Baud Rates to 9600 and the Parity to None.  Make sure that Xon/Xoff is set to No (because I haven’t gotten that to work any other way yet).  When that is done, go into Basic.  Connect your serial cable between the Z88 and the PC.

We’re going to get the serial port to type a Basic program into the Z88, rather than typing it in manually via the keyboard.  So enter the following command in Basic on the Z88:

*CLI .<:COM.0

This will tell the Z88 to get input from the serial port instead of the keyboard.  So if we send stuff out of the serial port of the PC it will appear as if it has been typed into Basic on the Z88.

All we need to do now is send this file.  I normally use Tera Term Pro, with serial port settings like this:

 Com settings

...for most reliable results I give a 10ms delay when transmitting bytes and lines.  Note the flow control is set to Hardware, and all the other settings are as we configured them on the Z88.  Make sure the Port is wherever you have the cable plugged in. EDIT: recently I've re-visited this procedure on a different PC and could not get it to work with the 10ms delay.  But I encreased both delay settings to 50ms and it worked perfectly.  So if you have problems, try increasing the transmit delays, it might help.

Now we can send the file.  From the File menu in Tera Term Pro, select “Send File...” and browse for the CLI file we’re sending.  I normally tick the Binary option, to make sure the bytes sent are exactly as given in the file.

 Open dialog

Click Open and wait.  The file should start sending (sometimes the transfer takes a minute to get going, be patient). You should see the program being typed into Basic on the Z88.

When the program is finished on the Z88, you need to hold down [Shift] and press [Escape] on the Z88 keyboard.  This tells the Z88 to use the keyboard again instead of the serial port.  You should save the file in Basic by typing SAVE "Z88SERIAL.BAS".  Next, if you type RUN and press [Enter] on the Z88 the new transfer program should start up.  And from now on, transferring files should get easier.  We have the software on the Z88, all you need now is the PC side ... that will be in my next post.

UPDATE: Part 2 can be found here.

Brand new Z88

I've become quite attached to my second-hand Cambridge Z88, too many memories of writing BBC Basic programs at school I guess.  When I found out that you can still get them *brand new* I was surprised.  So I bought one!  It arrived today boxed up with the user manual in the original shrink wrap.

I can certainly recommend the supplier: rakewell.  I ordered it on Friday and the machine arrived on Monday, plus I had a nice chat with their man Vic in the process.  I am continuing to write my own transfer software, it's now at the point where I can reliably back up my Basic programs from the Z88 to my Windows 7 based machines.  Plus I can restore them back to the Z88 as well.  When on the PC, the files load happily into BBC Basic for Windows, even the free trial version.  So I can write programs on my Windows machine, save them and then transfer them to the Z88.  For the PC, I have written a console application in C# that can send and receive in the same format.

I will post the instructions and source code at some point, in case it helps anybody else.  Although it has occurred to me that I'm the only person wanting to back up a Z88 to a Windows 7 machine...  

Z88 Serial Cable

One of the things that was good about retro computers was the User Manuals.  In my Z88 manual, it describes how to make an RS232 cable that will work with its serial port (the port on the Z88 has a non-standard pinout).  So I made one:

Home made Z88 RS232 cable

It was made from bits that I had lying around (as you can tell).  Mostly stuff salvaged from old PCs in fact.  Note the USB adaptor on the end.  It's clunky ... but it works.  I could easily make a better one (one not made from junk perhaps).