root labs rdist

January 21, 2009

Introducing xum1541: the fast C64 floppy USB adapter

Filed under: C64,Hardware — Nate Lawson @ 4:26 pm

I’ve been working on a project in my spare time that I’m now ready to announce. It is a USB interface for the C64 1541 floppy drive, which allows it to be connected to a modern PC. In conjunction with the OpenCBM software, this allows files and whole disk images to be transferred to and from the drive.

Previously, there were a number of ways to connect your PC to a 1541, but they all required a built-in printer port. These have become rare on modern systems. USB is the logical choice for a new adapter but has its own complexities.

In 2007, the xu1541 project by Till Harbaum developed a simple USB adapter. This was a nice improvement. On the plus side, the hardware was very cheap to build and it offered decent compatibility. However, the device was slow due to implementing the USB protocol in software and required a lot of skill to set up since it had to be hand-built and bootstrapped with JTAG.

The xum1541 (pronounced “zoom”) is built from a modified version of the xu1541 firmware. It is a USB full speed device and supports high-speed parallel cables. The hardware USB support significantly speeds up transfers. It will support mnib (aka nibtools), which provides low-level imaging to backup copy protected disks. I’m most excited about this feature since it is critical to archiving original floppies for the C64 Preservation Project.

The first version of the hardware is based on the AT90USBKEY development board. This board costs about $30 and comes with a preinstalled USB bootloader. To turn it into an xum1541, it just needs a small daughtercard for the IEC connectors and parallel cable. It’s easy to upload the firmware with the Atmel FLIP software, no JTAG cable needed. I’m hoping that future versions will be a fully custom board and that someone will manufacture them for users who don’t have any hardware skills.

xum1541 USB floppy adapter

xum1541 USB floppy adapter

The project is currently in the alpha stage. I have a working firmware that is mostly compatible with the xu1541. It runs out of the CVS version of OpenCBM and works although it has a few bugs. I’m currently working to implement nibbler support and to improve the transfer speed. I’m trying to do this without sacrificing too much xu1541 compatibility to keep the OpenCBM software changes minimal.

Both Wolfgang Moser and Spiro Trikaliotis have been helpful on this project. Wolfgang has been testing my firmware on his own setup, so there are two xum1541s in existence now. Also, he has been prototyping various designs for both a daughterboard for the USBKEY and the second version of the xum1541, which would not be based on the USBKEY developer’s kit. Instead, it would be a fully custom board which will allow it to be even cheaper. Spiro has assisted with debugging some IEC problems.

Wolfgang Moser's xum1541

Wolfgang Moser's xum1541

All of this is in the early stages so no promises on delivery date. The last 10% of a project is always 90% of the effort. The first step is to finish support for the nibbler protocol and improve performance. Next, we will polish the firmware and OpenCBM software to support the new device (too many #ifdefs right now). The first release would provide firmware and software for people willing to build their own daughterboard for the USBKEY. Eventually, I hope there would be custom boards available for those who don’t want to build anything.

This project has been a lot of fun, and I look forward to posting more updates soon. Here’s a video of the xum1541 in operation:

48 Comments

  1. This looks marvelous! Nibtool support sounds fantastic. I hope this will be available anytime soon as a custom board. Great job!

    Comment by Psycho64 — January 23, 2009 @ 1:52 am

  2. Looks really nice!

    When you have some of those for sale , please send me an email.

    /nusse :)

    Comment by nusse_62 — January 24, 2009 @ 1:42 am

  3. I am interested – when you have finished the first version of the project (ie. you have a box which takes a serial cable in one and a USB cable in the other) then you have a buyer! :-)

    Comment by Pontus Berg — January 24, 2009 @ 5:32 pm

    • I would also buy one! (at LEAST)

      JB

      Comment by Joe Bucci — October 19, 2009 @ 9:23 pm

  4. Awesome. Most retro project for 2009! :-)

    Comment by ruipaulo — January 25, 2009 @ 5:49 pm

  5. Hi,

    I saw you demontration and I was very impressed.

    My next question is: Can I use the files writen from my pc to play c64 games?

    help

    Comment by John Koenig — January 25, 2009 @ 6:37 pm

  6. John;

    Images of a 1541 5.25″ disk can be run under an emulator (CCS64, VICE or one of the others).

    /Pontus

    Comment by Pontus Berg — January 26, 2009 @ 12:00 pm

  7. Correct, that has nothing to do with this project. If you already have images of disks, any emulator can be used to play them. This is a tool for transferring data from the PC to/from the 15×1 floppy series.

    Comment by Nate Lawson — January 26, 2009 @ 12:56 pm

  8. Perhaps John Koenig was referring to downloading d64 disk images and using the xum1541 to write them out to floppy so that they can be used on a real Commodore computer. This is a common usage for existing x-cables.

    Comment by Golan Klinger — January 26, 2009 @ 7:27 pm

  9. This looks really amazing. When it’s a completed project I’d love to purchase one! Good job!

    Comment by Jeremy — January 29, 2009 @ 12:40 pm

  10. look cool and it’s what i need!! ready to purchase one too

    Comment by marc — January 29, 2009 @ 1:57 pm

  11. I know when I’ll be really interested in something like this. I’m sure you’re all familiar with the USB to PS2 Mouse adapters.

    Wouldn’t it be great to have, kind of, the reverse? Like having the C64 female to USB male adapter.

    I’m “Old School” technically minded. They ARE both “serial” type ports.. no? It would still be sweet to have that type of adapter.

    Best of luck with your project. :)

    Regards,
    Joe

    Comment by Joe Bucci — January 31, 2009 @ 6:41 pm

  12. Golan, perhaps he meant that. The xum1541 can be used for that. Currently I’ve read and written d64 images, but I’m moving on now to implementing the nibbler support. This will allow access to raw GCR.

    Joe, I think this is exactly what you’re describing.

    Comment by Nate Lawson — February 4, 2009 @ 10:44 am

  13. thats the device i want ;) no more troubles with lpt-ports ….
    hope you finish your project in 2009 ;)
    … i´ll buy one

    Comment by swasti — February 6, 2009 @ 12:39 pm

  14. When you have some of those for sale , please send me an email.

    ussaf / maktoob.com
    d.baasy / hotmail.com
    dbaasy / yahoo.cam

    I am very, very interested in and ask for a quantity of the product

    Comment by yuosaf — February 17, 2009 @ 10:26 am

  15. That is very cool. I would love to pick up a couple of these! Best of luck in your project.

    Comment by Matt — March 2, 2009 @ 1:09 pm

  16. Would love to make a integrated version of this into a 1571.
    (Put a switch and usb b port on the back, flip the switch to enable, turn off switch to allow for c64 use)

    Comment by dabone — March 23, 2009 @ 8:50 am

  17. dabone, since the IEC bus is shared among peripherals directly, I don’t think you need a switch. You can leave it connected, as long as two hosts aren’t trying to access it at the same time. The IEC bus floats high due to pull-ups and is pulled down by whoever is talking (drive or host). Even if two hosts were both trying to talk to the drive at the same time, it wouldn’t likely cause electrical damage since both would just be grounding the lines. It would only cause communication failures.

    With the xum1541, my only possible concern would be in plugging a C64 into one serial port on the drive and a PC into the USB port at the same time. I haven’t measured the idle current due to the 3.3V board vs. 5V c64 connection. It’s probably nothing to worry about but better safe than sorry.

    Comment by Nate Lawson — March 27, 2009 @ 11:22 am

  18. I will help you with this ANY WAY I CAN. Beta testing, troubleshooting, firmware doublechecking..

    this is the dream device.

    Comment by PDF Format — April 4, 2009 @ 7:40 pm

  19. I want one too! Makes sense for transfering disks on modern notebooks/netbooks…

    Comment by elkmoose — April 5, 2009 @ 11:12 pm

  20. Great Job!

    Please let me know when this tool is available. I would like to buy one!

    Best regards, Jack.

    Comment by jack — April 10, 2009 @ 12:10 pm

  21. Great Job!
    Please let me know when this tool is available. I would like to buy one!
    Best regards, Andrea.

    Comment by Andrea — April 19, 2009 @ 10:39 am

  22. This looks very cool. I hope that you’re still developing this. Please post some news as soon as there is some.

    Comment by Matt — July 5, 2009 @ 5:24 pm

  23. I think that there is a quite big demand for a usb solution for transfering data to c64 diskdrives. I really hope that you will release schematics (or adapters to buy) and software soon.

    Comment by Magnus — July 6, 2009 @ 12:05 am

    • Thanks for the continuing interest. I am still working on this, just got buried with my day job. I will release schematics and source code eventually. It is not something I plan to sell.

      Comment by Nate Lawson — July 14, 2009 @ 9:43 am

  24. :(
    Too bad, I’m not skilled in electronics and coding. I’d need someone to assemble a unit.

    Comment by Psycho64 — July 14, 2009 @ 10:01 am

    • If you’re using the at90usb dev board, the only soldering is to put some pin headers onto it for the adapter. Hopefully someone will sell the finished version for people that don’t want to do even that, as well as a cost-reduced fully custom version.

      Comment by Nate Lawson — July 14, 2009 @ 11:57 am

  25. Yes, let’s hope that. But ‘not wanting to’ is not the problem here. I’m just unable to solder as I’m lacking the equipment required ;) I’m more the gamer/games-collector type, who wants to preserve his collection.
    We’ll see ………………….
    It’s a really a nice piece of hardware!

    Comment by Psycho64 — July 14, 2009 @ 12:54 pm

  26. This looks like an awesome project. With many new computers not having serial or parallel ports, this device is *REALLY* needed. I am quite happy to buy the at90usb dev board to start using this. Is the firmware available for testing?

    Comment by RajW — July 17, 2009 @ 10:28 am

  27. This is amazing – can’t wait to get my hands on one (or two) of those for our computer museum.
    Please do let us know when they are available please – I am also available to beta test if needed!

    Andy

    Comment by Andy Spencer — July 24, 2009 @ 7:38 am

  28. This looks like the most interesting project of this type going on at the moment. Even though there are others available now, I think I’ll wait for this one! – GREAT Concept, GREAT Job!

    I would love to see someone come up with a way to “hack” the C64’s serial port so it would ‘handle’ standard USB thumb drives. And, actually have a USB port “Built-In” to the 64 itself!

    Even if it had NO 1541 emulation! I’m sure LOTS of stuff (One-Filers, etc.) would run fine with it. You would need some sort of a ‘driver’ for it I suppose. And we all know the Memory limits… But, it would still be cool!

    JB

    Comment by Joe Bucci — October 19, 2009 @ 9:13 pm

  29. Any news on this?
    I would kill to be able to copy my old games and programs to and from the PC.

    Comment by Crom — March 18, 2010 @ 8:09 am

    • The firmware and pinouts have been public in OpenCBM since December 2009 if you want to build it yourself.

      No public news but work now continues on custom hardware. We’re close and may have something to announce soon.

      Comment by Nate Lawson — March 18, 2010 @ 9:12 am

      • Sounds great. I don’t think I would be able to build one myself so it’s awesome if it would be possible for me to buy as a finished product. Being able to back up and make new floppys with all my old C64 games and programs is something I have been wanting to do for ages.

        Comment by Crom — March 18, 2010 @ 1:44 pm

  30. Hi, I’d love to get one. Where can I find proper schematics?

    Comment by Antitrack — March 19, 2010 @ 12:48 pm

  31. I wonder why the schematics are like, uhm – you have every serial line from the 1541 two times, like “CLK IN” and “CLK OUT” when there is only ONE serial “CLK” line from the 1541? How comes? What is happening here – how is it connected to the Atmel, then ?

    Comment by Antitrack — March 24, 2010 @ 1:24 pm

    • The USBKEY board design was for prototyping, so I designed it to be compatible with the existing XA/XAP1541 adaptor. That way we could reuse the connectors, transistor logic for strong drive on the lines, etc. See this info on the XA/XAP1541 to see what lines connect to what:

      http://sta.c64.org/xap1541a.html

      The reason there are separate inputs and outputs on the XAP1541 is so the transistors can provide strong drive. This is important if you have many IEC devices on the same bus.

      ATN IN and RST IN are only for future use in emulating an IEC device and are not used by the firmware currently. They can be left off.

      I’ve been working on a production design with the usual suspects (OpenCBM people) and hope we should have something done soon that is pre-built. It’s going to be slightly different from the USBKEY design, so unless you’re in a hurry, I’d wait for that. It will have at least one secret feature that has not been done before in the C= drive world. :)

      Comment by Nate Lawson — March 25, 2010 @ 12:31 pm

  32. Really excited to see this project!
    I have a bunch of programs I wrote as a kid that I’ve been wanting to get off the floppies.
    Will this work with a 1541 II drive?

    Comment by Kris Horrocks — April 5, 2010 @ 5:00 pm

    • Yes, every drive that OpenCBM supports since it is run by OpenCBM.

      Comment by Nate Lawson — April 8, 2010 @ 2:36 pm

  33. Id maybe more interested if it didn’t need a paralell connection. There was NEVER a paralell port on the 1541 drive. This is a hack addon. I would be FAR more interested if someone came out with a C64-serial to PC-USB or a C64-serial to PC-serial adaptor that would allow (in conjunction with a special driver) to allow the 1541 drive to show up on a PC as an ordinary drive such as drive-B: or H: or whatever. The just access the drive like normal. If it wouldn’t work like that at least don’t make it so you have use some software that runs on an obscure OS platform like OpenCBM. Make an ordinary VB or VC++ Win32 software for it to run with.

    Comment by Videogamer — May 25, 2010 @ 4:52 pm

    • It doesn’t require a parallel port. You can use it with just the IEC serial port and it works fine, just slower.

      I chose the route of supporting OpenCBM because it is lower level and allows nibbling of disks. If someone wanted to add a mass-storage mode for normal CBM DOS floppies, that would be fine with me. However, given that such a mode would not allow block-level access and be more complicated, I don’t think it’s a big win.

      If you want a GUI, there are GUIs for OpenCBM.

      Comment by Nate Lawson — May 26, 2010 @ 11:12 am

      • Do you intend to sell this adapter as a commercial product? Or does it remain a homebrew project for you?

        Comment by Videogamer — May 26, 2010 @ 11:19 am

      • I am currently working with a well-known C64 hobbyist hardware producer to create a commercial version, yes. It will be inexpensive and have a few surprise features. The firmware will stay GPL so anyone can build their own still if they want.

        I’ll post more on my blog once we have something close to production-ready.

        Comment by Nate Lawson — June 1, 2010 @ 10:48 am

  34. Anything yet? Im debating buying a c64 or waiting for this adapter..I have over 100disks of games im waiting to look at!! :)

    Comment by Paul — June 30, 2010 @ 9:37 am

    • The firmware updates are nearly done. When it passes all stress tests, it will be released via OpenCBM cvs for the original USBKEY board (described in this blog post).

      The hardware design process is taking a while, so no word yet on when the first commercial boards will be available.

      Comment by Nate Lawson — July 1, 2010 @ 8:45 am


RSS feed for comments on this post.

The Rubric Theme. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 87 other followers