Floppy Controller

For discussing the 65xx hardware itself or electronics projects.
Post Reply
jds
Posts: 196
Joined: 10 Mar 2016

Floppy Controller

Post by jds »

I've had a floppy drive working on my Rockwell Forth system for some time now, but haven't managed to document as I'd planned to, so I thought I'd post a picture of it here in the mean time.

The motivation for this is that the Rockwell Forth ROM has built in code for floppy disk control, so the software side is done. The documentation on this shows a block diagram of possible hardware using a Western Digital 1993 controller. This particular chip requires a lot of support circuitry to interface with a drive, but the newer 1793 has all of this built in, and the data sheet says that they are register compatible. So it should be possible to build a relatively simple controller using the 1793. This was a very common floppy controller back then and most of the more modern controllers were backward compatible (The main exception being the NEC 765 controllers).

So this is what I built:
IMG_0055.jpg
And with a bit of debugging and a couple of patch wires it actually works. These controllers are not fast enough for HD disks, so it should work with most 5 1/4 inch drives and up to 720k 3.5 inch drives, but not 1.44 MB drives. One of the little tricks I discovered is that I needed to cover the HD marker hole on a 3.5 inch disk to get it to work.

There are two patch wires, one was a simple mistake where I used the wrong address line, the other was a logic error that required an inverted signal that happened to be available.

The Rockwell software uses what is now a non-standard format and it took me a while to figure out parameters that worked, but eventually I managed to get it working reliably with what is a 640k capacity on a 3.5 inch disk. This is 80 tracks, 16 sectors per track, 256 byte sectors, double sided. The software loads 1k blocks and it seems very fast. I don't have a filesystem just block read and write functions. I haven't managed to get the Forth screen editing working yet, but this is probably down to my lack of experience with Forth.

To format a 640k 3.5 inch disk I used these words:

Code: Select all

320 B/SIDE !
80 0 FORMAT
And there is a word called R/W that can be used to read or write a 1k block.

I'm shifting houses soon, so this will have to go in a box for a few weeks at least, but I would like to try changing the format to be compatible with the IBM disk format so that I can transfer data from a PC to the Forth board. Maybe not a full FAT filesystem, but just being able to read and write Forth screens would be really useful.
User avatar
akohlbecker
Posts: 282
Joined: 24 Jul 2021
Contact:

Re: Floppy Controller

Post by akohlbecker »

Very cool! Can you share your schematic?

I've been planning on designing a floppy interface myself, though I picked up a WD37C65C instead (looks like a more recent chip?)
jds
Posts: 196
Joined: 10 Mar 2016

Re: Floppy Controller

Post by jds »

I'd guess that the WD37C65C would be similar, but probably includes the input and output registers that I implemented with the 74LS logic. So it should be an even simpler design. And it would probably support HD disks too.

Here's the schematic.
Attachments
floppy.pdf
(123.67 KiB) Downloaded 165 times
Last edited by jds on Mon Apr 25, 2022 8:50 pm, edited 2 times in total.
User avatar
akohlbecker
Posts: 282
Joined: 24 Jul 2021
Contact:

Re: Floppy Controller

Post by akohlbecker »

Looks like you posted the wrong file!
gfoot
Posts: 871
Joined: 09 Jul 2021

Re: Floppy Controller

Post by gfoot »

I'm currently building my own floppy controller from TTL parts, mostly for the experience and understanding what actually goes over the wire to the floppy drive. I have a working read circuit hooked up to an Arduino, and have planned the extensions to make it work well with a 6502 (latching the data, and having control registers to let the 6502 control the drive) but I haven't had time to actually go ahead and implement the extensions yet.

So far it's been much simpler than I thought it would be, but writing to the disc (while still working within the standard disc soft sectoring format) is going to be a whole new challenge as well!
User avatar
akohlbecker
Posts: 282
Joined: 24 Jul 2021
Contact:

Re: Floppy Controller

Post by akohlbecker »

Your videos are the reason I'm even thinking about this project myself! Sharing for anyone else reading https://www.youtube.com/watch?v=t-Cblankxqc
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Floppy Controller

Post by drogon »

gfoot wrote:
I'm currently building my own floppy controller from TTL parts, mostly for the experience and understanding what actually goes over the wire to the floppy drive. I have a working read circuit hooked up to an Arduino, and have planned the extensions to make it work well with a 6502 (latching the data, and having control registers to let the 6502 control the drive) but I haven't had time to actually go ahead and implement the extensions yet.

So far it's been much simpler than I thought it would be, but writing to the disc (while still working within the standard disc soft sectoring format) is going to be a whole new challenge as well!
Steve Wozniac was master of this in the Apple II - not only did he design the stripped down interface he realised he could use a different way to encode the data on the disc surface to increase the density from ~80KN to 130KB in DOS 3.3 ... His software replaced a lot of very expensive (at the time!) hardware.

Go for it :)

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Floppy Controller

Post by BillO »

jds wrote:
I'd guess that the WD37C65C would be similar, but probably includes the input and output registers that I implemented with the 74LS logic. So it should be an even simpler design. And it would probably support HD disks too.

Here's the schematic.
Well, that's the simplest FD controller I've ever seen. Not sure it will work though. :lol:
Bill
jds
Posts: 196
Joined: 10 Mar 2016

Re: Floppy Controller

Post by jds »

akohlbecker wrote:
Looks like you posted the wrong file!
Fixed now, sorry about that. I used print to PDF and picked up the file from the wrong directory.

I'll try and put the whole KiCad project on Github sometime. I've got some spare PCB's if anyone wants one, but I suspect that they are not that useful to anyone else as it required a particular expansion bus. I based it on the Apple II bus without worrying about being completely compatible, it is intended to work with my own backplane board. I don't have an Apple II to try it, but it might possibly work in one. That's maybe something worth thinking about.
jds
Posts: 196
Joined: 10 Mar 2016

Re: Floppy Controller

Post by jds »

This is the floppy interface diagram from the Rockwell Forth Manual:
RockwellDiagram.png
jds
Posts: 196
Joined: 10 Mar 2016

Re: Floppy Controller

Post by jds »

I've just had some fun getting the Forth screen editing working, maybe this should be in the Forth section as it's more software. The hardware appears to be working correctly, but Forth is unforgiving of user error or lack of knowledge. The low level R/W word was working, but the screen commands would just hang and require a reset. It turns out that this is because of my RAM configuration. So I need a little bit of setup before it all works:

Code: Select all

320 B/SIDE !
HEX
1000 MEMTOP
And after that I have full disk based screen editing, which is a lot nicer than trying to transfer files from the terminal.

Forth is starting to make more sense to me now.
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Floppy Controller

Post by fachat »

drogon wrote:
gfoot wrote:
I'm currently building my own floppy controller from TTL parts, mostly for the experience and understanding what actually goes over the wire to the floppy drive. I have a working read circuit hooked up to an Arduino, and have planned the extensions to make it work well with a 6502 (latching the data, and having control registers to let the 6502 control the drive) but I haven't had time to actually go ahead and implement the extensions yet.

So far it's been much simpler than I thought it would be, but writing to the disc (while still working within the standard disc soft sectoring format) is going to be a whole new challenge as well!
Steve Wozniac was master of this in the Apple II - not only did he design the stripped down interface he realised he could use a different way to encode the data on the disc surface to increase the density from ~80KN to 130KB in DOS 3.3 ... His software replaced a lot of very expensive (at the time!) hardware.

Go for it :)

-Gordon
Sorry ro spoil the fun ;-)

Woz' data format was far from optimal, Commodore GCR and MFM were even more bits per inch.
https://extrapages.de/archives/20190102 ... notes.html

Where he excelled was the optimization into as few chips as possible. So much that, that it relied on exact CPU timing, and as far as urban myth goes, prevented the 65816 from becoming even faster. It had to introduce NMOS type bogus cycles that weren't necessary to not break the Apple II disk interface when they switched.
So we all still suffer (a bit ;-) ) today from this optimization.

But that just as a side note. I'm working on my own floppy controller, so I totally understand the desire to understand all that!

André
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Floppy Controller

Post by BigEd »

Thanks André, once again, for your floppy notes - an excellent resource!
User avatar
BigDumbDinosaur
Posts: 9428
Joined: 28 May 2009
Location: Midwestern USA (JB Pritzker’s dystopia)
Contact:

Re: Floppy Controller

Post by BigDumbDinosaur »

BigEd wrote:
Thanks André, once again, for your floppy notes - an excellent resource!

Yep! I’ve read it and it is very interesting.
x86?  We ain't got no x86.  We don't NEED no stinking x86!
Post Reply