• Please review our updated Terms and Rules here

SD card to parallel port driver for MSDOS, ver 1.1

profdc9

Member
Joined
Jan 7, 2014
Messages
20
Hello,

Version 1.1 of the SD card to parallel port is released. It includes the following improvements:

1. Supports 32-bit sector sizes for those versions of DOS that allow for it.
2. Small speed ups in the transfer rate.

The README is included below. It is fairly simple to interface your SD card to the parallel port, just four connections are needed, and you get access to much more space.

Dan



SD card driver for parallel port

I wrote this to simplify data transfer between my IBM PC and my laptop, because my laptop does
not have a 360k floppy drive but does have an SD card slot.

WARNING: I take **no responsibility** for any damage to your computer, parallel port, or SD
card, or any data. You use this driver at your own risk. It is highly recommended you use
an expendable parallel port card with your expendable SD card, and your expendable data.
It is recommended that you use a level converter IC with between your 5 volt parallel port
outputs and the SD card 3.3 volt inputs. This project is intended as a fun hack for hobbyists
and enthusiasts and not for serious work.

This driver is made available under the GNU General Public License version 2. It incorporates
modified code from ELM Chan Fat FS (http://elm-chan.org/fsw/ff/00index_e.html).

Usage:

In your config.sys file

DEVICE=SD.SYS /d /k /p=<partition #> /b=<port base index>

Loads and installs the SD card driver.

/d = debugging mode (displays copious debugging messsages)
/k = use card detect signal to inform dos that card is attached
/p = partition number (1-4) to partition in MBR to use. Default: first available.
/b = port base index of parallel port, one of
1=0x3BC, 2=0x378, 3=0x278, 4=0x3E8, 5=0x2E8
Default: 0x378

For best results, format your SD card with a FAT16 partition which is less than 32 MB in size.
NOTE: Many versions of DOS don't know how to handle FAT32, and many can't have FAT16 with a
partition size greater than 32 MB. Therefore, if you want to play with this, make your parition on
the card FAT16 and less than 32 MB. This assures the best compatibility. You can have multiple copies of the
driver loaded if there are multiple partitions on your SD card you want to use simultaneously.

I have used Adafruit's microSD adapter
(http://www.adafruit.com/products/254?gclid=CLH7l4iEkrwCFQPNOgod7BkAQA)
if you want a relatively simple way to interface your PC parallel port to
the SD card. The adapter provides the 3.3 volts needed to power the SD card, as well
as a the level shifting between the 5 volt parallel port output and the 3.3 volt input.
If you directly connect a 5 volt output to a 3.3 volt input, you risk latching up the
3.3 volt input and damaging the card or computer from exceesive current.
Some have used series resistors instead of the level converters, but I found this
to not be that reliable and still may have this problem. Also, some SD cards MISO/DO
outputs are unable to drive a TTL input of some parallel ports, so you may need to add
a buffer between the two as well. I have found quite a bit of variability in the drive
current required for the inputs of various parallel ports.

The driver uses the very slow serial peripheral interface (SPI) mode of the SD card. The
speed, which depends on your PC speed, could be as slow as 10 kilobytes/second. This is
not a replacement for your hard drive. Your parallel port should be configured for standard
mode (not bidirectional) if applicable.

The connections between the parallel port and the SD card are as follows:

Parallel port SD card

PIN 25 signal GND GND (Vss)
+3.3V Vdd (power)
PIN 2 signal D0 CMD / MOSI / DI (SPI data in)
PIN 3 signal D1 SCLK / CLK (SPI clock)
PIN 4 signal D2 DAT3 / CS (SPI chip select)
PIN 13 signal SELECT DAT0 / MISO / DO (SPI data out)
PIN 11 signal BUSY Card detect (if you SD card slot has one)

For similar setups, look up parallel port to JTAG adapters which are used for in circuit
programming and debugging.

Good luck and be careful!


 

Attachments

  • SDPP11.zip
    42.1 KB · Views: 34
Connecting and SD card through parallel port is an interesting idea.
I am guessing that it is slow partly because of bit banging. And if so adding a dedicated hardware to do parallel to SPI protocol conversion might speed the things up... Even something as simple as a PIC16F88 microcontroller.
 
I guess this would be too slow for a virtual floppy concept? Still seems quite practical and not terribly expensive which is nice.
 
I was thinking a simple shift register... so 8 or 9 IO port reads for a byte.
 
Some of the low end PCI32 MCUs can drive the SPI interface at 40MHz--and have 5V tolerant inputs as well. It would be an interesting exercise to see if a low-power MCU (e.g. MSP430) could suck enough power off the parallel port signal lines to eliminate the need for a separate power supply.
 
hi.
Somebody has built this proyect?
I have a question about connection.
Where are found 3.3 in parrallel port? or where is the VDD for the MicroSD card breakout board+

Thk
 
Where are found 3.3 in parrallel port? ...
Nowhere, you have to provide it yourself. But as you need to buy a SD card holder anyway, look for one a sd card board. It provides a ready 5V to 3V3 conversion and you can feed it with 5V.

Edit: I only just saw that such a card was already mentioned in the original post. But compare just the prizes. FYI: I bought several of those cheap ones and they work fine.
 
Last edited:
I just bought 2 of these boards from ebay. They were quite cheap, between $2 and $3 each someplace. The come with a 5V to 3.3V regulator. They use the small SD cards so you may need to get the large adapter with the SD card, as most laptops and PCs use the full sized SD cards and not the micro size.
The boards are clearly marked for the spi connections. ( I'm using mine with a "Blue Pill", a STM3F103 processor. It was about the same price as the SD card or about $1 more. I've not finish the software but it is in progress, not as an interface to a PC ).
Dwight
 
Hi Dwight,

Did you finish this project? I'm looking for something faster than the original project, as I can't add a hard drive to my particular PC.
 
build my own microsd to parallel thingy and it works is dog slog but works, maybe is slower than the floppy drive.
First tested a 512 meg microsd what i considered ideal but is not detected by the driver, then changed to a 32 gig one and that was detected ok
For some reason tried a 512 megs partition and don't work is detected but show as random crap, crated a 32 meg one and that worked.
 

Attachments

  • 770d9422-49c4-4b4d-97cb-f3e717566807.jpg
    770d9422-49c4-4b4d-97cb-f3e717566807.jpg
    292.5 KB · Views: 30
Could you measure how much mA it draws? Maybe it is possible to power it using the other unused lines plus a bunch of diodes.
TIA!
 
I made a few of these years ago (and used one quite a bit on my Tandy 1000SX.. slow, but worked consistently.. it's powered by... the parallel port itself.
 

Attachments

  • IMG_20231110_131108202.jpeg
    IMG_20231110_131108202.jpeg
    1.9 MB · Views: 38
It looks like pin 17. Personally I would take some Schottky diodes and take the power from pin1 and 14..17.
 
BAT43, BAT42 or BAT19. One diode from each pin1 and 14..17 to this 5V input of the SD card.
 
Back
Top