Ruud's Commodore Site Home  Email

1541IDE




Current state

!!! Frozen !!!
This project has been replaced by 1541IDE8. I keep it online as it still contains interesting information and ideas.


What is it - the original idea

The IDE-hard disk drive has 16 data lines and 7 control lines. Get rid of the floppy disk of your 1541 and you'll end up with two free 6522 ports. Add the unused A-port of the other 6522 and there you'll have the needed 23 lines.

The big advantage of the above proposal is that there is relatively less soldering to do then when building a real IDE-interface. But you still need to replace the Kernal and power supply.
The disadvantage is that, because you control the IDE-HD by software, your data-throughput is lower then with a real IDE-interface. FYI, with this data throughput I mean the dataflow from the onboard 6502 to the IDE-HD or vica versa, not the one from/to the C64 or other IEC-computer!
What every other disadvantages you can think of, don't forget that the biggest advantage still is the huge amount of data you can store on a hard disk drive !!!


Parallel loaders

Using the free A-port means that we cannot use a number of parallel speed loaders using this port (Speeddos, Dolphin-DOS etc.). On the other hand there exist some excellent serial speed loaders. IMHO it is a matter of making a patch for them.
For those die-hards who insist on having a parallel loader, IMHO one could add an extra 6522 to the system by piggybacking it on top of another 6522.


Additional ideas

I already mentioned to add an extra 6522 for people who need the parallel port. Why not add even a second extra 6522? In this way we solve two minor problems:
Another idea is using only 8 bits of the IDE drive. OK, this means wasting half of the capacity of the drive but I have more then enough drives laying around doing nothing at all. And the half of a 3.4 GB drive is still equivalent to 10000 floppy sides!


The Kernal

Whatever system we choose, we'll need a file system and software to handle it. The original 16 KB won't do. So we have to replace the original ROM(s) with a 27256. When dealing with a 1541-II, one only needs to replace the original (EP)ROM and to add address line A14. When dealing with another type of drive, some more work has to be done like using a 24 pin -> 28 pin converter, adding the missing address lines and using A15 plus an inverter for selecting this EPROM.

The main idea anyway is to use the original Kernal as much as possible. At the point the Kernal starts to address the hardware for the original floppy disk, we have to break in and JMP/JSR to our own routines. And these new routines will all be placed in the $8000-$BFFF part. So even obsolete original routines won't be overwritten. The reason for this is compatibility; there could be software around that relies on these routines so replacing them could lead to unexpected errors.


Extra RAM needed?

During the first days of writing code I run into the following problem. A hard disk drive sector contains 512 bytes. So I decided to place two 1541-sectors on one hard disk drive-sector. The problem is that, when writing data to a hard disk drive sector, I have to write ALL 512 bytes. So saving one sector means I first have to read the according hard disk drive sector, then I have to replace the data of the according half and then I have to write these 512 bytes to the hard disk drive again. The problem is: where do I store these extra 256 bytes???

There are three solutions: I already found out that, when using a hard disk drive, I must store more info then with a normal disk. Some variables used for GCR en/decoding can be used for this purpose. But the moment I want to be able to handle more then one IDE-device and/or partition, I'll need more RAM for sure. So I decided to go for the extra RAM option.


The original interface

AFAIK all known versions of the 1540 and 1541 can be used. But the codes on the board for the various ICs vary from version to version. Therefore I will refer to the 6522 handling the floppy disk as #1 and to the 6522 with free A-port and handling the IEC-bus as #2.

Both the A-ports will be used to handle the data lines: port A of #1 will handle the data bits D0..7, port A of #2 will handle D8..15. Port B of #1 will handle the control lines:
* PB0 : address line A0
* PB1 : address line A1
* PB2 : address line A2
* PB3 : LED
* PB4 : write protect sensor
* PB5 : future use
* PB6 : IOWR
* PB7 : IORD
* CA2 : CS0
* CB2 : CS1


As you can see the original LED is still be used. The IDE-interface has its own pin to connect a LED to but this one will only light up when the HD is active and therefore cannot be used to flash codes or whatever.

The idea is to replace the original "write protect sensor " with a switch, just like the one CMD-hard disk drive already has. Advantage: I can keep on using the original routines handling the original write-protect sensor.

When cutting lines, makes sure the one to the SO-input of the 6502 is cut as well. Then connect this input to +5V through a 10K resistor. We don't need it right now but the resistor enables us to use it in the future.


The interface with extra 6522's

The use of the pins is exactly as above with the exception of PB3 (the LED): in this case I will use the original PB3 to drive the LED because no alterations of the original circuit and software are needed.


A real IDE interface

I also designed and partly build a real interface based on the IDE interface I designed for the C64. The biggest advantage is that it is just a matter of placing of the PCB between the original board and the 6502. The disadvantage is constructing the board, that is, by hand as I did. If you want to spend some money on making a real PCB, then that is a different matter. The design is made in EAGLE 4.15 and free.


The LPT interface

This idea is already working: 1541LPT: No more floppies anymore!. The disadvantage of this idea is that you are stuck with a big PC alongside your 1541. The advantage is, at least for me, the development of software is easier. Handling large hard disk drives means we need another file system. But writing the software for it is another story. I feel that using this configuration I have more grip on the developing of the original idea. Things can be tested much more easily IMHO. And when things work out fine, I can port it to one of the other systems.


Future expansions

The 1541 has 2 KB of RAM onboard. By piggybacking some ICs you can enlarge this number. Extra RAM always comes in handy, certainly because one of my ideas is to let the HD equipped 1541 act as two or more 1541 drives. Read about it in the next section.

In a PC one can connect two devices to one IDE-port. So why can't we? :)

Modern PC's have at least two IDE-ports. This is something that can be realized for our system as well by adding a 74LS139. CA2 and CB2 will steer the AB-input lines of this 139. Outputs Y0 and Y1 steer the CS0 and CS1 line of the first port and Y2/3 steer CS0/1 of the second port.
Hmmm, what about using CA2 and CB2 of the other 6522 as well? We could end up with 16 devices in this way :)

As CMD and our Czech friends do supply an RTC with their HD-system, I'm thinking of implementing one as well. I want to use the DS12887 for four reasons: Those people who are unfamiliar with the DS12887, it is the Dallas-version of the Motorola MC146818, the RTC used in PC's. The main difference is that the DS1287 is an stand-alone IC; you don't need an external battery/accu or crystal anymore. Of course all SW we develop must be able to run on a system without a RTC onboard. This can be realized by first checking if a RTC is onboard and if not, letting all routines concerning the RTC return a "not valid" value.


File system format

A proposal for a file system.


Development

After some weeks I found out that the task to convert the original ROM into one using the new file system was impossible for the moment. So I decided to split up the development in several steps: I finished the sources for step 1 but I am still busy with soldering the cable, so testing has to wait for the moment.


My ideas used in the steps


Not to be continued any more, please see 1541IDE8.





Having questions or comment? You want more Info?
You can email me here.