ROTRONICS 2302 User Manual

Rotronics Wafadrive - Manual.doc
Rotronics Wafadrive
2004 OCRed by Wilko Schröter
THE ROTRONICS
WAFADRIVE
SPECTRUM VERSION
16/48K Sinclair Spectrum
model No: 2302
Written and prepared by
Graham Booth B. Eng
WAFADRIVE
is a trade mark of
ROTRONICS LTD.
Santosh House
Marlborough Trading Estate
West Wycombe Road
High Wycombe
BUCKS. HP11 2LB.
ENGLAND
ROTRONICS LTD
A division of Rovo Financial Corporation Ltd Santosh House, Marlborough Trading Estate, West Wycombe Road High Wycombe Bucks. HP11 2LB
1
Rotronics Wafadrive - Manual.doc

CONTENTS

Introduction 5
Chapter 1. Unpacking and connecting 7
Chapter 2. Using the Wafadrive 9
Initialising the system Using NEW Clearing BASIC programs Clearing the screen
Chapter 3. The wafers 11 Preparing and naming wafers Protecting against accidental erasure Maintenance
Chapter 4. The Directory 15 Displaying the Directory Setting the Default Drive
Chapter 5. Storing and retrieving programs 19 Saving Verifying Loading Erasing Merging Saving using an existing file name Auto-run programs Saving and loading machine code Copying programs Modifying existing programs
Chapter 6. Streams 27 Stream handling on the unexpanded Spectrum Stream handling with the Wafadrive
Chapter 7. Storing and retrieving data 31 Creating a Wafadrive data file Writing data to a Wafadrive file Reading data from a Wafadrive file Copying data files
Chapter 8. Centronics and RS232 interfaces 35 The Centronics interface The RS232 interface Connecting peripherals Sending information via the interfaces Receiving information via the RS232 interface Further information
Chapter 9. How the Wafadrive works 41 System operation Operation of the Extended BASIC commands Reading the directory from BASIC
2
Appendix 1. Error reports 47
Appendix 2 Command summary 51
Appendix 3. Extended system variables 55
Appendix 4. Memory map and port addresses 57
The memory map The directories The read/write buffers Control ports
Appendix 5. Specification 61
Index 63
Rotronics Wafadrive - Manual.doc

INTRODUCTION

The Wafadrive is a fast access storage system using special magnetic tape drives. It enables programs and data to be loaded into your Spectrum much more quickly and conveniently than is possible using cassettes. Furthermore, file handling is easily performed since the Wafadrive locates files automatically without the operator having to position the tape.
The Wafadrive unit also incorporates two interfaces which enable the Spectrum to drive most printers that are Centronics or RS232 compatible. This covers the vast majority of printers that are generally available. A full specification Word Processor is supplied with the Wafadrive so you can start using your new system straight away. The Word Processor allows documents and correspondence to be prepared and filed quickly and efficiently. This greatly increases the usefulness of your computer – particularly if you have a printer and add-on keyboard unit.
Readers of this manual should be familiar with the use of BASIC on the Spectrum. If you have purchased a Wafadrive at the same time as your Spectrum, first read the booklets supplied with the computer.
3
Rotronics Wafadrive - Manual.doc

UNPACKING AND CONNECTING

Upon opening the Wafadrive carton you should find the following items:
1. The Wafadrive unit itself with integral connecting lead.
2. A blank (unformatted) wafer.
3. The Word Processor wafer.
4. This manual.
The power lead must be disconnected from the computer before connecting the Wafadrive. Failing to do this can result in damage being caused to the Wafadrive or your computer.
To connect the Wafadrive, simply push the connector into the Spectrum rear expansion port, ensuring that the locating key and slot are lined up first. Never force the connector into position.
When not required, the Wafadrive may be disconnected from the computer. However, it is recommended that this is done as infrequently as possible to minimise strain and wear of the connectors. The Wafadrive does not affect the normal operation of the Spectrum unless it has been initialised.
When disconnecting, always grip the connector assembly. Never remove the connector by pulling on the ribbon cable.
Any additional peripherals may now be connected via the slot at the rear of the unit. Ensure that the peripherals you intend using are compatible with the Wafadrive. The number of items that can be connected to the Spectrum at any one time is limited. It is wise to keep the loading on the computer to a minimum to avoid unreliable operation or possible damage.
The power may now be reconnected to the Spectrum whereupon the screen will display the normal Sinclair copyright message. The computer will behave exactly as normal since the Wafadrive system will not be effective until it is initialised (see chapter 2).
There are three indicator LEDs between the drive apertures. The centre on is the power on indicator, which will light up whenever power is applied to the computer. The remaining two, to the left and right, are the drive active indicators. These will illuminate whenever the drive motors are running.
Do not discard the Wafadrive packing materials. If your unit is ever required to be serviced or repaired, it should be returned in the original packaging. All parts supplied with the Wafadrive should be included, together with a clear description of the problem.
4
Rotronics Wafadrive - Manual.doc

USING THE WAFADRIVE

INITIALISING THE SYSTEM
The many extra facilities that the Wafadrive adds to the Spectrum are provided by the Wafadrive Operating System (WOS), which is similar in many ways to the Disk Operating System (DOS)
found in larger computers. The extra facilities are accessed by means of the Extended BASIC (EBASIC) commands made available by the Wafadrive Operating System. The Extended BASIC commands do not come into operation until the system has been initialised.
Once initialised, the Wafadrive Operating System reserves about 2K of the Spectrum's memory for its own use (system variables, read/write buffer and the two drive directories). The user has the option of retaining the computer's full RAM capacity if the Wafadrive is not required for use, without having to disconnect the unit; if the initialisation process is omitted, the computer will behave normally.
The system is initialised simply by entering:
NEW *
This is the only Extended BASIC command that the Spectrum will respond to until the system has been initialised. The Wafadrive title message will now be displayed and the system is ready for use. NEW * may be entered at any time. It does not affect any BASIC program currently in memory. However, once the system has been initialised, NEW * has no effect and will cause a syntax error. If at any time there is insufficient memory remaining to allow the Wafadrive system to operate, you will be unable to enter the NEW * command.
All the extra commands made available by the Wafadrive system are suffixed either with the asterisk (*) or hash (#) symbols.
USING NEW
The NEW command has exactly the same effect on BASIC programs as before. However, NEW will also reset the Wafadrive system, freeing the reserved RAM. The system must be re­initialised before it can be used again.
CLEARING BASIC PROGRAMS
The NEW # command clears out any BASIC program, without resetting the Wafadrive Operating System. Although the initialisation process is virtually instant, the use of NEW # instead of NEW means that the directories do not have to be re-fetched from the wafers (more of this in chapter 4).
Note that executed directly from the keyboard.
CLEARING THE SCREEN
The Wafadrive adds an additional command which, although not directly related to the operation of the drives, is nevertheless very useful. It is:
NEW *
CLS *
or
NEW #
cannot be incorporated into BASIC programs – they can only be
which performs the normal CLS function, but in addition also clears the screen attributes – resetting them to their initial values of PAPER=7, BORDER=7, INK=0 etc. Text will therefore revert to black on white.
5
Rotronics Wafadrive - Manual.doc

THE WAFERS

Wafers are available in three sizes, having nominal capacities of 16K, 64K and 128K after formatting. The average access time (ie. the length of time you have to wait whilst the file you want is found on the wafer) increases in proportion to the capacity. The 16K wafer holds a reasonable amount of data and gives very rapid access. The larger capacity wafers give more cost effective storage but on average you will have to wait slightly longer before files are located on the wafer.
The user can choose the size of wafer to suit particular applications. The smaller wafers are recommended for program development where programs are generally small and fast access is important. Finished programs, back-up copies and data can be archived onto larger wafers, freeing the smaller ones for further use.
The tape inside the wafers is protected by an integral sliding cover which is automatically moved across to expose the tape when the wafer is inserted into the drive. Touching the tape can damage it – avoid doing so.
If It is possible to remove a wafer from a drive whilst the drive motor is running (signified by the drive active LED being lit). There is virtually no possibility of damage, but doing this habitually could have a detrimental effect on the life of the wafers. Removing wafers in this way should not be necessary unless the system "crashes" whilst the motor is running – only likely if you are experimenting with machine code. Usually the a wafer is removed.
BREAK
key can be used to stop the motor before
Care should be taken to ensure that wafers are withdrawn from the drives when the power is applied or removed – especially if either of the drives is active. The system has been designed to cope with this to an extent and you would be very unlucky to lose data (in the event of a power cut for instance).
However, as a general rule:
AVOID REMOVING WAFERS WHILST THE DRIVE ACTIVE LEDS ARE
ILLUMINATED. ALWAVS REMOVE WAFERS BEFORE SWITCHING THE POWER
TO THE COMPUTER ON OR OFF.
You will soon learn that your Wafadrive system is very reliable. The wafers have been designed to sustain 5000 passes and with careful use are capable of achieving double this figure. Despite this, it should be remembered that the wafers do have a finite life and that accidents can happen. It is strongly recommended that all important programs and data are backed-up onto other wafers – or possibly even cassettes.
Do not leave wafers in the drives when not in use. Store them in a dry place, where they will not be subject to extremes of temperature. Keep wafers away from the TV set, Spectrum power supply, cassette recorder and any other equipment likely to be the source of strong magnetic fields.
6
Rotronics Wafadrive - Manual.doc
PREPARING AND NAMING WAFERS
Like disks (but unlike cassettes), blank wafers cannot be used straight away as supplied from the factory. They must first be formatted using the FORMAT * command. Commercially duplicated wafers are formatted during the duplication process and can be used straight away.
The most important thing to remember about formatting is that any data and programs stored on the wafer will be erased. Therefore, be absolutely sure that nothing of value is stored on wafers before you attempt to format them.
Once formatted, wafers will not normally require re-formatting – unless you want to "wipe" them clean for any reason.
The FORMAT command allows each wafer to be individually named. This name appears on the screen when the directory of the wafer is displayed, enabling wafers to be easily identified. It is very important that you give each of your wafers a unique name. If you do not, you run the risk of confusing not only yourself but the operating system also – with potentially disastrous results.
To format a wafer first insert it into either of the drives – say drive A (the left hand one). Ensure that it is pushed completely home. It is also advisable to ensure that there is no wafer in the other drive. Now type in:
FORMAT *"a:xyz.001"
where "xyz.001" represents your initials and a wafer number (a different number for each of your wafers). You don't have to name your wafers in this manner but it is advisable to be systematic, and this is a good method.
The "a:" section of the name string is the drive specifier. This can only be either "a:" or "b:" (upper or lower case), according to which drive is being used. Often the drive specifier can be omitted (see chapter 4). The maximum total length of the wafer name is ten characters – not including the drive specifier.
During formatting the tape length is measured to determine the capacity of the wafer. The individual sectors on the tape are then created and verified, and finally the directory is written. Whilst this process is taking place, the border will flash and status information is displayed on the screen. The wafer capacity is measured in sectors with each sector corresponding to 1K bytes of storage. One sector is reserved for the directory and so the total program storage available is 1K less than the capacity of the wafer.
If you enter the FORMAT command in error, you will usually have enough time to BREAK before the wafer starts to be erased.
Since up to four passes round the tape are required during formatting, it is a relatively lengthy process. This is not really important since it is not often performed more than once or twice during the life of a wafer.
The formatting process should now be completed and the wafer is ready for use. The system will display the wafer capacity and whether any errors occurred during formatting. No errors should occur. If they do, it could be a sign that the wafer is damaged or worn, or that the drive read/write head is in need of cleaning (try again on the other drive). Wafers which consistently give trouble during formatting should be discarded – or at the very least treated with suspicion.
7
Rotronics Wafadrive - Manual.doc
PROTECTING AGAINST ACCIDENTAL ERASURE
Like cassettes and disks, wafers may be protected against accidental erasure or overwriting of stored data. This is done by removing the write protect tab which is on the left hand side of the wafer as it is inserted in the drive.
The original read/write status of the wafer may be restored by covering the recess with a piece of tape.
Wafers cannot be formatted if the write-protect tab has been removed.
Some pre-duplicated wafers will not have the write-protect tab removed. The programs on these wafers will usually have been recorded so that they cannot normally be erased or overwritten, although they will not be immune from formatting.
MAINTENANCE
The Wafadrive unit requires no more maintenance than does a conventional tape recorder. The main point to observe is that the read/write heads are kept clean so as to prevent loss of data.
The heads should be cleaned at intervals of 500 passes or so. It is performed simply by wiping with a clean, cotton-tipped stick, (of the type used to clean babies' important little places!), or by means of a special head cleaning wafer. Use no cleaning fluid.
8
Rotronics Wafadrive - Manual.doc

THE DIRECTORY

A directory of files is maintained on each formatted wafer. Every time a program is added to or deleted from wafer, the directory is updated automatically. When loading programs, the system first examines the directory to determine whether or not the file is stored on the wafer, and if so, its location.
DISPLAYING THE DIRECTORY
To look at the directory, or catalogue, of the wafer you have just formatted, make sure it is inserted in drive A and enter:
CAT *"a:"
The drive will start up, the border will flash and after a short while the screen will display:
1. The drive (A in this case), and the wafer name.
2. A list of names of the files stored on the wafer.
3. The type of each file (program, data or machine code).
4. The size of each file (in Kilobytes).
5. The number of files on the wafer.
6. The size of the wafer (in Kilobytes).
7. The spare capacity left on the wafer (in Kilobytes).
Of course, there are no files on the wafer as yet because it has just been formatted.
Once a wafer has been accessed, the directory will be stored in the computer's memory. To demonstrate this, perform CAT again.
This time the border flashes very briefly and the directory re-appears almost immediately.
The directory of a wafer in drive B is examined in exactly the same way, just change the drive specifier to
The maximum number of files that can be held in the directory is 32, although 16K wafers are physically limited to 16 separate files. If a long directory causes the screen to overflow, the message scroll? will appear, the same as with a program listing.
Incidentally, if you press the N key when asked scroll?, you will get the message BREAK -
CONT repeats
directory, you will be disappointed. The computer will "lock-up" – although BREAK will restore control. This is not the fault of the Wafadrive system, the same happens with ordinary program listings. See chapter 2 in the BASIC Programming Manual.
The Wafadrive system maintains a default drive. This allows the drive specifier to be dropped from Wafadrive commands when referring to a specific drive. When the system is first initialised, drive A is made the default. We can therefore simply enter:
CAT *
to display the directory of drive A. This applies to all Wafadrive commands that require a drive specifier. We could have used it when we formatted the wafer in the last chapter, although it is a good discipline to be specific when formatting to reduce the possibility of costly mistakes.
(upper or lower case).
"b:"
as usual. If you then enter
CONTINUE
, expecting to see the rest of the
The default drive feature simplifies the use of the Wafadrive and saves typing. You will find this feature most helpful if you use A as the general working drive, with B as the secondary drive.
9
10
Rotronics Wafadrive - Manual.doc
SETTING THE DEFAULT DRIVE
Should you ever want to, you can alter the default drive yourself using a variation of the CAT command. For example, to change it to B, enter:
CAT #"b:"
If there is no wafer in the specified drive you will get an error message. Apart from setting the default. CAT # also loads in the directory of the wafer without displaying it on the screen, thus ensuring that the version of the directory in RAM is valid for the wafer in the drive. This could be useful if we wanted to read the directory from BASIC for example (see chapter 9).
Entering:
CAT #
just causes the directory of the current drive to be loaded, without displaying it.
Another way to set the default – without loading in the directory – is to
POKE
one of the
extended system variables:
POKE 23767,0 sets the default to drive A POKE 23767,1 sets the default to drive B
Similarly, if you PEEK this location, you can determine which drive is the current default. Be careful to adhere to the above values: careless
POKE
s can be the equivalent of putting a spanner
in the works!
11
Rotronics Wafadrive - Manual.doc

STORING AND RETRIEVING PROGRAMS

SAVING
The procedure for saving programs on Wafer is very similar to that when using cassettes. Type a short program into your Spectrum – if you want an example, try this:
10 REM colours 20 FOR n=1 TO 704 30 PRINT INK 8*RND;CHR$ 143; 40 NEXT n
To save this, assuming you have a wafer in drive A, enter:
SAVE *"a:colours"
The program is first saved, then the directory of the wafer is updated indicated by the border flashing.
Since A is usually the default drive, we could have abbreviated the previous statement to:
SAVE *"colours"
From now on, commands will include the drive specifier to illustrate the syntax, but remember that it can be omitted when referring to the default drive.
As with names of programs stored on cassette, Wafadrive file names can be up to ten characters long (this does not include the drive specifier character and colon when used). Unlike cassette program names however, Wafadrive file names are always converted to upper case so as to avoid ambiguity. File names can take the form of valid string variables, as well as literal strings.
Now that the program is stored, examine the directory again. You will see that the name now appears (in upper case), with the file extension .PRG to Indicate that it is a BASIC program. Also shown is the file size (rounded up to the nearest Kilobyte).
When saving a program using the same name already exists on the wafer.
Note that there is no direct equivalent of the cassette SAVE...DATA command. This function is performed in a different manner on the Wafadrive (see chapter 7).
SAVE *
, a
File exists
error message will be displayed if a file of
12
Rotronics Wafadrive - Manual.doc
VERIFYING
The program can be verified by entering:
VERIFY *"a:colours"
Note that the file name may be specified in upper or lower case. The file extension is only something which appears in the directory. It is not part of the program name, and should not be included in Wafadrive commands. The command:
VERIFY *"b:"
checks the program against the first program appearing in the directory of the specified drive (in this case drive B), and:
VERIFY *
checks it against the first program appearing in the directory of the default drive.
The entries in the wafer directory are in chronological order so the first entry in the directory is always the earliest file to be stored on the wafer.
LOADING
Clear the program from the computer using
NEW #
. Now enter:
LOAD *"a:colours"
The program can be listed to check that it has been fetched correctly. The same comments apply to loading as to verifying, for example:
LOAD *
causes the first program that appears in the directory of the wafer in the default drive to be loaded in.
13
Rotronics Wafadrive - Manual.doc
ERASING
Assuming that the program colours is still in the computer; save it again, but this time give it the name test.
You should now have two versions of the program on the wafer. To erase the unwanted one you have just saved, enter:
ERASE *"a:test"
There is a wildcard facility that operates in conjunction with the ERASE command. This is best illustrated by an example. The statement:
ERASE *"a:te*"
causes all files begining with TE to be erased from the wafer in drive A. The asterisk takes the place of the missing letters. The statement:
ERASE *"a:*"
causes all files on the wafer to be erased. This feature can be very useful (it is a lot faster than re­formatting) but should be used with caution, for obvious reasons. To avoid confusion, do not use file names ending in asterisks. Note that the asterisk cannot be put at the begining of the file name:
ERASE *"*st"
Does not erase all the files ending in ST.
Commercially produced software is sometimes protected in a special manner. Protected files (indicated by a # suffix after the file extension in the directory) cannot be removed using the
ERASE command. These files can only be removed by re-formatting the wafer.
MERGING
The procedure for merging BASIC programs is straightforward. Enter:
NEW #
then type in:
100 REM colours II 110 CLS 120 FOR n=1 TO 704 130 PRINT PAPER 8*RND; INK 8*RND;CHR$134; 140 NEXT n
followed by:
MERGE *"a:colours"
whereupon the two programs will be combined as normal.
You can merge an auto-run BASIC program. The resultant program will not auto-run when merging is completed.
14
Rotronics Wafadrive - Manual.doc
SAVING USING AN EXISTING FILENAME
Normally, if you try to save a-program using a file name that already appears in the wafer directory, a File exists error message results and the program will not be saved. This is to prevent programs being accidentally overwritten.
Sometimes however, we may want any files of the same name to be overwritten. For instance, when developing a program on a small wafer, a cycle of two programs can be used to avoid having to repeatedly erase redundant programs, whilst retaining the last edited version as a back­up. In these circumstances we use a variation on the SAVE command – SAVE #.
At the moment, if you have been following the examples given, you will have a program in memory as a result of merging the two colours programs. We can cause this version to be saved instead of the original program thus:
SAVE #"a:colours"
The program will be saved, and the original version will be lost.
As a general rule, use SAVE * which of course protects against inadvertent overwriting of programs. Use SAVE # with care, and only when you are sure that there is no risk to anything of value stored on the wafer.
Protected files cannot be overwritten. Attempting to use SAVE # to overwrite a protected file will result in an error report.
AUTO-RUN PROGRAMS
BASIC programs may be made to auto-run on loading by using LINE, as with programs stored on tape. If you still have the colours program in the computer, enter:
SAVE *"a:autocolour" LINE 10
Examining the directory will show that the program autocolour appears with an asterisk after the file extension, indicating its auto-run status.
If you have followed the examples so far, you will have two programs on the wafer (in fact two versions of the same program). Load in colours then re-save it, with the same name, using SAVE #. This has the effect of making the autocolour program the first one to appear in the directory.
Now enter:
LOAD *
whereupon autocolour will load and auto-run.
If problems are experienced with loading a file, four attempts will be made before the system halts with a Faulty wafer error report. As usual, the BREAK key can be used to abort the loading process if required. During loading of protected programs however, the BREAK key is disabled. If a protected program fails to load, you should wait until the error report appears. If you are really impatient, you can pull out the wafer and start again, but this is not recommended.
Loading...
+ 31 hidden pages