Repairing the Amstrad CPC6128 floppy drives
The Amstrad CPC6128 (and Amstrad CPC664 for about 6 months before the CPC6128), was supplied with a relatively rare 3" (not 3.5") single sided floppy drive. They were used in a few other computers, including the Amstrad PCW82xx range, and some Sinclair Spectrum computers (Amstrad bought Sinclair's computer assets in the mid-1980s).
Thanks to a generous donation by a LCA2018 attendee, I now have two Amstrad CPC6128 units -- my original one, and a second one that had spent 20 years sitting in someone's garage (it was very dusty and needed a lot of cleaning!).
Because the 3" drives are relatively rare, both the 3" floppy discs (CF2) are fairly rare and rather expensive, and the drives need to be repaired, rather than trying to find a replacement drive. The drives essentially only exist in 30+ year old machines, and are likely to need repair themselves. The 3" floppy discs were over NZ$10 each new in the 1980s, and used 3" floppy discs are still around NZ$10 each second hand in 2018; I bought five (5) "new old stock" -- ie, unopened shrink wrap -- 3" discs earlier this year for NZ$75, which seemed about the going rate.
Other than general cleaning of the floppy drive, of 30+ years of accumulated dust and grime, they also need lubricating the stepper motor worm drive, and inevitably the floppy drive belt needs replacing. The floppy drive belt runs between the capstan connected to the motor for the spindle (near the back of the drive) and the drive spindle (in the centre!) to spin the disc, and is made of thin (about 0.5mm rubber) and over time dries out, goes tacky, and breaks (like most rubber).
DataServe Retro, in the United Kingdom provides an excellent service supplying replacement parts/kits for servicing the drives, as well as detailed instructions on servicing the drives. A few other people have also posted their instructions on repairing the drive, and there is also a video demonstration of the most common problem with the Amstrad CPC6128 drive, and replacing the drive belt to repair it. (See also repairing an Amstrad FD1 external drive, and replacing the Amstrad CPC6128 drive write protect sense pin; also for completeness an Amstrad CPC464 overview from the same site.)
I had previously tried to replace the drive belt in my original Amstrad CPC6128 in 2004, with a drive belt purchased locally based on trying to measure the (broken) disc belt -- and it almost worked, but only sort of worked if the drive was already spun up to speed, so it required a lot of "R"(etry) attempts to do anything. That unreliability was the main reason why I did not try to copy the 3" discs back in 2004 when I imaged a lot of other floppy discs.
Given that I now had two Amstrad CPC6128s, neither with a working disc drive, I decided it was worth trying to replace both drive belts. Due to the distance and international postage costs, I bought the Amstrad CPC6128 drive servicing kit and a twin pack of drive belts (for a total of three drive belts) as well as a spare write protect pin just in case (which turned out not to be needed; I believe one of my drives does use the write protect sensing pin, but I was very careful not to turn the drives over during the belt replacement, having been forewarned of problems, so it appears the existing pin stayed in place).
I also bought some second hand CF2 3" discs, and another set of Amstrad CPC6128 original system discs (CP/M Plus, CP/M 2.2, utilities, etc) just in case my originals were unreadable due to age. (It appears they are now sold out of second hand CF2 3" discs.)
In both cases, replacing the drive belt was fiddly, but possible. I had two different 3" drive models (archived version) to work on in the two systems (assembled about 9-12 months apart), but the same drive belt worked for both of them, despite the fairly different internal geometry. Based on the pictures I believe the drive in my original Amstrad CPC6128 is an EME-150A (archived version; the original model, manufactured by Matsushita); the drive in the Amstrad CPC6128 I was given was labelled as an EME-156 (archived version; which does use a mechanical sensing pin for write protect; in hindsight, I did see the sense switch, but I did not see the pin itself -- fortunately I was very careful not to turn the drive upside down while it was open, and writing to the discs still works, so apparently the pin is still in place).
My original Amstrad CPC6128
The locally obtained (2004) replacement (wrong size) drive belt, in my original Amstrad CPC6128, was fortunately still intact, so I had very little cleaning to do on that drive and it was a fairly quick replacement. The drive appeared to work properly immediately after reassembling it with the correct drive belt replacement, which was extremely pleasing -- I was able to copy the spare system discs onto one of the spare floppies immediately without errors.
Comparing the locally obtained drive belt from 2004 with the exact replacement part from DataServe Retro, I found that my guessed replacement part was 10mm too long (circumference) and 0.5mm too wide. I assume my original drive belt had stretched in addition to breaking, before I measured it, causing me to overestimate the required length of the drive belt (I had ordered a 72mm x 0.5mm x 3mm flat belt in 2004; I believe the the 72mm is a notional diameter, assuming the belt is laid out as a circle. That dimension probably relates to the manufacturing process.)
As best I can tell from measuring it, the exact replacement belt is about 70mm x 0.5mm x 2.5mm -- about 2mm smaller in diameter, which works out to 7-10mm shorter in circumference (it may be a notional 69mm, but I think it is 70mm; I measured it as about 220mm circumference). That explains why my guessed replacement drive belt in 2004 sort of worked -- it was slipping a bit, but if the disc was up to speed it was almost close enough to keep it spinning. (Ironically if I had realised at the time I could have ordered the slightly shorter belt; I suspect the 2.5mm/3mm width difference might work as the capistan is pretty wide, but the 2.5mm width fits the spindle better. Since 2004 the local distributor of drive belts I used appears to have gone out of business, or at least taken their ordering website down.)
Second (donated) Amstrad CPC6128
The second Amstrad CPC6128 -- very dusty from 20 years in a garage -- was more difficult to get working properly. The drive belt had snapped, but fortunately just in one place, so it was fairly easy to clean the capistan and replace the drive belt. However, getting the head stepper motor/worm drive working properly was rather more difficult, and after a small amount of use the drive started squealing loudly at times when the disc was spinning. I ended up:
taking the drive apart a second time, and cleaning it again, including taking the drive belt off again and cleaning the capistan/spindle a second time;
lubricating the stepper motor worm drive a second time;
lubricating the top mounting point pressure plate of the drive spindle and the botton of the spindle mount point, as well as the capistan itself
exercising the drive a lot to encourage the stepper motor worm drive to pick up the lubrication added.
Initially after the first cleaning/drive belt replacement the head
stepper motor was totally stuck. It took it took multiple very noisey
attempts to use the drive before it managed to break free of its stiction
and get back to track 0 so "cat
" would work. After that it took several
more attempts to get it to even step to the second track reliably, and many
more attempts to get to the point where it could format/verify/copy an
entire disc and sound like it was working properly.
After several hours of effort it appears the second drive is pretty much working reliably, but I do not yet trust it as much as my original Amstrad CPC6128 drive given how long it spent accumulating dust in a garage.
For cleaning I just used isopropyl alcohol (fairly easily obtained from electronics supply stores), and cotton buds. For lubrication I used Abloy Lock Oil, mostly because I already had it and it is designed not to pick up additional dust in use (DataServe Retro recommend a grease like vaseline, on the stepper motor worm drive, but I did not have any at hand). I guess time will tell whether I made the right choice on lubrication (the main thing I would stress is to use small amounts of lubricant -- the last thing you want is excess lubricant spun out over the floppy discs during use!).
Exercising the Amstrad CPC6128 floppy drive
From BASIC
From BASIC the main way to exercise the floppy drive is to try loading
or saving BASIC programs from the floppy disc. To do this I used one
of the secondhand CF2 3" discs that I had bought, so I could test with
a disc that I knew did not contain anything important. (While it would
have been possible to attempt to read from a disc with existing data
on it, I was reluctant to trust a disc with existing data on it to the
"not yet working properly" drive, so stuck with just trying simple
cat
/load
/save
commands on known reformatted disc.)
My initial attempts with the dusty Amstrad CPC6128 were:
get a disc catalogue -- with
cat
-- to force the drive to read from track 0 (and thus pulll the drive head back to track 0)write a tiny BASIC program (eg, a few lines) and then save that to the disc under multiple names:
save "test1 save "test2 save "test3
and so on. It appears the fourth or fifth copy of a 1KiB program saved involves stepping to the second track, which proved problematic for a while (and at one point it appeared to write track 1 over track 0, which caused "
cat
" to no longer work on that disc -- eventually fixed again by reformatting that side of the disc again after I had the drive working better; see below).try loading BASIC programs back off the disc (eg, reset and load the tiny program I had written).
Doing this repeatedly got the drive to the point where it could move the head enough to read in the CP/M boot disc (which it was not able to do so at first). Then I was able to exercise the drive more from CP/M.
From CP/M Plus
On the Amstrad CPC6128, the only official way to format or copy a whole disc is from CP/M Plus, which needs to be booted from disc -- the first system disc supplied with the Amstrad CPC6128 (or in my case also bought as a second hand copy). It took me some time to find/remember how to format discs or copy them, and it does not appear to be very well documented online, so I am recording the instructions from the Amstrad CPC6128 manual -- Chapter 1 Pages 39-42 -- here for future reference (by me, or someone else).
To boot up CP/M plus, insert side 1 of the system discs, and then type:
|cpm
where the "|" introduces a RSX command -- basically a extension command for AMSDOS, the disc system for the built in Amstrad CPC BASIC; there were about a dozen commands built in to the system ROMs, and lots of third party ROMs, discs, peripherals, etc, defined their own RSX commands.
Typing "|cpm
" causes the Amstrad CPC6128 to read CP/M off the disc
in the first disc drive -- which is expected to be a "System Disc" -- ie
with boot sectors, and a copy of the CPM system image. Actually booting
CP/M Plus involves reading about 30KiB off the disc, which requires reading
multiple tracks -- so on the rather dirty Amstrad CPC6128 drive it took
multple attempts and other drive exercise/cleaning before it would seek
well enough to boot CP/M Plus.
Once CP/M Plus has booted to the prompt announcing it is drive A
, it
is possible to work with whole floppy discs by running:
disckit3
which is a menu-based program for copying, formatting, and verifying floppy discs. It can work either with one disc drive (in which case copying discs involves changing discs several times) or with two disc drives (if you have an external drive).
From the disckit3
menu, you have the choices of:
f7
: Copy discf4
: Format discf1
: Verify discf0
: Exit from program
These are selected using the function keys at the right hand side
of the keyboard, even
though the menu displayed on screen shows just 7
/ 4
/ 1
/ 0
-- you
just have to know to use the function keys :-( Invalid keys just result
in a system bell beep as the only feedback, so it was initially very
confusing until I found the relevant manual pages and reminded myself to
use the function keys at the right.
For exercising the drive (ie, the dirty problematic Amstrad CPC6128 drive) the best options are:
Verify disc (which will try to read the whole disc); and
Format disc (which will reformat each track of the disc)
both of which involve seeking to every track on the disc. I did both about a dozen times on the problematic drive, and eventually -- after a second cleaning -- it seemed to start moving freely enough to work properly. (I believe "Verify disc" only checks that it can read each sector/track of the disc, without actually checking the contents beyond the sector checksums; but for forcing the drive head to step it is ideal if you have an already formatted disc to test with.)
When formatting a disc you have three choices of format:
f9
: System formatf6
: Data formatf3
: Vendor format.
: Exit menu (back to the top menu)
The system format, data format, and vendor format use different sector numbers, but have the same native capacity -- 180KiB. The system format has a copy of CP/Ms boot information on it (and when formatting a system disc it will first ask for an existing system disc to read the required system tracks); the vendor format is the same as the system format, but without the system tracks initialised (just the space reserved). The data format uses different sector numbers, and makes most of the native space available for storing data (178KiB usable, with 2KiB reserved for directory information; by comparison the system and vendor formats have 169KiB usable).
Once I had exercised the problematic drive enough that it appeared to be working reliably, I then copied the original CP/M Plus system disc that I had purchased onto one of the second hand CF2 3" reformatted discs, so that I could use that instead of the originals (this is also recommended early on in the Amstrad CPC6128 manual).
To do this, boot CP/M Plus and start disckit3
(as above), then:
Insert the CP/M Plus system disc (if it is not already inserted)
Press
f7
to Copy a discPress "Y" to confirm you want to start copying the disc
On a single drive system,
disckit3
will now read the first 15 tracks into RAM (67 KiB, which interestingly is larger than the 61KiB CP/M TPA, so I assume it is also buffering some of the data in the second 64KiB RAM bank...)When prompted to insert the disc for
WRITE
, remove the original and insert the blank disc to be overwritten, then press a key to continue. It will write out the first 15 tracks to the new disc.After the first 15 tracks are written, it will prompt you to insert the disc for
READ
, and then when you press a key to continue, it will read the next 15 tracks into RAM, and prompt you to insert the disc forWRITE
. When you swap discs and press a key to continue the next 15 tracks are written out.On the final pass, you are requested to insert the disc to
READ
, and when you press a key the final 10 tracks are read into memory, and then written out to the copy after you insert the disc toWRITE
and press a key.
If you are doing this on a single drive machine it is very good practice
to write protect the READ
disc, and write enable the WRITE
disc, to
minimise the chances of inserting the wrong disc at the wrong time in the
six disc swaps. (The program does check that you removed/inserted a disc,
but obviously cannot easily check which disc you inserted!)
With a second hand disc and second hand drive, using the "Verify disc" function at the main menu after copying the disc, to check that the copy is readable, is probably also a very good idea.
(From memory with two disc drives connected, it will simply copy all tracks from A: to B: without needing further user intervention beyond putting the discs in the right drives and confirming you want to overwrite the destination disc. No disc swaps required, which means the chances of inserting the wrong disc at the wrong time are pretty low; but I would still suggest write protecting the source disc just to be safe!)
Alternative disc formatting
While there is no user accessible routines to format a disc from AMSDOS, there are some hidden RSX functions, which can be called from machine code, to format a disc, using a combination of Seek Track and Format Track. (They cannot be called directly from AMSDOS, as their names are non-ASCII characters.)
While hunting for a way to reformat floppy discs on the Amstrad
CPC6128 (partly to exercise the drive, partly because non-working
seeking had caused track 1's information to overwrite track 0 on
one of my test blank discs), I came across a blog post providing
a BASIC listing that loaded a RSX to format a disc from
AMSDOS (archived
version.
It is a fairly short assembly program, with a HEX loader in BASIC,
small enough that it could be typed in by hand if necessary. I
have not used it as I eventually got CP/M Plus to boot even on the
partly working drive, so used disckit3
from the CP/M Plus system
discs instead. But it could be useful for systems without any
working system discs. (The blog post includes a simple, uncommented,
disassembly of the source code, which does not confirm it is using
the hidden RSX functions, but given the short length that seems
likely. There is also a
format.dsk
linked from this CPC forum
thread,
apparently including source, which I asume is likely the same one.)
Of course given that the Amstrad CPC has no memory protection/IO
controller, at all, with care (to avoid anything else accessing
the drive) it would also be possible to send raw seek/track format
commands to the NEC 765 floppy controller directly. I suspect that
would also require some machine code assistance, to issue IN
and
OUT
instructions
(see also Z80 Assembly
Guide and
other Z80 Programming
Information;
Locomotive BASIC has PEEK
,
POKE
,
to access memory, but not anything to access the IO bus. I assume
direct instructions to the NEC 765 floppy controller is how the
various alternative disc format
tools
worked.