BMOW title
Floppy Emu banner

Floppy Emu, Large and In Charge

After months of procrastination, I finally assembled the Floppy Emu board and began work on the firmware modifications this week. So far, so good! Despite being out of practice with soldering, the assembly went smoothly, and the board checked out fine electrically. The firmware has now been partially converted to the new microcontroller and pin arrangement, and I’m able to read the SD card and write to the LCD screen without problems.

For those who may have missed the earlier progress updates, Floppy Emu is a floppy disk drive emulator for classic Macintosh computers like the Mac Plus. It plugs into the Mac’s DB-19 port, and behaves exactly like an external Sony 3.5″ disk drive would, so no special system software or other modifications are required. Floppy disk images are stored on a standard SD memory card, and a microcontroller (Atmel ATEMGA1284P) and CPLD (Xilinx XC9572XL) are used to read/write the floppy data. The data is converted into the GCR-encoded serial pulse stream that the Mac expects, exactly like the signal from a magnetic read head flying across a track on a real floppy disk.

The Floppy Emu prototype was constructed on a breadboard, using whatever parts were on hand. The prototype demonstrated 100% successful read emulation of an 800K floppy disk, and partially successful write emulation, depending on the type of write operation and the specific SD memory card used. The new Floppy Emu board shown here uses a more powerful microcontroller and different type of CPLD, and combines everything onto a single custom-made circuit board that fits right into the back of the Mac at the external floppy port. Power is provided by the Mac too, so there’s nothing to do but connect it and go.

These photos show how small the Floppy Emu board is: about 1.75 inches wide and 4.5 inches long, including the DB-19 connector. The SD memory card extends an additional 0.5 inch beyond the end of the board. A roll of Scotch tape is also shown as a size reference. The Floppy Emu board is purple, but in most of the photos you’ll also see an LCD display on a red daughterboard. The LCD daughterboard is socketed, and can be connected and disconnected as needed. It’s the same Nokia 5110 LCD board sold by SparkFun and other several other vendors.

Thanks to its small size, the board fits nicely at the rear of the Mac, right between the mouse and the SCSI connector (or mouse and serial port on older Macs without SCSI).

In addition to plugging straight into the external DB-19 floppy port, Floppy Emu can also be connected using a rectangular 20-pin IDC connector. This is the same connector found on the Mac motherboard, so a standard IDC cable can be used to connect Floppy Emu internally instead of at the external floppy connector. A DB-19 to IDC-20 adapter cable can also be used, such as the Apple II cable from IEC shown below. The cable enables Floppy Emu to connect to the external floppy port at the Mac’s rear, but positioned in the front of the Mac where it’s easier to use.

Everything is looking good so far. The next step is to program the CPLD, so communication with the Mac can be performed. The Floppy Emu board has a Xilinx JTAG connector at the upper-right of the LCD daughterboard, but it’s not populated and I’m hoping not to use it. Instead, my plan is save the CPLD configuration file on the SD memory card, and then use the microcontroller to configure the CPLD using a bit-bang JTAG method described in Xilinx app note XAPP058. Once that’s done, the final step will be to use the more powerful microcontroller on this board (as compared with the prototype) to experiment with new write emulation methods, and hopefully achieve 100% success for emulated floppy disk writes as well as reads.

 

Read 17 comments and join the conversation 

17 Comments so far

  1. Alber - February 8th, 2012 4:22 am

    Nice work!
    Hope to see it working 😉

  2. philip - February 8th, 2012 5:59 pm

    NIce! do you have a version for non-mac computers?

  3. Steve Chamberlin - February 9th, 2012 8:40 am

    The Mac floppy interface is different from most other computers, so this is Mac-specific. For other computers, try the HxC floppy emulator: http://hxc2001.free.fr/floppy_drive_emulator/

  4. Geoff - February 9th, 2012 8:34 pm

    Great job, nothing like interfacing with “ancient” tech! I can’t wait until it’s finished!
    In one of your previous posts, you mentioned that you weren’t sure of the final CPLD and microprocessor you would use for production, are the chips you used here what you are going to stick with?

  5. Steve Chamberlin - February 10th, 2012 8:09 am

    Yes, I’m hoping this will be the final hardware design.

  6. Shaun James - February 14th, 2012 10:25 pm

    Very very cool! Well done. Unfortunately I have no need for one now, but I can’t wait for the Amiga version 😉

  7. Zach - February 17th, 2012 11:56 am

    Great hack and the final “product” has a nice look to it.

  8. Zach - February 17th, 2012 12:04 pm

    I’ve programmed the .bit files via JTAG from another micro without issues (for devices as large as XC2S200). Couple of points to keep in mind:

    1) “Use JTAG clock for startup” must be checked during bitstream generation.

    2) The bits with in the bit file are pushed in “backwards”. (ie. read bytes 0..3, you’d push in (b0 & 0x80) >> 7 first, (b3 & 0x01) << last).

    Hope that helps!

  9. jon - February 20th, 2012 11:45 am

    Looks great Steve — I would really like to build one of these in the *near* future.

    This is a very exciting project and looks like a ton of fun when you get things to work properly.

  10. Steve Chamberlin - February 20th, 2012 12:18 pm

    Too many outside life distractions keep pushing off further work on the floppy project. Sorry to those who are following this. I haven’t forgotten about it!

  11. mike clemens - February 23rd, 2012 10:25 am

    Nice work!

  12. techknight - February 25th, 2012 1:25 pm

    What is the new microcontroller your porting to?

  13. Andrea - March 7th, 2012 3:32 pm

    Great!! This jingle will be a great step for humanity!

  14. petersieg - September 18th, 2013 8:00 am

    Hello. I am in the middle of making one for me.
    I have used avrdude to flash the avr with:
    avrdude -c usbtiny -p m1284p -e -V -U flash:w:floppyemu.hex
    avrdude -c usbtiny -p m1284p -U lfuse:w:0xbf:m -U hfuse:w:0xd9:m -U efuse:w:0xff:m

    The flashing did go just fine. However, now (2nd run) I have no contact to the avr
    anymore. Most likely the fuses are not correct..? But I checked with fuse calculator and
    the values given above should match..?

    The problem here is to get parts that fits the footprint. So quarz is another 20MHz smd type.
    (NOT an oscillator!)

    Peter

  15. Steve Chamberlin - September 18th, 2013 11:09 am

    Peter, you probably want to comment on the “build your own” page instead of here: http://www.bigmessowires.com/2012/12/15/build-your-own-floppy-emu/

    Yes, you need a 20 MHz crystal, not an oscillator. The file archive contains Digikey links to the exact parts you need. The crystal is http://search.digikey.com/us/en/products/NX5032GA-20.000000MHZ-LN-CD-1/644-1039-1-ND/1128911 The fuse settings tell the AVR to use an external clock instead of its internal oscillator. If you don’t have that crystal in place yet, then the external clock is absent and the AVR will have no clock source and won’t run. After you connect the external clock, it should be OK.

  16. petersieg - September 18th, 2013 11:49 am

    @Steve: Thanks. The fuses were ok. Issue was that I had ordered a smd crystal with 4 pads und that gave a short on the crystal. Now temp. I have soldered a small HC49 crystal and it seems to work.. need to wait now on the 5110 displays from china 😉
    Problem is that parts from digikey are quite expensive in germany, because of shipping costs..
    So I tried to use similiar parts.

    Will keep you updated when missing parts have arrived.

    Thx. Peter

  17. Steve Chamberlin - September 18th, 2013 12:27 pm

    If you find good sources in Europe for the parts, let me know the part numbers and I’ll add them to the docs.

Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.