Read SD Card over USB
mynet43
Posts: 644
I have a customer that wants me to read an SD card through a USB port.
If I use the standard Prop USB interface, and plug a USB card reader into it, will I be able to see it?
Has anyone done this before? And what format will I see the data?
I'm hoping someone has some sample code to make this happen.
I'm familiar with the standard USB Prop interface using the FT232RL.
I also know how to read an SD card from a standard socket using fsrw26.spin.
I'm trying to combine the two.
Any help or sample code will be really appreciated.
Jim
If I use the standard Prop USB interface, and plug a USB card reader into it, will I be able to see it?
Has anyone done this before? And what format will I see the data?
I'm hoping someone has some sample code to make this happen.
I'm familiar with the standard USB Prop interface using the FT232RL.
I also know how to read an SD card from a standard socket using fsrw26.spin.
I'm trying to combine the two.
Any help or sample code will be really appreciated.
Jim
Comments
The only way to do this would be with an overclocked prop and the USB stack, but I don't know if that's ever been done.
Why do you need to read it through the USB port? Why not an SD card socket?
$1.00 including shipping. They are available for micro and standard sized SD cards.
It seems strange to add additional layers between the Prop and SD card since the Prop can read SD cards fine without the reader being in between the two of them.
As others have pointed out, using the Prop as a USB host is still experimental and will only work with a limited number of USB devices (I think).
SanDisk has today announced a unique SD card which has a hinged portion, flip this over and the card becomes a USB 2.0 Flash Drive. This neat piece of engineering means that you can flip the card out of your camera and straight into your computer without the need for any card readers or cables. Clever. SanDisk expect to be able to produce this new card in capacities of up to 1.0 GB, they will have more detail and initial samples at the upcoming PMA 2005 show.
http://www.dpreview.com/news/2005/1/6/sandisksdflip
If so, then as far as I am aware, you will require a special app on the pc to achieve this.
Currently I am working on (but stalled the last week due to other work) on file transfers between VB6 and (to/from) the SD card on the prop. I am using the basics Michael Park did in Sphinx, using a simple checksum. I am also using this prop program to transfer files between the FAT16/32 system on the SD card and the CPM2.2 system we have within contiguous files on the SD card as well.
Michael Park gave a C example of just the transfer code, not the serial code. This may also help you.
Overclocking is not required if you are using the FT232 chip.
It looks like either Mike's suggestion for the Parallax Memory Stick Datalogger, or the Vinculum chip are possibilities.
I'm designing a new board, so I can use any chips or software I need.
I don't have experience with either of these devices. Any suggestions as to which would be easiest and most cost effective?
As far as SD capacity, the only use for this SD card will be to contain a 32KB update of the Propeller firmware.
This is used to update the firmware by customers in the field.
Thank you for your help and support.
Jim
The Vinculum chip is $5, a USB port is $0.85, an extra 5V regulator is probably $0.50.
An SD card socket (needs no other supporting hardware) is $3.
Also, a USB socket probably makes people expect more.
@Circuitsoft. The only reason I'm considering this is that it has to fit into an existing product that doesn't have room for an external SD card slot. Right now, I have an internal SD socket on the board, but the customer has to remove the cover to get to it. This doesn't work out too well. This is hooked up to an electron microscope, so it's use will be well defined. I'll take a look at the Vinculum and also Mike's suggestion. Do you have a link to some Vinculum code?
Thank you all for the great help.
Jim
If your program is too large to include this update code, then you'd have to have a 64K EEPROM. The first 32K would hold a permanent bootloader / updater that would always read updates into the 2nd 32K of the EEPROM. If no USB memory is present, it would load and execute the code in the 2nd 32K of EEPROM. There's a suitable loader that you can copy in several programs including FemtoBasic (from the Object Exchange).
The flip side is to write a program that runs on a PC to download firmware to the Prop, using the existing USB serial interface. This involves extending the USB from the Prop to the case and writing a program for the PC.
I think if you step back and consider everything, you will see that the most elegant and reasonable solution is a panel mounted SD card board and a cable to connect it back to the Prop board. Parallax sells a breakout board with mounting holes and a header to connect wires to, that should be a drop-in solution.
@pedward. Thanks for the feedback. I'm well aware of the things you mentioned. We already need the USB connector, and the enclosure case we're using is for a 7" touch screen console that's quite expensive. No room to add more connectors. Right now it's more cost effective to do it this way. I definitely don't want to connect it to a PC. I know how to do this, but it wouldn't work for my customers. I need it completely self-contained. Thanks for the suggestions. Options and critiques are always welcome.
Jim
@Mike: I always use a 64K EEPROM. I already update the firmware with no problem. So there's hope. Thanks again.
I would like to know if you can read the content of an SD card with an FTDI chip FT2232H, I see that it is possible by using spi mode but then i'm totaly lost and dunno where to start
Could someone help me out ? I already have a FT2232 spi board with CLK, DO, DI, CS, 3,3v VCC and GND. I got how to wire it up to my card using the cpi outputs.
But then I don't find any program that can read the content of the sd card, i'm not intrested in reading the files in the sd card, i would like to read the raw data in the card like this
If anyone could give me a hand, thanks a lot