Accessing An SD Card Through A Parallel Port, Just Because

[Vinod] sent in a very cool build he says is somewhat of a ‘mad project’: he mounted an MMC and SD card under Linux using the parallel port on his computer. Even though parallel ports are getting rarer these days, we absolutely love [Vinod]’s dedication and willingness to dig around the Linux kernel.

The hardware portion of the build is very simple – just an SD/MMC header and a few resistors wired up to a parallel port. The software side of the hack gets pretty interesting with [Vinod] building a kernel module, something we rarely see on Hackaday.

We’d have to agree with [Vinod]’s ‘mad project’ sentiment, if only because of the terrible throughput of [Vinod]’s adapter; it takes him more than a minute to transfer a 1.5 MB file onto the SD card – terribly slow, to put it mildly. Nevertheless, we’ve got to respect [Vinod] for pushing the limits of uselessness and still building something cool in the process.

24 thoughts on “Accessing An SD Card Through A Parallel Port, Just Because

  1. Looks like it could be really useful for me – I have a 8Gb SDHC card that got scrambled when it was taken out of a Nokia phone at the wrong time and nothing can reformat it. I have read that the only thing that can descramble it is a Nokia N95 phone as it talks to the SD card directly rather than through a controller. maybe this hack would allow the card to be unlocked and reformatted or even better allow me to retrieve the data that is stuck in it.

    1. Oh come on, OpenWRT guys have been doing this (mmc-over-gpio in particular) for ages. Besides, there already is an mmc-spi driver in the kernel, there are spi-bitbang and spi-gpio drivers, so what we see here seems a bit overengineered.

    1. No, and being a grammar nazi makes you look like an ass, doubly so when you get it wrong.

      “An” precedes words which begin with a vowel sound. “s” is pronounced “ess” which begins with a vowel sound.

      If English isn’t your first language and that is a sincere question I apologise and please disregard the first sentence, it’s obviously meant for me.

      1. Thanks for explaining it, I didn’t know so thats why I asked. I was not trying to be rude. I thought it was only “an” if it was a vowel. I didnt know it included ones that sould like vowels too. Thanks.

      2. Well in that case I apologise again.

        In the vein of helpfulness, words which start with a consonant sound should be preceeded with an “a” even though they may start with a vowel. For example “a university”.

        Certain words which start with “h” complicate things further. I’m probably going to miss a criteria here but I’ll give it a go. Polysyllabic words, beginning with “h” which is unaspirated and followed by a vowel sound can take either “an” or “a” as it pleases the user. It’s easier to remember these as words which commonly drop the h at the start: hotel, hospital, etc.

      3. This particular rule confuses many English speakers, even native speakers, and that last example illustrates that very well. The H sound in “hotel” and “hospital” is only dropped in some dialects of English, at which point you’d use an “an” in front of them. If the H sound is pronounced, however, then an “a” belongs in front of it.
        The easiest way to figure it out is to try to say it. If you can say it with “a” and string the words together without a stop, it’s probably right. If you can’t, then it needs the N sound from “an” to allow you to string it together.

        Extra information: I’m an American English speaker so I don’t know if this is correct, but I’ve observed that British English speakers insert an R sound when a word ending in a vowel is followed by a word beginning with a vowel, though this is only in the spoken form, not the written form. For example: “The data on the card is corrupted” would have an R sound between “data” and “on.” In American English, this transition creates either a clumsy stop, or a muddy transition, depending on the speaker. The R sound smooths the transition.

      4. The “r” thing is largely accent based, sounds south western English, like Cornwall. Most English accents are non rhotic so they tend to drop “r”s in words like water and daughter with a hard r at the end.

  2. Can someone explain why transferring a file causes the computer to hang? From the website it seems that it is because it uses up a lot of CPU time? So a more powerful or multithreaded CPU can get around this? Or is it some sort of blocking issue caused by the kernel module? I know almost nothing about kernel programming.

      1. I’m not familiar with SD cards, but it appears they can be interfaced with SPI, which is then insensitive to timing as you are creating each clock pulse. To bit-bang on SPI, put the data, pulse the clock high, then pulse the clock low, repeat. The endpoint device generally won’t care how far apart the clock high and clock low pulses are, as long as they aren’t faster than the device can handle.
        As a result, perhaps the driver could be written in such a way that other tasks can still happen, as long as they aren’t using the parallel port?

  3. 1) awesome, thanks for the inspiration

    2) as for temporary lock ups…
    remember regular FLOPPY on win98 on aN old(er) computer?
    cant play MP3’s at the same time as formating floppy…
    DMA channel not fast enough to multitask…

    aka forget about playing MP3’s(floppy bitrate)
    _from_ a floppy ;) XD

  4. Neat hack, and thanks to Vinod for proof of concept. It should be noted that this could also be done using the RS-232 serial port data and control lines.

    When he says “hang” he seems to mean that it is fully occupied with the SD task and is ignoring keyboard &c inputs until it is done; not “crashed”.

    “Only” 1.5Mb/min has to be seen in the context of the Centronics printer transfer speed of 5kbytes/sec. I can think of lots of useful applications within this speed limitation.

  5. Must not be using EPP or ECP mode, which are capable of 2.0 and 2.5 megabytes per second data transfer.

    At over a minute to transfer 1.5 megabytes, this lash up must be using the SD card’s serial transfer mode.

Leave a Reply to wojtekkaCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.