The Commodore 1541 disk drive is unlike anything you’ll ever see in modern computer hardware. At launch, the 1541 cost almost as much as the Commodore 64 it was attached to ($400, or about $1040 at today’s value). This drive had a CPU, and had its own built-in operating system. Of course, anyone using a Commodore 64 now doesn’t deal with this drive these days — you can buy an SD2IEC for twenty dollars and load all your C64 games off an SD card. If you’re cheap, there’s always the tape drive interface and a ten dollar Apple Lightning to 3.5mm headphone adapter.
But the SD2IEC isn’t compatible with everything, and hacking something together using the tape drive doesn’t have the panache required of serious Commodoring. What’s really needed is a cycle-accurate emulation of the 1541 disk drive, emulating the 6502 CPU and the two 6522 VIAs in this ancient disk drive. The Raspberry Pi comes to the rescue. [Steve White] created the Pi1541, an emulation of the Commodore 1541 disk drive that runs on the Raspberry Pi 3B.
Pi1541 is a complete emulation of the 6502 and two 6522s found inside the Commodore 1541 disk drive. It runs the same code the disk drive does, and supports all the fast loaders, demos, and copy protected original disk images that can be used with an original drive.
The only hardware required to turn a Raspberry Pi 3 into a 1541 are a few transistors in the form of a bi-directional logic level shifter, and a plug for a six-pin serial port cable. This can easily be constructed out of some Sparkfun, Adafruit, Amazon, or AliExpress parts, although we suspect anyone could whip up a Raspberry Pi hat with the same circuit in under an hour. The binaries necessary to run Pi1541 on the Raspberry Pi are available on [Steve]’s website, and he’ll be releasing the source soon.
This is a great project for the retrocomputing scene, although there is one slight drawback. Pi1541 requires a Raspberry Pi 3, and doesn’t work on the Raspberry Pi Zero. That would be an amazing bit of software, as ten dollars in parts could serve as a complete emulation of a Commodore disk drive. That said, you’re still likely to be under $50 in parts and you’re not going to find a better drive emulator around.
Now you tell me. I just ordered some sd2iec boards.
SD2IEC are fine for quick disk shuffling, loading disks you doiwnloaded from internet, making backup copies of your personal disks to SD card, etc but it’s not real good for many uncracked commercial games that uses custom fastloader code since that is what fails on SD2IEC. There are UK1541 and 1541 Ultimate but they costs a few hundred dollars and are more for hard core C64 fans.
If you still have working 1541 drive (or 1571), you can use disk copy program to copy from disk images to real disk and run games off those real disks.
I got a 1541 Ultimate II+ last year and this thing is insane. emulates 4 1541/1571 drives, tapes, twin SIDS, Ethernet, DAC audio, 16MB memory expansion (watching color nuvie videos on C64 is crazy) ROM replacement including SX64 and jiggydos, cartridge emulation including fastload and action reply with freeze functions. FTP, telnet lets you hot swap out data in the memory expantion using DMA in realtime without freezing.
Also made it real easy to use a disk copy to get my old disks onto a flash card. I wound up killing a 1541’s VIA chip getting a homemade PC parallel to C64 serial adapter to work.
I got a Ultimate 1541 II+ waiting for me at the post office, but cannot get it today. It sure is pretty amazing though as it can be used with both the C64 and the C128 and it supports carts, copy protected disks and copy protected tapes. Also it can give you the 16mb REU RAM so you can run some C64 REU based videos.
$180?! Yikes.
“jiggydos”
So nostalgic
“serious Commodoring”
Are you serious? Seriously, there was never anything serious about Commodoring.
Back in the 1980s it was a serious computing platform.
1980s? What about 1990s? Need we remind that auto repair shop in Gdansk and it’s C64 based system for balancing driveshafts that runs already almost 30 years? I also heard of some textile company using C64 for production control. It’s a pitty that C64 is remembered as entertainment platform and many of it’s uses got completly forgotten:
http://savethefloppy.com/wp-content/uploads/2015/10/20.jpg
Of course picture is not serious but I could not stop myself from posting it.
Cool! It seems to be quite useful, even if not connected to anything!
I found the original ones most useful. Me and my brother bother learned computers and programming on them. including loading in a spreadsheet and word proc app byte by byte to help with school work. The original monitor was also dual useful since it had a composite in port so I could watch movies straight from a VCR.
Exactly. CBM stands for Commodore Business Machines. They had lots of business use cases back in the day, just like a PC– when IBM wasn’t nearly as interested in the PC as they were their (more expensive) mainframe and (to some extent) their AS/400 platforms.
Wow, a wireless C64.
Of course it was. I ran a business from one, programming eproms, writing code in my own assembler for microcontrollers. I kept a client database, made documents and forms on it. Still a capable machine.
I ran a business with a calculator and a box with switches to burn ROMs. Serious switches!
The extents to which the retro-Commodore set will go to get/keep their gear running _certainly_ qualifies as “serious Commodoring”. Even when they’re just playing games.
+1
Stupid question here, but why can’t this be run from a Pi 1 or Pi 2? Is it a computing power/resources issue?
A lot of us have those older units kicking around and it’d be nice to put them to use without sacrificing a Pi 3.
It can be done on a Cortex-M3
maybe its written in python, or nodejs ;-)
but seriously, cycle accurate can be a killer. Personally I wouldnt bother, you can get most(if not all) c64 games pre cracked anyway, I dont see the magic in waiting 30-60 seconds for disk load.
It’s not the crack, it’s the software loader that speeds up disk load time. They work on real 1541/1571 but because SD2IEC does not emulate 1541 100%, the turbo loader fails.
Look for Ultima 5 disk images and load the Program disk. On a C64 and on 128 in 64 mode, you will see a screen asking which disk drive you are using. If you choose 1541 while running off SD2IEC, the game will crash. If you choose other, it will load fine but at very slow load speed (original serial speed!)
crack/patch, are there still any non patched games left? are there still any people alive playing them?
as for non turbo slow speed there are replacement kernals with patched in turbo
At the outset I fully intended to get is to work on a Pi Zero. It almost works on a Pi2. I just have not had the time to investigate why not. It is currently multi-core at the moment. One core runs the emulator whilst the other handles USB interrupts and updates the screen. I have no doubt that after I release the source (soon) it will be ported to all kinds of devices.
Release the Source! We’ll help solve all those problems. Seriously if it’s open source there’s no reason not to open it now
It’s probably something simple, but until/if the source is released, nobody else can work on it.
I’d also be interested in getting this to run on an old Pi 2 that I have lying around …
So hilarious! The commodore DOS for C64 and the PET, was so unfinished as to barely be called a disk operating system! I never understood why they didn’t make a better implementation.
beyond all of that! very cool project by the way!!
On the other hand, that DOS allowed you to use the drive as a coprocessor. If there would have been something like Bitcoin in the 1980s, people would have written bitcoin miners for the Commodore disk drives so they’d have something to do while you’re not downloading file “$”.
I remember code in one of the RUN magazine that you could set drive 8 and 9 to automatically copy disk. Once you sent the code to both disk drive, you could disconnect C64 and it’d run by itself copying disks all day long.
No other computer have disk drive that can do this by itself with just software!
scsi can do this with very little help as the bus is similar. there were even commercial cd cloning devices available. not true standalone, but very close
Are you sure that Timex FDD3000 couldn’t do this? It was a complete computer with two floppy drives.
Fast Hack’em would do that.
They did make a better implementation. The 4000 & 8000 series PETs had a much better DOS than the C64, but those machines were limited to 32K RAM. In order to squeeze 64K RAM + kernel + BASIC into the C64, they were limited to 4K ROM for BASIC & 4K for kernel, and the DOS functionality was crippled as a result.
The C128 also had a better DOS.
As primitive as the dos seemed it have an advantage in that the drives were intelligent devices so the host did not have to care about the details of the file system.
You could just hook a 1581 to a C64 and it would work.
Yes, you only needed to care about paying for a drive as much as you already paid for the computer in the first place!
I always assumed it was Tramiels “brilliant” plan of selling more MOS chips at big markup. After all alternative would be sourcing real floppy controller chip like NEC 765 or WD1771, you know, like normal people did, aka everyone.
Hmmm, ship a cartridge with controller chip, small rom and address decoder plus STANDARD floppy? or whole effing computer at huge margin? choices choices…
Had they done that way, they would have needed a filesystem and FDD driver on the C64 side taking up valuable space in the very limited ROM space of the C64. Giving the disk drive its own CPU, RAM and ROM meant the disk drive interface was fairly simple and didn’t require very much in the way of ROM and RAM space in the C64 itself.
somehow everyone else managed with onboard ram without selling you kitchen sinks, not to mention Apple 2 Woz machine hack in 4 KB ram computer.
These were a “lot” cheaper than the Apple ][ though …
in 1983 180K Tandon TM100-1 drive was $165-190, 360K Tandon TM100-2 ~$240, 720K Tandon TM100-4 $315-340
Not sure what you’re talking about but a Commodore 64 was dramatically cheaper than an Apple ][
C64 floppy drive was 2x the retail cost of normal floppy drive in 1983.
Yes, which brings this whole discussion full circle … the drives were more expensive because the machine itself was cheaper.
Drives were more expensive because they packed almost whole another C64 inside. At the end of 1983 C64 cost ~$200, precisely the difference between Tandon TM100-1 and 1541. You paid 2x more for 10x slower drive.
Yes, they had to pack more intelligence into the disk drive, to compensate for the cheaper (lower spec) main unit. My understanding of it is that C64 was targeted at a lower price point, and so corners were cut. The version of BASIC used was an older version with “very poor disk support” because it used half the RAM and they didn’t envisage disks to be that popular with their target market.
You might have a point that the C64 disk drive was poorly designed and implemented and had a whole load of redundant hardware, but that wasn’t for the want of trying …
C64 is not a multi threaded machine, no one needs non blocking IO. Why put another computer inside the drive when your main one will just be sitting there waiting for an answer, “serial” port is polled and bitbanged anyway because of “brilliant” hardware design. All this when you just needed a pass thru cartridge with floppy controller chip, additional ROM for disk handling code, and mapper (PAL/GAL, for pass thru). You could even get rid of third chip giving up pass thru, dedicating expansion port solely to the floppy.
But Commodore/MOS didnt manufacture any floppy controller chips, think of all the lost revenue! :(
TLDR: it would look like this:
http://www.8bit.dk/pictures/Commodore/Expansion%20Port%20Stuff/IB-PLC%20-%20DD-001%20-%203.5%20FloppyDrive%20-%20In%20Box/slides/TIB-PLC_-_DD-001_-_3.5_FloppyDrive_15.JPG
what is this? Precisely what I am describing :) It was called 3.5″ The Ultimate Drive TIB PLC DD-001 and was made by third party. Uses 82C765 floppy controller chip. From test in zzap64 magazine:
“Commodore 1541 5.25″ drive
Intro 48 seconds
Main Game 130 seconds
Commodore 1541 5.25″ drive (plus Action Replay Fastload)
Intro 8 seconds
Main Game 11 seconds
TIB 3.5″ Ultimate Disk Drive
Intro 3 seconds (virtually instant, as drive takes about 3 seconds to initialize)
Main Game 6 seconds ”
Standard PC drive, ROM, and standard 82C765 floppy controller chip instead of whole computer crammed into huge box, 20x faster than out of the box Commodore 1541.
I suspect it was Commodore management driven design, and we all know how good that was cough C128, cough A600, cough CDTV, cough CD32.
“But Commodore/MOS didnt manufacture any floppy controller chips,”
Well that’s it exactly? Why would they undermine their whole business model (i.e. vertically integrated manufacturing to reduce costs) by buying in chips from a 3rd party? Just so that some hardware afficionado 30 years later can laud their parsimonious design aesthetic? That makes no sense.
Commodore brought personal computers to the masses by doing it cheap and nasty, but “good enough”. It makes no sense to consider the cost of the 1541 without considering the cost of the original unit.
You are comparing Apples with Apples, which is fine but you’re forgetting about the rest of the basket.
Actually the 1541s $400 price doesnt seem that bad. The atari 1050s 128k drive cost $300, the shugart sa-400 cost $390 with no controller, and a Disk II with controller cost $595. The computers which these were used with would all be a much worse buy than the C64.
This was actually noted by one of the design engineers in an early magazine article. They purposely used an old version of BASIC with limited disk support because the more up to date version was double the size. He said it was a painful decision but since they expected it to be mostly used with tapes anyway they decided to save the disk space. Only read this a couple of weeks ago but if I can remember where I’ll post the link.
It’s discussed on p55 of this article .. the original is floating around somewhere!
https://spectrum.ieee.org/ns/pdfs/commodore64_mar1985.pdf
What do I plug the Lightning plug into? Not my phone, it has a headphone jack!
What a fantastic achievement! Can’t wait to take a look at the source.
Must… keep… myself… from… pretending to care WTF “Apple Lightning” is.
“and you’re not going to find a better drive emulator around”
*cough*
http://www.1541ultimate.net/content/index.php
Not to detract from Steve’s achievement.
Actually this supports files which 1541 Ultimate doesn’t support, yet. I think the point was this is a $40 project that you can build yourself, instead of ordering a $200ish 1541 Ultimate and come away with a sense of accomplishment that you got it working.
I don’t think the 1541 ultimate works on Vic20, C16, C116, Plus4 or C128 (in 128 mode)
Are you also offering the CAD files, so that we can order a PCB from a prototyping shop ?
Just built mine.. Works nicely!
So have they also emulated the end-stop rattle?
More or less. Just plug in audio amp into the headphone socket.
This looks great and could be interesting if teamed up with the raspberry pi touch screen. One thing though, I wonder if it would be possible to design something similar but instead of using an ss card to store your images on, access a network share instead? I’ve got all my d64 images on a NAS and would love the ability to access them using something like this ..
I actually started to implement code for the official Raspberry Pi touch screen. Then thought that they were so expensive, very few would actually use it. I then thought about supporting all kinds of low res inexpensive SPI screens. My goal was always to keep the hardware as inexpensive as possible. Then one day I thought that the cheapest, hires touch screen is the one everybody owns already. I’m currently developing a smartphone app that can be used to communicate with the Pi via BlueTooth.
NAS really? A 32GB SD card is too small for all your disk images?
I think it would be cool for a 2 row display similar to the TAPIUNO so that simple navigation is possible.
I would use SSHFS on the rPi to mount the D64 images folder on your NAS.
Can even mount the folder over an internet connection from multiple devices.
The files are small enough that they would still probably load decently.
Exactly what I was trying to accomplish with a Pi Zero, using a bare metal kernel (this do that as well), but lost interest. Nice to see it is not impossible.
Maybe I’ll give it another go, but with the ESP32 this time. I guess it would be possible to run emulation on one core.
That’d be nice. You could have internet/lan access aswell and load the data alternatively from a NAS.
I’m interested in porting this to the ESP32 as well. :)
So if you plug a Mach 5 cartridge into your C64 and use this drive emulator, do you still get the same weird glitches as the original?
I’ve still got all my floppies. But I haven’t touched them in 25 years. I would be greatly surprised if any of them still load, even just to copy.
A few years ago, I bought an original copy of M.U.L.E. from eBay. Although 30+ yrs old, it loaded and ran perfectly! :-)
(and that’s still one of the catchiest game tunes ever)
Maybe I missed it, but being cycle for cycle doesn’t mean it can be faster. Does this deliver data much faster than the HP-IB interface?
doesn’t mean it can’t be faster – I vote for edit option
Where do you get an SD2IEC for $20? In Europe it’s almost €50.
Great project! Recently got my hands on a C64 (the all biege version )and a 1541 with a few disks.
I had the origional C64 and a 1541 and learned to program on it inand a Commodore PET with a whopping 4k of memory. should be fun to build but what are other logic levelers other then the sparkfun bob12009. I am looking on eBay and Amazon for the needed parts.
What about a case for Pi1541 ?
https://sigous.rajce.idnes.cz/Pi1541/
Are you going to publish the .STL files for the case?
Does this have, or will it have, any support for the 1571, or 1581 and D71 or D81 images?
“If you’re cheap, there’s always the tape drive interface and a ten dollar Apple Lightning to 3.5mm headphone adapter.”
You can’t just make a comment like this and not explain it. I’ve Googled this sentence and variations thereof and can’t figure out what how this works.
Most likely they are referring to the jack that you would connect a cassette deck to in order to load from/save to tapes. With the correct cable and an adapter (if needed) you can playback tape files from a modern device with audio playback capabilities.
Thanks for the reply but it still doesn’t explain everything. I have a Datasette, but I don’t remember seeing a headphone jack on it. I have a tape recorder with a headphone jack, but why would I need a lightning cable for that? There’s no way I can see to attach a lightning cable to the cassette interface. There’s also no way I can see to attach a 3.5mm plug to the cassette interface, either. Bewildering.