Image Map Image Map
Results 1 to 6 of 6

Thread: Yet another C64 storage device!

  1. #1
    Join Date
    Apr 2011
    Location
    San Francisco, CA
    Posts
    511

    Default Yet another C64 storage device!

    Hi all,
    I've been away from this forum for a while, and it has been too long! With work and personal stuff accumulating, haven't had much time to spend on vintage computing of late, but hoping to get back into my favorite hobby.

    I wanted to share my latest project, one of the many alternatives for C64 floppy emulation out there. In the course of working on some C64 software development, I wanted to find a way to speed up the compile/build/test cycle. Previously I had either converted my .PRG programs to audio files and loaded through the cassette port (slow!) or copied onto SD cards (better, but still required some time between build cycles). I decided to build a drive emulator that used a raspberry pi as the storage source, so I could build software, send it to the RPi, and be ready to load onto the C64 with the LOAD command on the C64 as the only manual step. This one uses a small board with a microcontroller to connect to the C64 floppy connector, and uses a Raspberry Pi (any model) to provide the storage. The microcontroller implements the IEC protocol to read and send bytes to the C64, and relays information to/from the raspberry pi via SPI. The drive emulation (work in progress!) is implemented on the RPi and supports both local filesystem and .d64. I'm using some homebrew code to run the IEC handling and file system interaction now, but may look at adapting the sd2iec firmware to drive this in the future.

    A few pictures:
    IMG_0900.JPG
    IMG_0901.JPG
    IMG_0902.JPG
    IMG_0903.JPG
    IMG_0899.JPG

    I'm running both the C64 drive and another userport interface board connected to the same RPI, thanks to a small SPI breakout board you can see in the last picture. Hoping to standardize on SPI for a few different small vintage projects all powered by RPi, which provides pretty much all the connectivity and storage you need.

    Thanks for checking it out! I have a few extra boards, so let me know if you are interested in trying it out. The board is very minimal and I'd estimate it would be about $5 or so to make in quantity. I'll post a video clip of the drive in action when I get a chance. All the software for this project will be available on github as well.
    Last edited by gubbish; August 29th, 2017 at 08:57 PM.

  2. #2
    Join Date
    Jan 2012
    Location
    Surrey,BC,Canada
    Posts
    148

    Default

    Yet another great project (like the PETVet). Will it work with RPI Zero? Oops..you mentioned all models in your post...my bad!

  3. #3
    Join Date
    Apr 2011
    Location
    San Francisco, CA
    Posts
    511

    Default

    Yup, works with all pi models (0,1,2,3) and only uses the SPI interface on the PI, so you can still use the other GPIO for something else. With the zero being $5 you get a crazy cheap multi-retro peripheral!

  4. #4

    Default

    Hallo Gubbish,

    I have a PI 2B that's a bit laying around and I would like it to use it in combination with one or more of my Commodores. Looking at the given pictures it looks one needs an extra ATMEGA. The PI is much more powerfull than the ATMEGA so I wonder why it is not possible to just the PI stand-alone?
    With kind regards / met vriendelijke groet, Ruud Baltissen
    www.Baltissen.org

  5. #5
    Join Date
    Apr 2011
    Location
    San Francisco, CA
    Posts
    511

    Default

    It is definitely possible to use the PI standalone, and in fact this has been done before a few years ago, in a very cool project: http://www.lemon64.com/forum/viewtopic.php?t=48991

    You do need level shifters to protect the Rpi's GPIO from encountering 5v voltage (they can only handle 3.3v). Also, you need a kernel driver to support disabling system interrupts to handle the precise microsecond level timing required for the C64 IEC protocol. Normally on the RPi you have OS interrupts and what not which can take an unknown amount of time, making it very difficult to do real-time GPIO stuff that requires specific timing without a kernel driver.

    There were a couple of factors in my decision to use a microcontroller rather than using the PI standalone. First was that I already had another couple of microcontroller projects for interfacing with C64 and PET which use the capabilities of the Rpi, and I wanted to find a way to standardize their connection to the PI and to be able to run them all at the same time on a shared bus to have modular retro peripherals. So I decided to use the pi's SPI interface, which is well suited as a shared bus between multiple devices and only requires a small number of connections, leaving the rest of the GPIO pins available for other use. This was useful for me because it's easy to switch up which peripherals I want to use at any given time.
    Next factor was that the MCU prevents any 5v logic from connecting directly to the RPI, so in effect it spares the need for level shifting.
    Finally, since you do need at least some additional hardware to run using the PI alone, and given that an atmega is something like $2, I decided to go that route.

    I think both approaches are reasonable, but for my own use and my own familiarity with microcontroller development vs my lack of knowledge about linux kernel drivers, this seemed like a good way to go.

  6. #6
    Join Date
    Aug 2009
    Location
    Oslo, Norway
    Posts
    1,343
    Blog Entries
    3

    Default

    Nice project! Interesting Pi + microcontroller combination too.
    Torfinn

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •