I worked at Phoenix Technologies when we put the 3.5" 2.88mb boot code in the BIOS. You made me smile. Shortly thereafter, the USB came along and floppies went bye-bye.. Thanks for the trip down memory lane.
Could you please tweak the circuit for WD1793 with a latch and data separator?! .. this could be useful to interface your design to 4Mhz 8-bit machines ;).. Thank you!
Would the WD37C65 work with old single density 8” floppies too? I’ve got a bunch from my Xitan S-100 system back in the day. I remember modifying the BIOS code on it to support a floppy disk controller card based, I think, on a WD3791 controller. The Xitan still sits in my basement, but bringing it back to life shouldn’t have to be on the critical path of reading the old floppies.
What are the odds you can build all this into a box that one can install a 5.25" floppy drive into, to be able to connect to a modern PC via USB? That has always been a missing link for those that want to bring files that are found online into an IBM PC-XT type machine that doesn't have a 3.5" floppy drive.
The kernel is probably easier to work in directly than you remember. There are tons of sub-systems/frameworks that implement most of what you want to do most of the time and causing the kernel to totally lock up with no clue about what you did wrong isn't easy. I guess you don't even want a block device really. A simple char device that contains the time sensitive/interrupt driven bits of your current python code would probably be enough.
Very cool project - I'm just wondering that you managed to connect a 5V device to RPi's 3V3 GPIOs without any level shifting? Are RPi GPIOs 5v tolerant or am I missing something?
Checked it with the scope and the data pins are indeed driven all the way up to 5V. Doesn't seem to hurt anything, though I'll probably pull the shunt and throw a resistor back in its place for a little margin of safety. Next board revision will get a proper level shifter. One of these days I should do a study to see how much voltage a pi gpio, when configured as input, can be exposed to before damaging it. I had originally designed in a level shifter, then I looked up in the datasheet and apparently misinterpreted the high level DC output characteristics as being 2.8V/5ma, when that's actually the minimum, not maximum.
@@smbakeryt I assume that adding a simple 1k resistor pack for the data bus is enough, at least for these speeds. The esd clamp diodes on the pins will limit the voltages (and also limit the maximum speed it can handle when using more voltage than the SoC vcc for io). However, it'll be nice to watch that video you'll create. Note that a pin might not be damaged as soon as you apply that much voltage on it, and might take a lot of time to do so
I imagine they're fairly low current so they aren't taking a beating (since they'll get clamped anyways by the protection diodes). That said, it could potentially wear them down over time.
Something like this will have uses far beyond what you can possibly think of at the moment. This is a great idea. One thing, how difficult is it to obtain those controller chips these days? If this were to be a mass produced (or at least, several thousands type volume) then it seems like there could be supply issues.
Great video. Looking at your GitHub files supporting this I'm surprised that the host computer still needs to interpret the bitstream pulses from the FDC and then do the FM/MFM decoding - I might have expected the FDC to do the heavy lifting and present the actual user data in each sector to the host computer: was this how it was always done?
Working on a project that uses an 8 bit bi directional bus to the pi curious how you wrote bytes to the 8 bits. I have the answer I’ll go get your code from the repo... Thanks for posting this video and the pointer to running the process on an isolated core I’m going to give that a try to get some more performance. Glad someone else is hooking up old stuff to pis.
This is crazy awesome. With your inspiration I'm now wondering what it would take to build an Amiga diskette controller. One of my Amigas has an IBM floppy drive. I just might have to cannibalize it to try out your wizardry. Thanks for sharing your talents!
i think it would be very interesting to adapt a commodore 1541 floppy drive (variable speed) on a raspberry pi, since original 1541 have that thermal issue and are kinda big. you then could implement the original serial bus of c64 and/or usb or samba share
I am happy to see it works with all types of floppy drives. I have the 1.2 version made by Mitsubishi which I’m using to building for a retro PC. Now I could potentially use for my pies 🥧 as well. Provided I can get my hands on that floppy controller board! What’s your sale price for the board?
Greetings from Brazil. I’m enthusiastic of retrocomputers. However it’s getting harder to fix or find someone to help fixing such devices. I’m trying to emulate trs80 at raspberry pi and I’d love to control de floppy drive. How can I order one of yours? Thank you.
I would think that a kernel driver should not be too hard because I'm sure Linux already supports this and other similar floppy controllers... I'd say it's a matter of finding the code in the kernel tree, forking it and creating a gpio bridge of some sort. And I wouldn't be surprised if something already thought of making a gpio bridge to connect common PC hardware such as IDE drives and floppy controllers... (I have no experience in this, my Linux knowledge does go back a long way but I haven't kept up in recent years)
@@roysigurdkarlsbakk3842 Good to know, I'll check it out (I am all about some 6502 emulators, and Basilisk II for Classic Mac, but have never delved into PC emulators, except through VirtualBox).
I got the Pi 4B 8GB in the Vilros keyboard/touchpad hub and am switching the dongle to the Acute Angle PC from Ali-Express for Windows 10. I love Berryboot and got a CD ROM Drive and floppy Drive I am going to try out for Windows 95.
Writing sector by sector is one thing. I need to pull files off before the media disintegrates, and that mean’s understanding exactly how to reconstruct them via the file directory. Anyone know where to get FAT12 and FAT16 specs so I can do that in Python? Someone has to have done it already…
@@smbakeryt Thanks. And do you have the gerber file for the Raspberry Pi Floppy Controller PCBOARD? I would like to print it and solder the components.
Just build a bluepill greaseweazle, and hookup a floppy drive to it and connect that to your pi. github.com/keirf/Greaseweazle/wiki/Blue-Pill-Adapter Supports tons of formats, and dirt cheap. Uses flux, so can handle 3"/3.5"/5.25" Disk Low and High Density. MFM and GCR. But for a Pi project, this is cool.
OMG, I have a couple of MFM drives from Compaq Portables. If I could test them without resurrecting an old 8088 or 8086 PC, that would be supercool. I wonder if they could even do low-level format. 🤔
I did use C extensions for the block transfer routine, though python may well have been fast enough to do it on its own. The key is that bytes must be transferred ever 26 microseconds to avoid an overrun. Considering that a 4.77 Mhz PC was able to do it back in the day, and a modern CPU is considerably faster, even a less performant language may suffice.
@@smbakeryt Did the PC not have any additional buffering on the controller? Did it really have to maintain the 26us timing? I assume it would have been an ISR if that's the case? Super cool project for sure!
I already have a set... :D If memory serves, I tried them with the same controller chip on a RC2014 CP/M machine a few years back. Shouldn't be an issue to connect the drives to this project.
@@ianhanschen yeah... It was a i2c i/o driver that I piggy backed off of the SPD on a memory module... Back on the day it wasn't in the kernel like it is now
It works with 3.5" 1.44MB drives as well, though with a higher retry rate as the user-mode driver has a bit more trouble keeping up with high density drives.
Because you can't get it anymore is exactly the reason this isn't useless. This gives you more options to work with the hardware and interfacing it with modern systems. For example: if you want to read an old floppy, you need a working drive. To operate the drive you need to get some old computer working... With this you just need to find a working drive. You don't need to get that computer working to use the drive.
It is a tremendous achievement, but not very useful for daily work. Maybe to read old floppies of obsolete computers without bringing those old computers back to life. Disturbing their rightfully granted eternal peace. Now you can do the same for Hard Disks, paper tape, cassette storage. There is a world to explore, but who wants to know? Soon all cassettes and tapes are demagnetised, gone forever. Maybe old date and old games have to be forgotten, not reminding us who bad it was.
It might be less work to just play .mp3's of the sound of a floppy grinding away on a bad disk... I just know I'm gonna have nightmares tonight with that as the soundtrack because I thought of it....arrrggghhhh...
I worked at Phoenix Technologies when we put the 3.5" 2.88mb boot code in the BIOS. You made me smile. Shortly thereafter, the USB came along and floppies went bye-bye.. Thanks for the trip down memory lane.
Will you patch a BIOS for me please? Or point me in a direction haha...
"... said no one ever"... Pretty sure @foone on twitter has probably said that though :P
Could you please tweak the circuit for WD1793 with a latch and data separator?! .. this could be useful to interface your design to 4Mhz 8-bit machines ;).. Thank you!
Would the WD37C65 work with old single density 8” floppies too? I’ve got a bunch from my Xitan S-100 system back in the day. I remember modifying the BIOS code on it to support a floppy disk controller card based, I think, on a WD3791 controller. The Xitan still sits in my basement, but bringing it back to life shouldn’t have to be on the critical path of reading the old floppies.
Too cool. I have one of those controller chips lying around, would make a fun project.
What are the odds you can build all this into a box that one can install a 5.25" floppy drive into, to be able to connect to a modern PC via USB? That has always been a missing link for those that want to bring files that are found online into an IBM PC-XT type machine that doesn't have a 3.5" floppy drive.
The kernel is probably easier to work in directly than you remember. There are tons of sub-systems/frameworks that implement most of what you want to do most of the time and causing the kernel to totally lock up with no clue about what you did wrong isn't easy.
I guess you don't even want a block device really. A simple char device that contains the time sensitive/interrupt driven bits of your current python code would probably be enough.
Very cool project - I'm just wondering that you managed to connect a 5V device to RPi's 3V3 GPIOs without any level shifting? Are RPi GPIOs 5v tolerant or am I missing something?
Checked it with the scope and the data pins are indeed driven all the way up to 5V. Doesn't seem to hurt anything, though I'll probably pull the shunt and throw a resistor back in its place for a little margin of safety. Next board revision will get a proper level shifter. One of these days I should do a study to see how much voltage a pi gpio, when configured as input, can be exposed to before damaging it.
I had originally designed in a level shifter, then I looked up in the datasheet and apparently misinterpreted the high level DC output characteristics as being 2.8V/5ma, when that's actually the minimum, not maximum.
@@smbakeryt I assume that adding a simple 1k resistor pack for the data bus is enough, at least for these speeds. The esd clamp diodes on the pins will limit the voltages (and also limit the maximum speed it can handle when using more voltage than the SoC vcc for io). However, it'll be nice to watch that video you'll create. Note that a pin might not be damaged as soon as you apply that much voltage on it, and might take a lot of time to do so
@@cocusar Tested with 1K and seems to work reliably. I'm going to update the official schematic from 150 ohm to 1K.
Neat project! Is the controller a 5V part? Are the GPIO lines on the Pi able to handle this?
Yes, with no apparent adverse effect (yet). If there is enough interest in the project, next version I'll throw in a proper level converter.
I imagine they're fairly low current so they aren't taking a beating (since they'll get clamped anyways by the protection diodes). That said, it could potentially wear them down over time.
Very nifty! Could you share gerbers for the pcb? I didn't spot them on your blog post and I'd enjoy building one of these.
Gerbers have been published to github.com/sbelectronics/pi-fdc
@@smbakeryt great -- thanks!
Cool project!
Something like this will have uses far beyond what you can possibly think of at the moment. This is a great idea. One thing, how difficult is it to obtain those controller chips these days? If this were to be a mass produced (or at least, several thousands type volume) then it seems like there could be supply issues.
Have you done a mod for the old TEAC floppy drives?
Great video. Looking at your GitHub files supporting this I'm surprised that the host computer still needs to interpret the bitstream pulses from the FDC and then do the FM/MFM decoding - I might have expected the FDC to do the heavy lifting and present the actual user data in each sector to the host computer: was this how it was always done?
Now try it without a controller IC! Read raw flux transitions and decode MFM in code!
Working on a project that uses an 8 bit bi directional bus to the pi curious how you wrote bytes to the 8 bits. I have the answer I’ll go get your code from the repo... Thanks for posting this video and the pointer to running the process on an isolated core I’m going to give that a try to get some more performance. Glad someone else is hooking up old stuff to pis.
Very nice project. Thank you. What is the name of the case you have your Pi 4 in? It's excellent.
It’s made by Argon. Great cases
This is crazy awesome. With your inspiration I'm now wondering what it would take to build an Amiga diskette controller. One of my Amigas has an IBM floppy drive. I just might have to cannibalize it to try out your wizardry. Thanks for sharing your talents!
Super cool. Does this with 1.2M drives also? And where can I get one? :)
Hi - I have been watching your older RC2014 videos and tried to visit your web site but it seems to be down.
would it work with 1.44 dd drives ?
Now that is a title I never thought I would hear. And now I see why.
Would this support dual floppy drives? I'd love to be able to use my Teac 2-in-1 3.5/5.25 floppy drive with my Pi!!!
Use a Gotek for that "real" retro feel?😁👍
Very cool!
I always wished my Raspberry Pi would have come with a 360K floppy drive.... said no one ever lol
Have you considered making a Raspberry pico RP2040 micro controller hat to avoid the linux interrupt problem?
What's FREE TIME? Cool project!
Are those floppies still available? Never seen those for at least 15 years.
hmmm...Impressive!. Not that I have much need for a floppy drive on my Pi, but impressive none the less. Cheers!
i think it would be very interesting to adapt a commodore 1541 floppy drive (variable speed) on a raspberry pi, since original 1541 have that thermal issue and are kinda big. you then could implement the original serial bus of c64 and/or usb or samba share
Can anyone please tell me where I can find the chip used in this?
I am happy to see it works with all types of floppy drives. I have the 1.2 version made by Mitsubishi which I’m using to building for a retro PC. Now I could potentially use for my pies 🥧 as well. Provided I can get my hands on that floppy controller board!
What’s your sale price for the board?
Greetings from Brazil. I’m enthusiastic of retrocomputers. However it’s getting harder to fix or find someone to help fixing such devices. I’m trying to emulate trs80 at raspberry pi and I’d love to control de floppy drive. How can I order one of yours? Thank you.
I would think that a kernel driver should not be too hard because I'm sure Linux already supports this and other similar floppy controllers... I'd say it's a matter of finding the code in the kernel tree, forking it and creating a gpio bridge of some sort.
And I wouldn't be surprised if something already thought of making a gpio bridge to connect common PC hardware such as IDE drives and floppy controllers...
(I have no experience in this, my Linux knowledge does go back a long way but I haven't kept up in recent years)
I guess those protection resistors are more imortant in the matter that the chip is 5V logic and the Pi is 3.3V logic. The inputs doesn't like 5V :D
Impressive!
They really painted themselves in a corner with omitting that feature
Surely there's an 8086 emulator that could be made to run on the Pi, and boot DOS from the floppy drive?
It's in there by default and is called qemu ;)
@@roysigurdkarlsbakk3842 Good to know, I'll check it out (I am all about some 6502 emulators, and Basilisk II for Classic Mac, but have never delved into PC emulators, except through VirtualBox).
I got the Pi 4B 8GB in the Vilros keyboard/touchpad hub and am switching the dongle to the Acute Angle PC from Ali-Express for Windows 10. I love Berryboot and got a CD ROM Drive and floppy Drive I am going to try out for Windows 95.
Can you add more than one floppy to a Raspberry Pi? Maybe make them all generate sounds and produce music?
That was awesome!
Writing sector by sector is one thing. I need to pull files off before the media disintegrates, and that mean’s understanding exactly how to reconstruct them via the file directory.
Anyone know where to get FAT12 and FAT16 specs so I can do that in Python? Someone has to have done it already…
Hi. Where can I see the details? How can I build one?
Writeup is now online at www.smbaker.com/raspberry-pi-floppy-controller-board
@@smbakeryt Thanks. And do you have the gerber file for the Raspberry Pi Floppy Controller PCBOARD? I would like to print it and solder the components.
Yes, I see they are in the GIT. Thanks!
Just build a bluepill greaseweazle, and hookup a floppy drive to it and connect that to your pi.
github.com/keirf/Greaseweazle/wiki/Blue-Pill-Adapter
Supports tons of formats, and dirt cheap. Uses flux, so can handle 3"/3.5"/5.25" Disk Low and High Density. MFM and GCR.
But for a Pi project, this is cool.
OMG, I have a couple of MFM drives from Compaq Portables. If I could test them without resurrecting an old 8088 or 8086 PC, that would be supercool. I wonder if they could even do low-level format. 🤔
Amazing stuff! I'm surprised Python is fast enough.
I did use C extensions for the block transfer routine, though python may well have been fast enough to do it on its own. The key is that bytes must be transferred ever 26 microseconds to avoid an overrun. Considering that a 4.77 Mhz PC was able to do it back in the day, and a modern CPU is considerably faster, even a less performant language may suffice.
@@smbakeryt Nevertheless a great accomplishment. And a pleasure to watch as well. My hat off!
@@smbakeryt Did the PC not have any additional buffering on the controller? Did it really have to maintain the 26us timing? I assume it would have been an ISR if that's the case? Super cool project for sure!
Yes, hats off! Excuse my ignorance, I always thought that bus buffering with a special IC handles timing issues.
@@smbakeryt C extensions rock
Next Chapter: 8-inch Floppies! 😉
I already have a set... :D If memory serves, I tried them with the same controller chip on a RC2014 CP/M machine a few years back. Shouldn't be an issue to connect the drives to this project.
@@smbakeryt I always wanted to see an 8 inch floppy connected to a Linux computer.
Dood that’s froogin’ nuts. We want cables to connect old floppies to modern PCs.
Brilliant!
Pretty sure nobody ever wished that :))))
I remember writing a kernel driver when I was in college...
@@ianhanschen yeah... It was a i2c i/o driver that I piggy backed off of the SPD on a memory module... Back on the day it wasn't in the kernel like it is now
Me too!
"IBM 5150" in California the code for psychological holds is 5150. That is crazy!
How about a 3.5" controller. The 360 is a floppy you can't get anymore, so it's kind'a useless.
It works with 3.5" 1.44MB drives as well, though with a higher retry rate as the user-mode driver has a bit more trouble keeping up with high density drives.
Because you can't get it anymore is exactly the reason this isn't useless. This gives you more options to work with the hardware and interfacing it with modern systems.
For example: if you want to read an old floppy, you need a working drive. To operate the drive you need to get some old computer working... With this you just need to find a working drive. You don't need to get that computer working to use the drive.
@@smbakeryt - Do you have modified code for the 1.44MB Floppy?
It is a tremendous achievement, but not very useful for daily work. Maybe to read old floppies of obsolete computers without bringing those old computers back to life. Disturbing their rightfully granted eternal peace.
Now you can do the same for Hard Disks, paper tape, cassette storage. There is a world to explore, but who wants to know? Soon all cassettes and tapes are demagnetised, gone forever. Maybe old date and old games have to be forgotten, not reminding us who bad it was.
It might be less work to just play .mp3's of the sound of a floppy grinding away on a bad disk... I just know I'm gonna have nightmares tonight with that as the soundtrack because I thought of it....arrrggghhhh...