Interfacing to WD37C65 floppy controller.

113 views
Skip to first unread message

Paulo Constantino

unread,
Jul 16, 2024, 9:40:37 PM (10 days ago) Jul 16
to retro-comp
Hi all.

I have a homebrew CPU/Minicomputer, Sol-1: sol-1.org,
and I want to add a floppy disk controller to it.  I have the WD37C65 controller IC.

I am unsure how to get started with this.  is there anyone here who could give me a hand or some advice?  I think I know how to wire up this chip, however, I have not much idea what to do after.  What should the procedure for using a floppy be? How should I format the disk? And how to read/write sectors afterwards?  I want to use 5.25" disks.

My CPU is homebrew, but in terms of capability it is similar to an 8088.

I am grateful for any help. Thanks a lot.

Paul

MartinR

unread,
Jul 17, 2024, 2:46:03 AM (10 days ago) Jul 17
to retro-comp
Have you looked as Scott Baker's design for a WD37C65 floppy interface at https://www.smbaker.com/z80-retrocomputing-part-14-rc2014-floppy-controller-boards? I use his design with my RC2014/RomWBW system and it works well. Admittedly that's a Z80/Z180 system rather than 8088, but his design, commentary and YouTube video might give you a steer on using that particular controller IC.

Good luck - 

MartinR

Alan Cox

unread,
Jul 17, 2024, 3:32:40 AM (10 days ago) Jul 17
to retro-comp
> I am unsure how to get started with this. is there anyone here who could give me a hand or some advice? I think I know how to wire up this chip, however, I have not much idea what to do after. What should the procedure for using a floppy be? How should I format the disk? And how to read/write sectors afterwards? I want to use 5.25" disks.

Hardware there isn't too much to say - signals on the drive side are
strange but the chip does all the work. Make sure you have good power
and ground (and for old drives good signal rails). For 5.25" 1.2MB
drives there is also some weirdness about speeds depending on the kind
of drive you have. PC style drives deal with the speed changes
internally.

> My CPU is homebrew, but in terms of capability it is similar to an 8088.

Your biggest problem will be timing. The 765 is designed for use with
a DMA controller. With a fast enough processor and interrupts disabled
you can make the needed timings in software but you have to be able to
read status bits, make a decision on a couple of them and loop or
fetch data and loop before the next byte of data is assembled by the
controller as well as work the DMA termination signal in software. On
a 4MHz Z80 with a 1.2MB drive you have just over 50 clock cycles per
byte to do it (or about double that or 360/720K floppies).

All the commands are in the manual, and the 765 is new enough it does
a lot of the timed stuff like head load for you unlike some older
controllers. Format is a command and you'll need to format the media.
I would strongly recommend doing that on a PC initially so you can
test stuff like seeking and read without having to wonder if your
formatting was correct.

You do have to babysit the chip. Timing delays required during command
issue are your problem. If you get errors it's your problem to tell it
to restore the head back to track 0 and find the track again after a
couple of tries. It's your job to do retries. It's your job to do
verify if you want it. And if the controller stops responding it's
your job to decide you've timed it out and issue a command to reset
it.

The FDU command source for ROMWBW is probably worth looking at as FDU
does pretty much everything.

https://github.com/wwarthen/RomWBW/blob/master/Source/Apps/FDU/fdu.asm

Alan

Les Bird

unread,
Jul 19, 2024, 11:06:43 AM (8 days ago) Jul 19
to retro-comp
Paul, 

Not sure if this is helpful to you but a while ago I was playing around with the WD37C65 for a board I designed. Working on it with another friend (who figured most of this out) I was taking notes on how to program for it. You can see my notes here: https://github.com/sebhc/sebhc/wiki/H8%E2%80%90FD%E2%80%90RS232#wd37c65-data-sheet-programming-manual

It's all in 8080 ASM to be assembled using the standard CP/M ASM utility but maybe you can get what you need from it.

Basically you build an 8 byte array of command bytes and send them to the controller and then wait for the results.

Good luck!

Les



Reply all
Reply to author
Forward
0 new messages