• 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.

FDHD internal registers

onlyonemac

Well-known member
I'm trying to find documentation for the internal registers of the FDHD. I've seen numerous references to there being internal registers in the FDHD, but the only details that I have been able to find regard the registers in the SWIM chip (or some other associated part), not those in the FDHD itself.

I'm guessing that the information must be out there somewhere, as obviously BMOW must have needed that for his Floppy Emu. I have tried to reverse-engineer his CPLD design, but I am not familiar with CPLD design tools and it would be much easier to just read the relevant original documentation.

 

onlyonemac

Well-known member
I am not programming the SWIM chip. I am trying to be the floppy drive, with the SWIM chip programming my registers. Therefore I need documentation on what registers are in the floppy drive itself.
 

Guide to the Macintosh Family Hardware said:
The signals PH2 through PHO, from the SWIM, together with the signal SEL, from the VIA,
make up the state-control lines used by the disk interface to select registers in the floppy
disk drives. The signal PH3, from the SWIM, is used for writing data to the registers in the
floppy disk drives.
 

onlyonemac

Well-known member
what are you trying to accomplish? the floppy emulators are already out there... 
So? I want something that:

-uses real floppy disks and and old PC drive that I had lying around

-doesn't cost 89$

-can be built using parts from my existing electronics collection

 

bigmessowires

Well-known member
If you've looked at my CPLD source code, the internal floppy disk registers and their meanings are described in a big comment table, right at the top of the file: no reverse-engineering necessary. It's basically the same set of registers, whether it's the Sony 400K, 800K, or 1440K mechanism. The registers are used to do things like turn the drive motor on, step one track in or out, measure the drive's rotation speed, and read data from a track. And yes, these are not the same thing as the IWM or SWIM's registers.

The internal floppy disk registers are also described in this developer doc from m68k-linux, which refers to them as "Disk Drive Status and Control Bits. Scroll down to the paragraph that begins "In addition to programming the IWM, it is also necessary to program the drive itself": http://www.mac.linux-m68k.org/devel/iwm.php

 

bigmessowires

Well-known member
Yup, for sure you'd have fundamental problems if you wanted to use 400K or 800K disks, due to the variable rotation speed used with those disks. For 1440K disks I think it should be possible to interface a PC floppy drive, at least in theory, but it would be pretty complicated. Like you said, it's a radically different interface. You'd need some kind of microcontroller/CPLD/FPGA/something that handled all the communication with the Mac, and simulated those internal floppy disk registers. Then it would need to translate to equivalent but completely different communication with the PC floppy drive. For some stuff like sensing track 0, this would be relatively straightforward. Other stuff would be harder, because there's no PC floppy equivalent. For example, what should you do when the Mac tries to eject the floppy? Or when the Mac tries to check the track stepping progress state, which has no equivalent on a PC floppy drive? But if you're determined enough, I think those issues could be overcome. It would be an interesting project. Good luck.

 

onlyonemac

Well-known member
If you've looked at my CPLD source code, the internal floppy disk registers and their meanings are described in a big comment table, right at the top of the file: no reverse-engineering necessary. It's basically the same set of registers, whether it's the Sony 400K, 800K, or 1440K mechanism. The registers are used to do things like turn the drive motor on, step one track in or out, measure the drive's rotation speed, and read data from a track. And yes, these are not the same thing as the IWM or SWIM's registers.
I wasn't sure which was "the source code" file for the CPLD, otherwise I would have probably found what you are referring to. But I did find the information that I needed in the documents provided by one of the previous posters.

Yup, for sure you'd have fundamental problems if you wanted to use 400K or 800K disks, due to the variable rotation speed used with those disks. For 1440K disks I think it should be possible to interface a PC floppy drive, at least in theory, but it would be pretty complicated. Like you said, it's a radically different interface. You'd need some kind of microcontroller/CPLD/FPGA/something that handled all the communication with the Mac, and simulated those internal floppy disk registers. Then it would need to translate to equivalent but completely different communication with the PC floppy drive. For some stuff like sensing track 0, this would be relatively straightforward. Other stuff would be harder, because there's no PC floppy equivalent. For example, what should you do when the Mac tries to eject the floppy? Or when the Mac tries to check the track stepping progress state, which has no equivalent on a PC floppy drive? But if you're determined enough, I think those issues could be overcome. It would be an interesting project. Good luck.
I was using a microcontroller to implement the floppy drive functionality and I was going to use a system involving a way to signal to the user to eject the disk and then have the microcontroller wait for the disk to be removed before it will raise the "disk inserted" signal again on the Mac side. For the head stepping thing I was going to implement a "safe" pre-programmed delay. But I've shelved the project for now, as my microcontroller was not fast enough for the project. I might some time either get a faster microcontroller or re-implement it using discrete logic devices (although that will be difficult for some of the more complex issues such as the eject signal and the head stepping).

 
Top