CompactFlash to IDE adaptor

CompactFlash to IDE adaptor

Introduction

Jen has an old HP laptop with a dead screen. We use it to watch movies, Southpark and The Daily Show. It boots Knoppix from CD, which works really well. However, because it boots Knoppix with the DVD drive, we can't use the drive for watching DVDs or playing CDs. The hard drive was taken out and put in one of those portable USB enclosures for backup purposes. I needed to find a way to boot the system without using the DVD drive.

I came across something that said CompactFlash cards support True-IDE mode. Then I thought, well maybe I can use one of my old CompactFlash cards to boot Linux on the laptop. I looked around and found there were CF to IDE adaptors for sale. I tried to peek at the pictures of the PCBs for some of these, and as far as I could tell the circuit was pretty simple.

Then I tried to find some schematics and pinouts for the CompactFlash and IDE interfaces. At first it was hard to find them, but with a little dedication I found quite a few references.

This page is what I eventually used to make the connections. Of all the circuit diagrams and pin mappings I found, this one was definitely the easiest to read. There was talk of a schematic on SanDisk's website, but I never managed to find it there. It turns out it was removed. But Someone found it at the Internet Archive.

Attempt #1 - ghetto style

Following true ghetto fashion, I thought I would just tin the wire tips and stick them directly into the holes on the CF card. Of course, if I ever wanted to change the CF card this would mean switching each wire individually.

My Kiwi friends gave me an old PC for spare parts. Inside I have found many useful items. Above is a DB25 cable for a printer port with 25 pins. The CompactFlash interface has 50 pins, so I used two sections of this cable.

Another useful component was the 44-pin IDE connector that came out of the laptop. It's just above the CF card in the picture above.

Tinning finished. Tinning not only makes wires easy to solder, but it also makes the wires nice and stiff so you can push them into tiny holes and narrow cavities.

The IDE interface wired up. This step was fairly straightforward.

Beginning to connect the IDE interface to the CF card. This is where it gets a little complicated. I used the pin mappings described here because it was really nicely laid out. I started with the even IDE pins 2-44 and then did the odd IDE pins 1-43.

From pinouts.ru we see the 44-pin IDE interface has +5 VDC on pins 41 and 42. Pin 43 is GND.

Just a sidenote about voltages here. On this page, there is a large warning at the bottom saying how only some CompactFlash cards support 5V while most are 3.3V. It also says you'll ruin your card if you connect it to a 5V bus. However, on the official CompactFlash specification website FAQ, it is stated that all cards should be dual voltage, supporting both 5V and 3.3V. I took the chance and went ahead at 5V. It turns out that it was fine.

Looks like everything is connected properly. Never mind all those random wires sticking out in every direction. Those are wires that have no connections. In a subsequent step I snipped them all off so they didn't accidentally connect with other things.

It turns out I had a few pins wrong. I caught these when I rechecked everything. You can see an LED stuck in there too. This didn't work. Maybe because the resistor was too resistful or some other reason.

Here I've installed the implant. Well, as I expected, it didn't work. I thought there must be some loose connections with all that ghetto style wiring.

No matter how much I jiggled that cable, it still didn't work. However, I did notice at some stages the BIOS would take longer to load than others, which may have meant something was sort of working.

Attempt #2 with male CF connector

So the first attempt didn't work at all. I figured since I've invested so much time in this I might as well give it another shot. This time with some solder to make sure there weren't any loose connections.

I have a male CF connector from my old Canon S230. I've often daydreamed about actually fixing the camera, but after removing this important component I think those dreams have finally been put to rest.

The remains of my Canon S230. That Sony AM309-3A LCD has to be useful for something...

Soldering complete. The soldering went pretty well. I thought it would be a lot harder since the pins were so close together.

The finished product. All GND connections were soldered to the metal plate at the bottom of the above photo. All Vcc +5V connections were soldered to another metal plate (just past the top of the photo).

Initial testing using a USB to IDE adaptor. I put the housing on the male CF connector to make card removal easier and to make sure the card was being connected in the right way. I had to do some whittling with my knife to make it fit with all that solder. In the process I broke the CF housing in several areas. It seems whenever I'm trying to fix something, I break something else. Anyhow, a little super glue fixed that and soon it was ejecting the card almost as easily as before.

Test results via root-tail...seems to be doing something. What are those weird \204 bytes in the vendor/model descriptor? And the flash card certainly isn't 0 MB.

I checked all of the connections from the IDE interface using my multimeter. Some of them were loose so I added a bit more solder to them and forced them back into their respective holes.

Now it was time to test the implant in the laptop. As you can see, I have attached an indicator LED as described in this helpful page. However, I didn't put a 1K resistor between Vcc and the LED as that page suggests. I found when I did that the LED I was using was much too dim to see.

The BIOS setup on the laptop. As you can see, it thinks the CF card is a DVD drive. On some occasions it thought the CF card was a CD-ROM. On other occasions it didn't detect it at all. I think this is because sometimes some of the wires connecting to the IDE connector were loose.

It was really helpful to have that LED connected. It would flash during bootup and I could tell some communication was happening.

Jen was sleeping when I let out my first victory cry. She managed to wake up and take this picture. I downloaded a Debian rescue floppy image and wrote it to the 16 MB CF card to test whether it was being recognised at bootup:

$ dd if=rescue.bin of=/dev/hde1

It worked! I was completely amazed. In the photo above you can see the CF card is correctly recognised as (2nd line from the bottom of the monitor):

hda: SanDisk SDCFB-16, ATA DISK drive

Now I just need to find a suitable Linux distro that can fit on my 128 MB card.

Thanks for reading. Do feel free to contact me if you have any comments or notice some errors on this page.

References

  1. http://www.aemmenet.ch/Publikationen/CFtoIDEpinout.html
  2. http://www.wau.nl/hemeltje/temporary/personal/miscelaneous/cfadapter.html
  3. http://web.archive.org/web/20010528020807/http://www.sandisk.com/tech/oem_design/cf/Cf_ide.pdf
  4. CompactFlash Specification PDF from http://www.compactflash.org/
  5. http://www.compactflash.org/faqs/faq.htm
  6. http://pinouts.ru/data/Ata44Internal_pinout.shtml

Contact

donn at donn dot dyndns dot org

Copyright (C) 2005 Donn Morrison


comments:

Tin Gangsta_017@hotmail.com @ 2006.09.08.17:30: Hi if you know ho to make a cf to ide adapter in a simple conection way on a pic or doc send it to me please. :-)
agashka2@gmail.com @ 2007.03.11.01:09: nice! maybe powering it would be a good idea?

post a comment (HTML stripped):
name/email: comment: