Multiplexing an SD card

I have a single SD card being multiplexed between two devices. Device A is under my control, device B is not. Device A controls the multiplexer. Device A also controls Device B so it knows when Device B should be writing to disk. I can write to the SD card with device A and Device B. This has been thoroughly tested. My problems come when sharing. I am switching the multiplexer only when appropriate so you can assume that the multiplexer is correctly assigned to the device which needs it. The problem is...

If device A initializes the card and then device B attempts to write to it

-> FAIL

If device B initializes the card and then device A attempts to write to it

-> SUCCESS

If device A initializes the card, the card is removed then inserted, and then device B attempts to write to it -> SUCCESS

So, it appears that I need to place the card back into this state prior to device B accessing it. Device B is not getting the responses it wants from the card during its initialization so it fails. How do I place the card back into this state (as if the card were just inserted)? I've tried issuing CMD0 at this point but it doesn't seem to help. My only other thought is a hardware modification in which I can switch VDD to the card (simulating a removal/insertion).

Thoughts?

--------------------------------------- Posted through

formatting link

Reply to
eeboy
Loading thread data ...

Un bel giorno eeboy digitò:

Is device A using the SPI mode? SPI mode is "irreversible": once you enter it, you need to power cycle the card to allow it to switch back to the "normal" mode.

--
emboliaschizoide.splinder.com
Reply to
dalai lamah

enter

Indeed it is. Thank you, that is exactly the piece of info I needed.

--------------------------------------- Posted through

formatting link

Reply to
eeboy

I would design the multiplexer to completely simulate the device disconnecting and then reconnecting when the multiplexer is switched. Then when device A or B starts access it has to go through the full init cycle for the SD card.

I recently worked on a similar thing that switched a USB stick drive between two devices and had to have it operate like I described above to make access reliable from the particular device that "owned" the interface.

Michael Karas

--

Michael Karas
Carousel Design Solutions
http://www.carousel-design.com
Reply to
Michael Karas

I opine that to receive the loans from banks you should have a firm motivation. But, once I've received a term loan, just because I wanted to buy a building.

Reply to
PetersonHelena

You might do better to let device B talk directly to device A as if device A were the SD card. Then device A can do all of the talking to the SD card and give device B what it needs under all conditions. I guess there might be some problems with response time potentially. I don't know if SD cards have a mechanism for delays in accessing the data.

Rick

Reply to
rickman

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.