Shop OBEX P1 Docs P2 Docs Learn Events
Using a microSD via a USB adapter - is it possible ??? — Parallax Forums

Using a microSD via a USB adapter - is it possible ???

Cluso99Cluso99 Posts: 18,069
edited 2009-07-13 23:00 in Propeller 1
This was prompted by Jazzed's article on the Keychain prop thread...
··· Propellering the COBY DP151 - A PocketProp [noparse]:)[/noparse]
·· 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, RamBlade, TwinBlade,·SixBlade, website
· Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
· Prop Tools under Development or Completed (Index)
· Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
· Search the Propeller forums (via Google)
My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

Comments

  • BradCBradC Posts: 2,601
    edited 2009-07-13 03:35
    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!
  • dMajodMajo Posts: 855
    edited 2009-07-13 07:35
    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
  • localrogerlocalroger Posts: 3,452
    edited 2009-07-13 12:40
    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.
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-07-13 12:59
    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 shakehead.gif

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

    · Home of the MultiBladeProps: TriBladeProp, RamBlade, TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm

    Post Edited (Cluso99) : 7/13/2009 1:11:13 PM GMT
  • dMajodMajo Posts: 855
    edited 2009-07-13 13:28
    @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
  • localrogerlocalroger Posts: 3,452
    edited 2009-07-13 14:22
    @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).
  • dMajodMajo Posts: 855
    edited 2009-07-13 14:44
    @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.
  • mynet43mynet43 Posts: 644
    edited 2009-07-13 15:38
    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
  • dMajodMajo Posts: 855
    edited 2009-07-13 16:19
    @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"
  • dMajodMajo Posts: 855
    edited 2009-07-13 16:25
    @Cluso99
    I hope we are not hijacking your thread
  • mynet43mynet43 Posts: 644
    edited 2009-07-13 16:50
    @ 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 GreenMike Green Posts: 23,101
    edited 2009-07-13 17:14
    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.
  • RaymanRayman Posts: 14,844
    edited 2009-07-13 17:26
    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
  • mynet43mynet43 Posts: 644
    edited 2009-07-13 17:33
    @ 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.
  • jazzedjazzed Posts: 11,803
    edited 2009-07-13 18:00
    Like Mike said in the part of his comment that could be easily ignored "... neither has the speed nor the memory ...." Drive carefully [noparse]:)[/noparse]

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


    Propalyzer: Propeller PC Logic Analyzer
    http://forums.parallax.com/showthread.php?p=788230
  • dMajodMajo Posts: 855
    edited 2009-07-13 18:53
    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: 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
  • mynet43mynet43 Posts: 644
    edited 2009-07-13 19:04
    @ 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
  • jazzedjazzed Posts: 11,803
    edited 2009-07-13 19:22
    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://forums.parallax.com/showthread.php?p=788230
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-07-13 21:00
    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, RamBlade, TwinBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index) ZiCog (Z80), MoCog (6809)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • localrogerlocalroger Posts: 3,452
    edited 2009-07-13 23:00
    @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.
Sign In or Register to comment.