SD2IEC for Commodore 64

After winning a cheap bid on a Commodore 64 off eBay  the other day I’ve looked into  building a SD2IEC.

The SD2IEC is a storage device using an SD card and interfacing with the IEC bus using a ATMega644 microcontroller.

I used most of the information from 16 Bit Dust .  Looking at the schematic I already had most of components.

I already had a SD Card with a built in 3.3 voltage regulator so did’t need to add this into the build. Also used the ATMega1284

 

 

First step is to program the microcontroller with a bootloader.   Having already built a USB Tiny ISP it was a simple step to program it. Schematic for this I got from AdaFruit

Bootloader files are available from sd2irc.de  

Download /bootloader/newboot-0.4.1-binaries.zip, extract the files and write

newboot-0.4.1-larsp-m644p.hex  to the microcontroller. I used avrdude:

avrdude -c usbtiny -p m1284 -e -V -U flash:w:newboot-0.4.1-larsp-m1284p.hex

avrdude -c usbtiny -p m1284 -U lfuse:w:0xd7:m -U hfuse:w:0xd2:m -U efuse:w:0xfc:m

 

Next comes building the circuit. I used a veroboard and there were not that many components to add.  Didn’t have to use R1-R6 as they were already on the SD Card.

 

Data cable pinouts

Power cable pinout

Not as pretty as the bought ones but it didn’t cost me anything to build and was a fun project.

After assembling copy the S2IEC firmware to the root of the SD Card. Power on and the red LED will flash for two seconds while it looks for a valid firmware. The green LED should then flash while it accesses the card. When it starts to flash the firmware the green LED will flash rapidly.

To test if the computer is successfully connecting to the SD2IEC device you can use the following simple program:

10 OPEN15,8,15:INPUT#15,A$,B$,C$,D$

20 CLOSE15

30 PRINT A$,B$,C$,D$

 

This will print the current SD2IEC firmware to the screen.

Leave a Reply

Your email address will not be published.

*