• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

Interface information for 400KB Floppy drive

redrouteone

Well-known member
I have started work on a project to emulate the floppy drive used in the original Macintosh.

My goal is a device which is plug compatible with the Apple external 400KB floppy drive. It will store images on some sort of modern storage medium.

I have been reading up on the Integrated Woz Machine when I realized that I am studying the wrong part. I need to learn about the floppy drive. I am looking information on the floppy drive and how to interface to it. From there I should be able to design a device that has the same behavior. I have tried googleing it, but my google-fu is failing me.

We have some guys here that really know these machines inside and out, so I am hoping that someone can point me in the right direction.

 

Mac128

Well-known member
My goal is a device which is plug compatible with the Apple external 400KB floppy drive. It will store images on some sort of modern storage medium.
Thanks for taking up this project, whatever the outcome.

I presume you are looking for more than the pinouts.

 

Gorgonops

Moderator
Staff member
This is probably a really good place to start.

This device has insufficient memory capacity to replace a Mac drive, but that's just a detail. The unit supports emulating an Apple ][ drive, and IWM is *basically* the same as the Apple ]['s controller. Understanding this thing should pretty much tell you all you need to know.

 

redrouteone

Well-known member
My goal is a device which is plug compatible with the Apple external 400KB floppy drive. It will store images on some sort of modern storage medium.
Thanks for taking up this project, whatever the outcome.

I presume you are looking for more than the pinouts.
Yeah I've never interfaced to any sort of storage device before. So I really have no idea what data and commands the drive expects. So really if I could figure out how any floppy works that would be a good start.

 

Dog Cow

Well-known member
Yeah I've never interfaced to any sort of storage device before. So I really have no idea what data and commands the drive expects. So really if I could figure out how any floppy works that would be a good start.
The original Inside Mac volumes should help as well, since they describe the disk drive's hardware, controller lines, format, and such.

 

redrouteone

Well-known member
I took a look at Inside Macintosh. It did some useful information, but it mostly described the software interface to the disk controller. I am looking for information on the interface between the disk controller and the disk drive.

Really the thing is that I don't have a bloody clue how you make a floppy disk drive work. So I think I need to expand my search to floppy disks in general and then focus on the Mac drive.

 

porter

Well-known member
Really the thing is that I don't have a bloody clue how you make a floppy disk drive work. So I think I need to expand my search to floppy disks in general and then focus on the Mac drive.
A disk comprises tracks. Each track has a number of sectors. The mac makes things interesting in that

(a) it uses variable speed and more sectors on outer tracks

( B) it does not use the standard IBM MFM format.

A disk controller controls a drive by stepping the head in and out, and reading the data from the head. It's up to the controller to decode the series of sectors as read by the disk.

Each sector is preceeded by a header which says which sector number and track. Then a gap, then the data. When the data is written it has to wait for the correct sector header, then write the sector following the gap.

http://en.wikipedia.org/wiki/Group_code_recording Look for the work "Wozniak"

 

redrouteone

Well-known member
do you have an oscilloscope?
Yes I do, but is one of those cheap Radio Shack Scope Pens. I think it only goes to 2MHz, but that should work for this.

I think I am going to pick up on those USB Logic Analyzers. They are fairly inexpensive, I have found a couple for about $150.

Right now I am in the information gathering stage.

 

Osgeld

Banned
do you have an oscilloscope?
Yes I do, but is one of those cheap Radio Shack Scope Pens. I think it only goes to 2MHz, but that should work for this.

I think I am going to pick up on those USB Logic Analyzers. They are fairly inexpensive, I have found a couple for about $150.

Right now I am in the information gathering stage.
Well just the fact that you even have that pen (trust me I almost bought it many times before getting my tabletop eater 20mhz scope) makes me feel better about your abilities, reason why I would even care is because eventually I would like to do a similar thing with my //C (among other mods) ... but first I gotta get it working again we have strong mains in this area and it pushed an already failing cap over the edge, gotta muster up willpower and money to do a full restoration on it now heh

 

redrouteone

Well-known member
I've done some embedded systems work before.

In college my senor project was a 4'x2' display that showed the internal data flow of the pipe line of a MIPS process. I designed the controller for the nearly 500 LEDs that were on the display. It was a PIC that communicated with an IBM PC over RS232 and used a series of multiplexors, a few darlingtion arrays and a couple of latches to drive the LEDs.

I actually have a good understanding of digital logic, so my understanding of electronics is only so-so. So I have a lot of learning to do. Which is why I am looking for all of the manuals I need to read.

I purchased a Arduino Duemilanove from sparkfun along with the screw shield. The Screw shield is a kit so I get to pull out my soldering iron right away.

I figure I have a good set of information now. So now I need to read it in depth and start making notes. Then I figure I get the Arduino going and figure out how to do some basic I/O. It has been a few years since I programmed a Microcontroller so I have to dust off some of the ol' cobwebs. In fact I still have a whole box of PIC microcontrollers, but I don't have a programmer anymore. I figured I would give the Arduino a go because it is popular and has a low entry cost.

After a day and a half of reading I realize I have a long road ahead of me. I figure I'll first try to interface to the floppy and read and write data to it. That would also be helpful and modern systems can't read or write 400/800K disks.

I am really looking forward to this project, because right now storage is a black box that I understand how it works. I don't like black boxes.

 

redrouteone

Well-known member
For those interested my notes so far. I think I am going to go buy a printer, because I hate reading on the computer. Can't scribble notes on the pages that way. :-D

http://www.downloads.reactivemicro.com/Public/Users/David_Craig/AppleIWMSpec1982.pdf (IWM notes)

http://en.wikipedia.org/wiki/Group_code_recording#GCR_for_floppy_disks (GCR wiki page)

http://support.apple.com/kb/TA39910?viewlocale=en_US (Apple notes with some floppy info)

Apparently Apple II and Macintosh floppy drives work the same way. Information on the 16 Sector Apple II disk controller might help.

http://www.brutal-deluxe.fr/documentation/iwm/iwm_19840426.pdf (Software control of IWM on Apple II. This has good GCR information)

http://www.scribd.com/doc/200852/Apple-IIc-Reference-Manual-Volume-1-1984Apple0300814A (Apple IIc Reference manual)

http://www.1000bit.it/support/manuali/manuali.asp (Bunch of Apple Manuals)

http://www.willegal.net/phpBB3/viewtopic.php?f=3&t=5 (Post about building a Disk II Controller)

http://www.willegal.net/appleii/appleii-disk-int.htm (A Disk II to PC Interface)

http://www.weihenstephan.org/~michaste/pagetable/mac/Inside_Macintosh.pdf (Inside Macintosh. Has good information about the data structure on the disk and the software interace to the IWM, plus the Pinout for the conector)

http://www.scribd.com/doc/201423/Understanding-the-Apple-II-by-Jim-Sather-1983Quality-Software (Chapter 9 is the floppy chapter. It looks to have a lot of good information on how a floppy works and how the Disk II controller works)

http://bitsavers.org/pdf/westernDigital/FD179X_Data_Sheets_May80.pdf

(Data sheet for Western Digital floppy controller. Contains some good information about the signals sent to the IBM 3740 and System/34 Floppy drive)

http://pdf1.alldatasheet.com/datasheet-pdf/view/128746/NEC/WD37C65C.html (Western Digital controller used in the PC/AT. Mentions SA450 drive interface. What is that???)

http://www.bitsavers.org/pdf/shugart/39013-1_SA450_OEM_Manual_Oct80.pdf (Manual for the Shugart SA450 Floppy Drive. This is good. Read and understand this. Need a similar manual for the drive used in the Mac.)

viewtopic.php?p=2361 (Has information about the ROM version and compatible drives. Also has lots of good links about the floppy drives.

Looks like the Sony Model number for the 800K drive is MFD-51W or some variant there of. Need to find a manual for it. Which Sony Division made it. Looks like Sony Storage. DUH!!! The Sony part number for the 1.4Mb disk drive is MP-F75W-01G. ALso

* Sony MPF 42A

* Mitsubishi MF355F-592MA

* Mitsubishi MF355F-2592MA

* Mitsubishi MF355F-3592MA

http://sony.storagesupport.com/

Dosen't look like the sony manual is available on the internet. So we'll have to go buy what we have on the Disk II.

 

Osgeld

Banned
good selection of notes!

and I use arduino quite a bit, the programing of it is pretty easy, you should have little issue picking it up (ps if you have any questions and the arduino forum is acting up feel free to ask)

 

Gorgonops

Moderator
Staff member
For those interested my notes so far. I think I am going to go buy a printer, because I hate reading on the computer. Can't scribble notes on the pages that way. :-D
I don't know if you saw/skipped over the link I threw in about The Semi-Virtual-Diskette device, but if you missed it, well, just thought I'd point it out again. The page has complete construction details for a device that's capable of emulating the Apple Disk ][, including the source code for the PIC microcontroller. Unless you're intent on starting completely from scratch this device is already halfway there.

The thing that's "unique" about the Mac drive relative to the Disk ][ is the Macintosh 400/800k drives have a variable speed motor that turns at a different speed. (That's mentioned in the Apple knowledge base article you found.) This allows the drive to cram more sectors into the outer tracks of the disk than the inner ones without having to vary the data rate. What follows is a couple of completely pointless paragraphs I dreamed up which might help you visualize the situation in your head, assuming you're having any trouble. (Which you probably aren't.)

Floppy disks are like record players, in the sense that they read "from the outside in", unlike CDs and DVDs which read from the "inside out", in terms of what's considered "track 0". Imagine, say, a disk spinning slowly on a record player at a constant speed, say, one revolution every ten seconds, or 6 RPM. Pick up a piece of chalk and hold it against the record for one second, near the edge. (the edge is "track 0") You'll get an arc-shaped mark 1/10th of the diameter of the record. That's a "sector". Now take the chalk and hold it on the record for one second near to the hub. (In Mac terms this is "track 79") You'll also get a mark 1/10th of the diameter of the record *at that distance from the hub*, which means this sector is physically a lot shorter than the sector near the edge, as measured with a ruler. With "normal" disk formatting that's how sectors are written to a disk, same number of them per track from outside to inside. Since each sector contains the same amount of information in a sense you're "wasting" space on the outside of the disk, since in theory the magnetic medium should be able to retain data at the same density everywhere on its surface.

Now, imagine the same experiment with the record player, except instead of your hand with the chalk floating free you have a lever attached to the chalk which is connected to a potentiometer which controls the rotational speed of the record player. With this arrangement, the record player runs slower the farther you are from the hub. The record is still turning at 6 RPM when you're making chalk marks near the hub, but when you make a mark near the edge the record player is turning at only 4 RPM. Holding the chalk there for one second will make a mark only 1/15th the diameter of the record, meaning that near the edge you can fit 15 sectors instead of the 10 sectors you got with the constant speed record. The number of sectors per track diminishes as you approach the center, but the overall the sectors are closer to a uniform size then they are on the constant speed disk.)

Anyway. this is why, according to the Apple KB article, a 400/800K floppy disk has 12 512 byte sectors in tracks 0-15, while it only fits 8 in tracks 64-79. And thus the big difference between an Apple ][ disk, which has a constant 13 or 16 256 byte sectors on all 35 tracks, and a Mac disk. Looking at the Mac drive pinouts I just Googled there's a pin labeled "PWM" which says "Motor speed control". If you can find documentation as exactly what sort of signal is present on that port that's going to be the key to adapting a "constant speed" disk emulator design to working on a Mac. If the Mac directly drives the motor via Pulse-width modulation then I imagine you'll have to monitor that line and deduce how many pulses per second the Mac outputs at different disk locations. (And of course incorporate pulse counting into the finished unit so the microcontroller driver software behaves appropriately and provides the correct number of sectors to the Mac at at any given time.)

Blawblawblawyackityshmackity.

 

porter

Well-known member
Floppy disks are like record players
No they aren't. Floppy diskettes are like records. Floppy diskette drives are like record players. ;)

Also they aren't like records, a record has a single (or double in the case of Monty Python's Matching Tie and Handkerchief) groove which starts at the outside and finishes in the middle.

Whereas a diskette drive has concentric tracks. You may be interested to know that a CD also uses a spiral. Also it is important to mention the "index", this is a pulse given by the drive on every rotation of the disk and is used to mark the start/end of a track. This is how the reader knows if a sector is missing, ie, it does not read the disk forever waiting for the sector to appear, it reads until it has received two index pulses. This is also used during formatting so you know when to start writing out sector one on each track.

 

Gorgonops

Moderator
Staff member
Floppy disks are like record players
No they aren't. Floppy diskettes are like records. Floppy diskette drives are like record players. ;)

Also they aren't like records, a record has a single (or double in the case of Monty Python's Matching Tie and Handkerchief) groove which starts at the outside and finishes in the middle.

Whereas a diskette drive has concentric tracks. You may be interested to know that a CD also uses a spiral...
*snicker*

Yeah, I was glossing over the "spiral vs. track" bit because I figured it should be obvious once we're talking about "tracks" being discrete hops, but fair catch. I just wanted to make it clear that "track 0" is the *outside* edge of the disk rather then the center (because if you reverse it starts making very little sense why you'd want the disk to spin slower on the lower tracks and faster on the higher ones...), and since you start playing records from the edge... anyway.

Who knows, of course. These kids today might never have ever seen a record player in the flesh. ;^b

Also it is important to mention the "index", this is a pulse given by the drive on every rotation of the disk and is used to mark the start/end of a track. This is how the reader knows if a sector is missing, ie, it does not read the disk forever waiting for the sector to appear, it reads until it has received two index pulses. This is also used during formatting so you know when to start writing out sector one on each track.
The question here is whether the Mac uses an index pulse. The Disk ][ didn't, it just used a software timing loop to make a wild guess about how long a track was. Tellingly the Mac drive pinout appears to be missing an "index" pin.

 

Mac128

Well-known member
Looking at the Mac drive pinouts I just Googled there's a pin labeled "PWM" which says "Motor speed control". If you can find documentation as exactly what sort of signal is present on that port that's going to be the key to adapting a "constant speed" disk emulator design to working on a Mac. If the Mac directly drives the motor via Pulse-width modulation then I imagine you'll have to monitor that line and deduce how many pulses per second the Mac outputs at different disk locations.
The PWM signal is well documented in Inside Macintosh and Apple Macintosh Family Hardware Reference. A PAL reads the disk-speed buffer in RAM and generates a PWM. However, the 800K drive generates its own signal, without any signal from the Mac.

 
Top