Connecting microSD card to 2 microcontrollers.

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Good day,

 

Is is possible to make circuit, which will share microSD card with 2 master devices.

 

1. I mean I connect microSD card to device number 1.

2. I use that card with device number 1.

3. I disconnect microSD card with device number 1.

 

4. Now i can connect microSD to device number 2.

... do some stuff with that. 

 

I use SDIO, I need to share DAT0, DAT1, DAT2, DAT3, CLK, CMD lines.

 

So I need some circuit. I think its possible to do with 6 transistors, 1 transistor for each line.

 

Maybe its possible to use it with some chip?

 

Thanks in advance!

 

//Nikolaj

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Something like a 74HCT4052 might be of use. I'm not sure how you'd achieve your goal with 6 transistors.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are 2 issues here:

 

  1. The physical connection;
  2. Ensuring that one "host" is completely finished and has fully closed-down and cleaned-up what it was doing before allowing the other host to start.

 

You only seem to be thinking about No 1 - but I suspect that No 2 will be the harder to crack...

 

It might be better to have a dedicated "controller" for the SD-Card, and have the others talk to it...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yea will be challenging if you stick to a physical-layer solution only.  Probably need some controller in middle to do the arbitration.

Option 2: pull-ups for all SD card pins, 'Y' connected to both controllers, with all GPIOs set as open-drain. The Chip enable pin connected to input pins on both controllers to work as a common "Busy" line.

 

 

while(!solution) {patience--;}

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Two MCUs, one card.

 

MOSI signals collide.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OP stated SDIO - so not SPI.

 

However, OP has shown no further interest - so I guess this'll just continue to rattle about as a general discussion...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oops.