• Please review our updated Terms and Rules here

Interfacing a Floppy Drive Controller with Raspberry PI

BogdanV

Member
Joined
Jan 18, 2010
Messages
42
I'll be receiving my first RaspberryPI later this week and while looking over the documentation and tutorials on the net, it seems like quite a simple and versatile platform. Actually, I find the arm assembly to be easier than the x86 one.

So I was thinking on starting a project to keep me occupied for a while and learn some new stuff on the way as well: getting a floppy drive working through GPIO.
As a first step I was thinking on hooking up a Intel 8272 controller to Raspberry and issuing it some basic commands like querying the drive status.

To keep things simple I won't be using DMA just interrupts. And here I have no idea how the ARM11 compliant CPU in this device handles interrupts. The lack of standardisation compared to the x86 world is something I'll have to face.

I've found this article from Broken Thorn to be quite illuminating as to how the 8272 works. I reckon I should be able to write a driver in assembly to talk to it.

Do you think its reasonably possible? Is there anything in particular I should be especially careful of when working with the FDC (I haven't written any drivers for floppies not even on x86 so I don't have any experience in this) ?

Furthermore if you know of a more suitable controller than the 8272, something that's easier to program, I'm open to alternatives.
 
If you don't mind restricting yourself to 250Kbps (DD), the WD1770/1772 is probably easiest to work with. Pretty much everything you'll need is on-chip; just provide a clock and Bob's your uncle.

If you use a NEC 765/8272 (they're the same chip; NEC licensed the design to Intel) you're going to need a bunch of support circuitry, including a data separator and drivers/receivers for the floppy disk signals. Any of the later chips, such as the WD37C65 or NS 8473 will remove a lot of the support to the chip internals.

If you're just working with plain old 3.5" PC-formatted disks, why not use a USB floppy and forget about rolling your own?
 
Well, I wouldn't cry if I'd break a 3.5" drive but yeah my intention is to use 5.25" floppies.
That WD1772 is really sweet!

Although I can't seem to find anything cheaper than 10$ unless I bulk order from China.
 
I'll be receiving my first RaspberryPI later this week and while looking over the documentation and tutorials on the net, it seems like quite a simple and versatile platform. Actually, I find the arm assembly to be easier than the x86 one.

So I was thinking on starting a project to keep me occupied for a while and learn some new stuff on the way as well: getting a floppy drive working through GPIO.
As a first step I was thinking on hooking up a Intel 8272 controller to Raspberry and issuing it some basic commands like querying the drive status.

To keep things simple I won't be using DMA just interrupts. And here I have no idea how the ARM11 compliant CPU in this device handles interrupts. The lack of standardisation compared to the x86 world is something I'll have to face.

I've found this article from Broken Thorn to be quite illuminating as to how the 8272 works. I reckon I should be able to write a driver in assembly to talk to it.

Do you think its reasonably possible? Is there anything in particular I should be especially careful of when working with the FDC (I haven't written any drivers for floppies not even on x86 so I don't have any experience in this) ?

Furthermore if you know of a more suitable controller than the 8272, something that's easier to program, I'm open to alternatives.

Alan Page uses a Raspberry Pi to read floppies. He is using the SPI port and user space DMA. I think maybe you could use the I2S port or some timer input capture as well.
 
It doesn't take much to read a floppy--with sufficient memory, you could do it with an Arduino--I've done it with an AVR162 micro. Writing is a bit more problematical, time-wise. I suspect that Mr. Page also doesn't read individual sectors, but a track at a time.

At one time, here was, in the P1 era, a project to read a floppy using nothing more than a PC parallel port. It worked, after a fashion.
 
Tingo, the OP is looking to interface to a floppy drive, not emulate one. That being said, you could emulate a controller with a RPi, but that would be overkill, I think.

The old Microsolutions Backpack parallel-port drive used a NS 8477 and an 8051 along with some SRAM to do its job--it doesn't take much CPU horsepower if you have the FDC chip.

Since the parallel port interface to a Backpack drive is pretty simple, it might not be a bad ready-made solution if one can be found at a reasonable price.
 
Chuck, I know that. Surely you are not trying to say that the floppy drive are faster than the computer? My point being that both sides (floppy drive or computer) are connected to the floppy drive bus, using the same signals.
 
No, I'm just not sure what you're driving at. The OP was looking at connecting an RPi to an FDC. I suggested a couple and then you posted a link for an RPi floppy emulator, sort of the reverse end of the telescope. Sure, you can program an RPi to interface to a floppy drive, provide data separation AM search, write encoding and all the signals to run a floppy drive--but that seems to be a bit more ambitious than what the OP was looking for.

Not that you couldn't do it. A couple of years ago, I posted a bit using an ATMega128 driving a floppy and doing the above--and that, IIRC, was at 16MHz.
 
Tingo, the OP is looking to interface to a floppy drive, not emulate one. That being said, you could emulate a controller with a RPi, but that would be overkill, I think.

The old Microsolutions Backpack parallel-port drive used a NS 8477 and an 8051 along with some SRAM to do its job--it doesn't take much CPU horsepower if you have the FDC chip.

Since the parallel port interface to a Backpack drive is pretty simple, it might not be a bad ready-made solution if one can be found at a reasonable price.

There's a seller on eBay, selling new 3.5" drives for $39.95US I think. I'm, told you can pop the case open and connect the board to a 5.25" drive if you want also.
 
There's a seller on eBay, selling new 3.5" drives for $39.95US I think. I'm, told you can pop the case open and connect the board to a 5.25" drive if you want also.

You've been told right (by yours truly)--I even worked out the protocol and details to the Backpack parallel floppy drives (Microsolutions refused to provide it, even though we were buying them by the caselot directly from them. Strange people.) I posted the code here, maybe 3 or 4 years ago.

Back then there was a eBay seller who'd picked up a very large consignment of them and charged $0.99 plus shipping--and he'd even de-box them and re-pack them into a larger box for free.

eBay has gotten to be a lot less friendly since then.
 
Back
Top