1
\$\begingroup\$

What I want to do is put a dummy SD card (the connector going directly to the device with a cable going to a micro controller) into a device so that when the device tries to write a file the micro controller can intercept it and write it to another location, and then when the device wants to read it you can emulate the files that are supposed to be there except that they are stored on the micro controllers side.

Is there such a project that already exists? Is this even possible (i assume so as thats how most USB sticks work, kind of)? What would I need to do this project?

\$\endgroup\$
10
  • 2
    \$\begingroup\$ Yes it's possible. You just described a flash memory controller. \$\endgroup\$
    – Passerby
    Commented Feb 20, 2016 at 5:22
  • \$\begingroup\$ Yeah, i guess but how would one go about implementing that if say you wanted to take data from 2-3 external devices at the same time, so that you can save them on one storage medium? So you have 3 things writing data to the micro controller at the same time but the MCU only has one storage medium to write to. \$\endgroup\$ Commented Feb 20, 2016 at 20:51
  • \$\begingroup\$ That's much much more complex. Connecting three pcs to one sd card (emulator) at the same time? You're better off with network storage protocol, ftp,smb,nfs, or even something like wireless SD cards do. A single pc to memory card emulator would be just designing to a standard. 3 pcs and your talking a significant undertaking. \$\endgroup\$
    – Passerby
    Commented Feb 20, 2016 at 20:56
  • \$\begingroup\$ Well what I want to do is more of a work around for not being able to connect multiple cameras to an MCU, so what I want to do is emulate the SD cards that cheap point and shoot cameras use to save the images. So I wire up the triggers of the cameras to the MCU and grab the images directly from the SD slot in each camera. Hence why i need to keep track of 2-3 devices and save the data that they spew out. The storage could be an SSD which would be faster than the 3 SD cards can take data in the first place so the camera shouldn't know the difference while the MCU works \$\endgroup\$ Commented Feb 20, 2016 at 21:07
  • \$\begingroup\$ Wireless sd cards are only 10~30 bucks. 3, with a small pc like an RPi pulling the data, which can then either process it itself or pass it to an mcu. \$\endgroup\$
    – Passerby
    Commented Feb 20, 2016 at 21:10

2 Answers 2

1
\$\begingroup\$

what I want to do is more of a work around for not being able to connect multiple cameras to an MCU, so what I want to do is emulate the SD cards that cheap point and shoot cameras use to save the images. So I wire up the triggers of the cameras to the MCU and grab the images directly from the SD slot in each camera

Simple solutions:

  • Use USB cameras connected to a USB host MCU like Raspberry Pi
  • Use WiFi or LAN cameras
  • Use a WiFi-enabled SD card

Complicated solution:

From the point of view of the camera, your device must behave exactly like a SD card. The camera will probably cache some of the contents of the card, including filesystem metadata, so there is no hope to have one card with one filesystem connected to several cameras, nor to be able to modify the contents of the emulated SD while it is attached to the camera.

Also the device should respond to commands whenever the camera sends them, since the camera expects the SD to be ready. This could be a problem because there doesn't seem to be a simple way for the card to tell the camera that it is busy and send a command later. So if you use a naive approach like this, and your micro is talking to the SD card, and the camera decides to talk to it at the same time, that won't work. If there is no switch on the bus then there will be a collision, and if there is a switch the camera will try to talk to the SD card while the switch has connected the card to the micro instead, so the camera will probably decide there is no SD card, so GTFO.

If I had to do this, I'd probably put a tiny FPGA between the camera and the SD card, that can receive and buffer commands sent from the camera to the card, then forward them to the SD card when the micro isn't accessing it. So the FPGA would act like a SD switch, allowing the camera to read and write and the micro to read, but not at the same time of course. I guess if the camera sends a command to the FPGA while the micro is busy with the card, the FPGA should buffer the command while the micro finishes, then take control of the SD, forward the command to it, and let the SD and camera talk together.

This sounds like a very complex project, especially considering the simple off the shelf competing solutions.

\$\endgroup\$
0
\$\begingroup\$

Depending on what you want to do, you might be able to do this using an SD Card as a proxy. Connect the SD connector to a real SD Card through resistors and also connect a microprocessor to the same SD Card lines. That way you can monitor the writes to the SD Card also write that (or other contents) to the SD Card location of your choice. Also, you could possible have more than one SD Card connected to that writes go to one card and reads come from another, both of which the microcontroller has access to an can manage.

This Product/project does something similar. SD-WIFI

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.