PDA

View Full Version : SD card to parallel port driver for MSDOS, ver 1.1



profdc9
February 20th, 2014, 04:27 AM
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!

sergey
February 20th, 2014, 12:21 PM
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.

barythrin
February 20th, 2014, 12:48 PM
I guess this would be too slow for a virtual floppy concept? Still seems quite practical and not terribly expensive which is nice.

pearce_jj
February 21st, 2014, 01:00 PM
I was thinking a simple shift register... so 8 or 9 IO port reads for a byte.

Chuck(G)
February 21st, 2014, 02:54 PM
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.

Franchute13
July 22nd, 2018, 01:42 PM
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

Ruud
July 26th, 2018, 12:29 AM
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 (https://www.aliexpress.com/wholesale?catId=0&initiative_id=SB_20180726002656&SearchText=sd+storage+expansion+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.

Dwight Elvey
July 26th, 2018, 06:05 AM
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