PDA

View Full Version : Using a microSD via a USB adapter - is it possible ???



Cluso99
07-13-2009, 10:31 AM
This was prompted by Jazzed's article on the Keychain prop thread...
··· Propellering the COBY DP151 - A PocketProp :)
·· http://forums.parallax.com/showthread.php?p=821309
And discussion about SD and microSD and adapters...
·· SD or microSD ? Here are my thoughts...
·· http://forums.parallax.com/showthread.php?p=798073

In the "SD or microSD?" thread, my reply showed some photos of microSD adapters. The one of particular interest is the USB adapter.

Now, my question is...
Can we access the microSD card via a USB connector ??? Must we go via the FT232R or can we go direct via the propeller ??
For this to work, we will have to supply 5V to the USB port.

Why would we want to do this....
USB t/hole sockets readily available. So are mini USB and they are small, and adapter cables should be easy??? Easy to shift between pc and prop Cheap

Comments anyone ???

Really, the same question applies to a real USB memory stick.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBladeProp (http://forums.parallax.com/showthread.php?p=786418), RamBlade (http://forums.parallax.com/showthread.php?p=810753), TwinBlade (http://forums.parallax.com/showthread.php?p=806697),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index (http://forums.parallax.com/showthread.php?p=778427)) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google) (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBladeProp is: www.bluemagic.biz/cluso.htm (http://www.bluemagic.biz/cluso.htm)

BradC
07-13-2009, 10:35 AM
Cluso99 said...

Comments anyone ???

Really, the same question applies to a real USB memory stick.


Quick answer is no.

All the device is doing is presenting the SD (of any variety) card as a USB mass storage device.

You could do it using the Vinculum chip I guess, but then you may as well wire the SD straight to the Propeller.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Release the hounds!

dMajo
07-13-2009, 02:35 PM
As I know all the adapter does is making your SD behave as an usb-key (as BradC already stated), so one of these should work:

- uALFAT http://www.ghielectronics.com/product/1

- USBwiz http://www.ghielectronics.com/product/5

regards

localroger
07-13-2009, 07:40 PM
One thing I was looking into was using the SD adapter to access the SD via USB externally, and via tapping the SD socket wires from the embedded CPU when the USB isn't hooked up, to share data between the embedded CPU and external PC. I had done some tests that suggest this should work, although the pullups needed for Prop SD interface might be an issue when letting the USB chip do its thing. It would be necessary to make sure the USB and Prop never try to access the SD card at the same time duh.

Cluso99
07-13-2009, 07:59 PM
Guess I am going to need to pull my USB to microSD adapter apart to see what's inside.

dMajo: Nice find but not for me http://forums.parallax.com/images/smilies/shakehead.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBladeProp (http://forums.parallax.com/showthread.php?p=786418), RamBlade (http://forums.parallax.com/showthread.php?p=810753), TwinBlade (http://forums.parallax.com/showthread.php?p=806697),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index (http://forums.parallax.com/showthread.php?p=778427)) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google) (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBladeProp is: www.bluemagic.biz/cluso.htm (http://www.bluemagic.biz/cluso.htm)

Post Edited (Cluso99) : 7/13/2009 1:11:13 PM GMT

dMajo
07-13-2009, 08:28 PM
@localroger

You can use analog switches (maxim have much) to drive (connect them to the SD IO's) the pullups with the usb +5V supply used as disable. The same supply could be routed through a resistor to a prop IO to indicate it should tristate the SD IO's and that the SD is busy by the PC.

Anyway it seems an interesting idea: go on with tests

localroger
07-13-2009, 09:22 PM
@dmajo: I had totally not thought of using analog switches for the pullups. I have verified that all of the SD adapter SD card lines are extremely high impedence when the adaptor isn't plugged into a USB port and therefore should not interfere with the Prop reading the SD. I had already planned on reading the USB power to let the Prop know to drop out, though there would still be an issue with plugging the USB in while the Prop is live. I'm also pretty sure that applying 3.3V to the SD card power while it's plugged in won't wake up the USB adapter, which avoids a bunch of complicated power switching (but that might not be true of all adapters).

dMajo
07-13-2009, 09:44 PM
@localroger
You can eventually cut the power to the usb adapter by a low power (low on resistance) MOSFET until the prop is not ready to give the control to the PC. By doing so you'll probably also not power the D+ pullup resistor (if any). This signal to the upstream USB port when a full speed device has been connected to the bus. Have a look at USB specs: IIRC "devices" have D+ pullups/pulldowns while "hosts" have D- pullups/pulldowns for supported speed signaling purposes.

mynet43
07-13-2009, 10:38 PM
BradC said: "All the device is doing is presenting the SD (of any variety) card as a USB mass storage device."

I have a question about USB card readers. The older card readers only work with SD cards <= 2G. The newer card readeres work for both SD and SDHC cards > 2B.

Is the card reader doing some internal processing to make it read both cards? If so, we could use that to our advantage.

I'm probably just showing my ignorance, but I thought this might be an easy way to solve the SD/SDHC read/write issue. I know several people are working on this. I've been helping one of them test.

Anyone know what's going on inside of the new USB card reader?

Jim

dMajo
07-13-2009, 11:19 PM
@Jim
I thing that the difference is just the same lonesock and Rokicki with you are working on. Probably the firmware just not support the HC because at the time it was made there was no specs for the HC. The CID and CSD structures are different in the two items. From the SD specs: "Only hosts that are compliant to the Physical Layer Specification version 2.00 or higher and the SD File System Specification Ver2.00 can access High Capacity SD Memory Cards. Other hosts fail to initialize High Capacity SD Memory Cards"

dMajo
07-13-2009, 11:25 PM
@Cluso99
I hope we are not hijacking your thread

mynet43
07-13-2009, 11:50 PM
@ dMajo,

Thanks for your clarification. It sounds like the USB card reader must be doing some internal processing to recognize the SDHC card before it communicates with the USB. If so, then if we can communicate with the card reader using USB, maybe it can do some of the hard work for us.

I'm familiar with the 2.0 spec, and there do seem to be some problems with cards produced before that spec was enforced.

Anyone else have some info on using the Prop USB interface to talk to the SD card reader? It doesn't seem like it should be too hard...

Jim

Mike Green
07-14-2009, 12:14 AM
It's impossible to use the Prop USB interface to talk to anything other than a PC or other USB host.

The Prop USB interface is not a general purpose USB interface. It's a USB slave and specifically a USB to serial adapter made by FTDI. You must have a USB host interface to talk to something like a USB SD card reader.

There have been some experiments with using a Propeller as a USB host directly and it neither has the speed nor the memory to do more than a simplified USB host to HID devices like a keyboard or mouse. You could use an external USB host interface like the FTDI Vinculum. You could also use an external interface like the Maxim MAX3421E USB Host Interface to take some of the processing burden off the Propeller. No one that I know of has done this yet.

Rayman
07-14-2009, 12:26 AM
You can share an SD card between a Prop and another device...

If you had an SD card with USB interface, you could send data from the PC to the SD card and then the Prop could read that data from the SD card.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm

mynet43
07-14-2009, 12:33 AM
@ Mike,

Thanks for clarifying about the USB to serial restriction.

I like your idea of using either the Viniculum or MAX3421E to interface with the card reader.

It seems like this might be a worthwhile project.

jazzed
07-14-2009, 01:00 AM
Like Mike said in the part of his comment that could be easily ignored "... neither has the speed nor the memory ...." Drive carefully :)

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve


Propalyzer: Propeller PC Logic Analyzer (http://www.brouhaha.com/~sdenson/Propalyzer)
http://forums.parallax.com/showthread.php?p=788230 (http://forums.parallax.com/showthread.php?p=788230)

dMajo
07-14-2009, 01:53 AM
mynet43 said...
Anyone else have some info on using the Prop USB interface to talk to the SD card reader? It doesn't seem like it should be too hard...

Jim
If by PropUSB you intend the FTDI converter, you can not do that. This is a usb to serial conferter: an usb "device" (slave) device. You need a usb "host" (master) device supporting the mass storage class.

In other words you need a usb host IC. In other threads it was stated several times that prop is not capable of handling directly the usb line as a host. Now if I have to use an additional IC than I personally chose a GHI Electronics product (http://www.ghielectronics.com/products): everything (low level comms, file system stuff) is already done, you have only to exchange data with minimal overhead, they states their SPI (the one connected eg. to propeller) speed to 7Mb


PS: I have witten this reply after your post of 5:50 but for some strange reason when I came back to the PC I see it was not posted. Othes have explained already it to you

mynet43
07-14-2009, 02:04 AM
@ jazzed,

When Mike was talking about the lack of memory and speed, he wasn't referring to the use of the external devices.

It seems like they might offload enough work to make it doable.

Jim

jazzed
07-14-2009, 02:22 AM
mynet43 said...
@ jazzed,

When Mike was talking about the lack of memory and speed, he wasn't referring to the use of the external devices.

It seems like they might offload enough work to make it doable.

Jim


Huh??? If this is really the case, then I apologize for urging caution.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--Steve


Propalyzer: Propeller PC Logic Analyzer (http://www.brouhaha.com/~sdenson/Propalyzer)
http://forums.parallax.com/showthread.php?p=788230 (http://forums.parallax.com/showthread.php?p=788230)

Cluso99
07-14-2009, 04:00 AM
Thanks all.
Seems what I was hoping is not possible. Using another chip defeats the original purpose. It would have been nice to do this in Steve's keychain prop.

I can already transfer data to my microSD card from the PC in 2 ways. Either via a SD adapter and the laptop SD socket, or via a uSD to USB adapter and the laptop USB port.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Links to other interesting threads:

· Home of the MultiBladeProps: TriBladeProp (http://forums.parallax.com/showthread.php?p=786418), RamBlade (http://forums.parallax.com/showthread.php?p=810753), TwinBlade (http://forums.parallax.com/showthread.php?p=806697),·SixBlade (http://forums.parallax.com/showthread.php?p=780033), website (http://bluemagic.biz/cluso.htm)
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator) (http://forums.parallax.com/showthread.php?p=790917)
· Prop Tools under Development or Completed (Index) (http://forums.parallax.com/showthread.php?p=753439)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index (http://forums.parallax.com/showthread.php?p=778427)) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google) (http://search.parallax.com/search?site=parallax&client=parallax&output=xml_no_dtd&proxystylesheet=parallax&proxycustom=<HOME/>&ie=&oe=&lr=)
My cruising website is: ·www.bluemagic.biz (http://www.bluemagic.biz)·· MultiBladeProp is: www.bluemagic.biz/cluso.htm (http://www.bluemagic.biz/cluso.htm)

localroger
07-14-2009, 06:00 AM
@DMajo -- with regard to those low voltage drop MOSFETs, would you have any recommendations for parts I could be playing with (inexpensive, readily available, like 2N2222 etc.) and standard pullup/pulldown circuits? I'm afraid all of my training dates from the bipolar days, this would be a useful thing to spend some time learning. Half a volt is a much bigger deal when starting at 3.3 than when starting at 5.0.