Sharp logo
PC Tape interface 
( written by Andreas Jung / Germany,
hardware is made by www.sharpmz.org / Germany ) 
Overview


The following section describes the hardware and the usage of the software to use the data recorder of your MZ, a C64 datassette, or other data recorders at your PC to load and save your MZ-programs. The software is ready for download here and is to be run under plain DOS.

The interface desribed here can also be used to transfer data directly from / to an MZ.

Hardware
Connecting a data recorder


The hardware needed is very simple. At the PC site you need a parallel male plug ( SUB-D, 25 pins ) to connect the data recorder to your LPT port. At the site of your MZ-data recorder you need a male plug to connect this plug to your data recorder female plug. If you use a C64 datassette or other recorders use the plug needed. The two plugs must be wired as follows:

SUB-D
pin #
Signal MZ-1T01 / MZ-1T04
pin #
Signal
3
data bit 1
7
Write
9
data bit 7
4
Motor / Remote
10
ACK
8
Read
12
PE
5
Sense
18 - 25
GND
9
GND/E
-
-
6
+5V
E.g. you have to connect pin 3 at the PC site
to pin 7 at the MZ1-T01 / MZ-1T04 site, 9 to 4 and so on.

Use an external power supply ( 5V / min. 0.3A ) and connect it to the pins 9 ( GND ) and 6 ( +5V ) at the MZ-1T01 / MZ-1T04 site. The power supply is needed to supply your data recorder because the LPT port cannot do this. Please wait for the pin description of MZ-80K / 80A / 80B or try yourself ( see the Download sections of Service Manuals ).



Caution ! Caution: If your data recorder does not support the Motor / Remote control function to enable the programs to control the motor, you should not connect pin 9 from the connector at the PC site to pin 4 of the data recorder's connector.

Data recorders without a remote control function ( like the C64 datassette without any remote control electronic ) may not be connected to the LPT port pin 9. The power needed by the motor of such recorders cannot be contolled or supplied by the LPT port pin 9. If a Motor pin at the connector of your data recorder is available ( e.g. C64 datassette ) connect it to +5V of the external power supply ( or pin 6 at the data recorder's connector ).

Check your data recorder to be sure before connecting it to pin 9 of the LPT port. If you're not sure, connect the pin for the motor to +5V of the external power supply. Don't be confused, the motor runs always even no button at your data recorder was pushed.

Such recorders also do not have the sense signal ( pin 5 at the MZ side ) which signals if a data recorder's button is pressed. Therefore connecting pin 12 ( PC ) to pin 5 ( MZ ) isn't necessary. All signals shown in the table in bold are necessary for such types of recorders, no others.

In the case if the remote control function is not supported, the load / save programs can't control the moto, and you have to start and stop the data recorder by the PLAY / STOP button when you are prompted to do. Wait for the prompt, don't push a button before you will be prompted to do, otherwise data written or read can be lost.

The data recorder SHARP MZ-1T01 / MZ-1T04 supports this function by an inbuilt electronic and should be connected to all pins shown above.

Directly connecting an MZ


Note If you want to transfer data directly between MZ <-> PC you do not need a recorder, but you need to connect both, PC and MZ, by a cable ( 3 wires are necessary ). In this case you only have to connect 3 pins: Write, Read, and GND as shown in the table above. No extra power supply is necessary.

If you want to transfer a program from the PC to the MZ:
First enter the MZ-monitor command "L" and next execute MZSAVE on the PC.

If you want to transfer a program from the MZ to the PC:
First execute MZLOAD on the PC and next enter the MZ-monitor command "S".

Software
Installing the software


Download
the ZIP-file now ( 252 Kbytes ).

Unzip the file into the their given directories and put the name of the directory \mztape into the PATH definition statement ( autoexec.bat ).

Start DOS. Don't run the programs in a non-DOS environment ( e.g. Win95 ). It may be that interrupts can occur which will result into incorrect data during saving / loading a file.

There are three subdirectories of \mztape. One is for the MZ-700 ( and for the MZ-80K / 80A ), the second is for the MZ-800, and the last one is for the MZ-80B. Use the appropriate directory to read or write files. All series do not use the same timings while reading / writing ( see below ).

Note The software is freeware and the source code is included to enable you to change the program for your own purposes. To this, here are some hints:

If there are timing problems, try to change the read / write values for the cycles defined in the source code. Then reassemble the progam. I'm just working on a new MZLOAD version which will be more comfortable to use. May be, the MZSAVE will also be changed.

Please note, the GAP written to an MZ-80B tape differs from all other MZs: The MZ-80B writes only 10,000 short pulses in front of the header, whereas all other MZs use 22,000 short pulses.

The timer 8253 / 8254 is used to control all cycles. The clocking of the timer chip is 1.193046 MHz ( IBM PC 1.193180 MHz, but this little difference has no meaning ).

The timings of the square wave are:

Series mark0 space0 mark1 space1 read point
MZLOAD
MZ-700 / 80K / 80A
240µs ( 286 )
264µs ( 315 )
464µs ( 554 )
494µs ( 589 )
872
MZ-800
240µs ( 286 )
278µs ( 332 )
470µs ( 561 )
494µs ( 589 )
884
MZ-80B
166.75µs ( 199 )
166µs ( 198 )
333µs ( 397 )
334µs ( 398 )
596
( 579 used )

Additional notes Values in paranthesis are the computed PC timer values used by the programs. They are computed by x / ( f )-1.
Example for mark0 of MZ-700: 240-6 / ( 1.1930466 )-1 = 286.
MZLOAD uses an average value for "pulse" from all values.
Example: ( 286 + 315 + 554 + 589 ) / 2 = 872.

Thanks to the author for his programs described in the following sections. The author is Andreas Jung / Germany and the source code is documented but in german at this time only. The source code is included in the ZIP-file you have downloaded. The programs are almost written in x86-assembler.

Additional notes Use the programs in the appropriate directory for your MZ-system:

MZ-700 - \MZ700
MZ-80A - \MZ700
MZ-80K - \MZ700
MZ-800 - \MZ800
MZ-80B - \MZ80B.

Loading data from tape


To load a program from tape use Mzload.com. To load multiple programs from tape use Mzload.bat contained in the downloadable ZIP-file.

The program can be aborted by pressing the STOP button at your data recorder.

The file will be created into the current / active directory shown in the DOS prompt after entering the load command and the type of the file created is a M12-formatted file at this time only. You can change and assemble the source of the program for your own purposes. You can rename it to .mzf without problems. .m12 and .mzf are compatible.

The syntax to execute Mzload.com is:

Mzload.com [options] [dosfilename] ["tapefilename"]

Parameters shown in [paranthesis] are optional but you should read the sections about all parameters before using Mzload.com. If you code an invalid option the program returns a help text and stops processing.

If the PLAY button at your data recorder is not active after invoking the program you will be prompted to press this button. After pressing this button the motor of your data recorder starts if your data recorder supports the Motor/Remote control function. The motor stops automatically when the file is loaded . This is supported by the remote control function too.

Options


The following options to the DOS-program Mzload.com are available:

option meaning
-x invert polarity when reading
-s read first copy, don't verify
You can use both options like: -x -s or -xs only.

If you use the original MZ-data recorder then you don't need the option -x. If you use other recorders try to read the tape using the option. If you can't read the tape by using this option try to read the tape without this option. Using the option -x works like the polarity switch in your MZ does. All bits read from tape will be inverted. Must be used for some types of data recorders, not for the original MZ-data recorders.

If you use the option -s the first copy will be used if no errors occured during the read process otherwise the program tries to read and to use the 2nd copy like your MZ does. If you don't use this option both copies will be verified and you will be informed by a message if the copies are not equal. This means, it is more secure but it is time expensive too.

Caution ! Be careful using the option -s: If the first copy on tape could be read successfully the tape stops at this point. If you start a SAVE now from this point you destroy the 2nd copy. If the 1st copy is unreadable in the future you should have this 2nd copy to enable your MZ to try to load the file by this 2nd copy otherwise the file is lost forever... ( gone with the wind ;-)

In the case of using the option -s and next saving a file you have to forward the tape behind the whole file ( behind the 2nd copy ). To this you should remember the counter value of the recorder's counter. You would be very thankful to yourself some years later or ealier in doing so ;-)

DOSFILENAME


You can use Mzload.com without defining a dosfilename. In this case the program uses the first 8 characters of the file defined by "tapefilename" or the first 8 characters of the filename from the first readable file found on tape if no "tapefilename" was specified.

In both cases the suffix will be .M12. This means, the program can only create this type of files at this time ( for other file types like .bin, mz7, etc. change the program for your own purposes and don't forget to send me your version, thanks ;-).

If the file dosfilename already exists the suffix will be .M13. If a file dosfilename.M13 already exists the suffix will be .M14, and so on, M15, .....M99, N00...Z99. This will take effect in both cases described above (even if the dosfilename is omitted).

Special ( non-standard ) MZ-ASCII-characters found will be translated or omitted ( e.g. non-alphanumeric characters ) if "tapefilename" is omitted and if such characters were found in the tape header by the program. Lowercase letters will be translated well.

"tapefilename"


If you omit the "tapefilename" the next file found on tape will be loaded and the dosfilename will be created as described above otherwise the program searches for the file "tapefilename" until it is found on tape.

You must enclose the "tapefilename" in quotation marks to enable the program to distinguish between the "tapefilename" and the dosfilename.

Error condition


If any errors during read occur an errorlevel of 1 will be set even if you press the STOP button at your data recorder to abort the program. You can check the errorlevel as shown in Mzload.bat contained in the downloadable ZIP-file..

Using the batch files and Motor.com


If the remote control function is supported by your data recorder ( read the important note ) Mzload.com and Mzsave.com both start and stop the motor automatically. When these programs terminate the motor will be stopped and by this you cannot use the buttons to forward or rewind the tape.

The batch files Mzload.bat and Mzsave.bat both use the program Motor.com prior to the execution of Mzload.com / Mzsave.com and at the end of their execution again. This enables you to forward or rewind the tape until you press the ESC key. If you press the ESC key Motor.com terminates.

Mzload.bat will be terminated if any error occurs or if the STOP button at the data recorder was pushed.

Motor.com checks the status of the buttons at your data recorder by using the signal sense. If sense signals a key is pressed then the motor will be started by Motor.com otherwise it will be stopped. This program is written in PASCAL.

Saving data to tape


To save a M12-formatted file to tape use Mzsave.com. The file must be M12 formatted. Rename a MZF-formatted file prior the execution of Mzsave.com ( M12 and MZF are compatible ).

The program can be aborted by pressing the STOP button at your data recorder.

The syntax of Mzsave.com is:

Mzsave.com [options] dosfilename ["tapefilename"]

Parameters shown in [paranthesis] are optional but you should read the sections about all parameters before using Mzsave.com. If you omit all parameters you get displayed a help text.

Options


The following options for the DOS-program Mzsave.com are available:

option meaning
-x invert polarity when writing
-s only write a single copy of header and data
You can use both options like: -x -s or -xs only.

If you use the original MZ-data recorder you don't need the option -x. If you use other recorders try to write to the tape using the option. If you can't read the tape try to omit this option and / or define or omit -x in the options of Mzload.com. All bits written to tape will be inverted. Must be used for some types of data recorders.

If you use the option -s a single copy only will be written to tape. MZ's always writes two copies to tape.

Caution ! Be careful using the option -s: You would be very thankful to yourself some years later or ealier by omitting this option ;-)

DOSFILENAME


This parameter can't be omitted. The dosfilename is the name of the file to be saved on tape and must be a M12 formatted file having the suffix .M12. Rename a MZF-formatted file prior the execution of Mzsave.com ( M12 and MZF are compatible ).

You cannot use *.M12 to save multiple files.

"tapefilename"


If you omit this parameter the first 8 characters of the filename stored in the M12-format are used to build the "tapefilename".

If you define "tapefilename" you must enclose it in quotation marks to enable the program to distinguish between the "tapefilename" and the dosfilename.

Special ( non-MZ-ASCII) ASCII-characters found will be translated or omitted ( e.g. non-alphanumeric characters ) if "tapefilename" is omitted and if such characters were found by the program in the M12 header. Lowercase letters will be translated well.

Error condition


If any errors during write occur an errorlevel of 1 will be set even if you press the STOP button at your data recorder to abort the program. You can check the errorlevel as shown in Mzload.bat contained in the downloadable ZIP-file ( no errorlevel is used by Mzsave.bat ).


Go to the top of this page Home

last updated May 15, 2004
sharpmz@sharpmz.org

khmweb barrierefreies webdesign Berchtesgaden