0
\$\begingroup\$

I have just got into the idea of storing multiple scripts in an SD card, and using a custom driver written to the board to execute those scripts on demand.

I have a 2GB SD card, and an Arduino Mega 2560, but I do not have the SD module to create the connections between the SD and the board in the standard way.

Since the SD card only has 9 pins, I thought "maybe I can connect the pins directly to the board and find a way to read the data without the module". Does anyone know if this is even possible? If so, any good resources for me to learn how to do it?

\$\endgroup\$
2
  • \$\begingroup\$ Without which module? SD cards can be directly connected to SPI pins of 3.3V MCU, usually 'modules' you speak of are nothing more than a PCB that provides pin headers that connect to card socket, sometimes there is only level translation to operate with 5V MCUs. \$\endgroup\$ – Justme Sep 23 '20 at 17:11
  • 1
    \$\begingroup\$ One is really supposed to make an effort to research a problem before simply posting it. If you'd taken a bit of time to look at what's on an SD module, you'd be asking any remaining question from a much more informed position. \$\endgroup\$ – Chris Stratton Sep 23 '20 at 17:29
1
\$\begingroup\$

The typical SD card modules people sell for use them with Arduino and similar boards are simply intended for use with the legacy SPI mode supported by many SD cards. All they do is break out a SD card socket to pin headers for connecting to your microcontroller - they don't include a dedicated SD card controller.

However, SD cards are not 5V tolerant, so if you are using a 5V Arduino Mega, then you will need to level shift the signals, either using resistive dividers (low speed, flakey) or a dedicated level shifting IC (practically any will do). Many of these breakout boards will provide the level shifting.

\$\endgroup\$
4
  • \$\begingroup\$ Literal code execution won't work, no, but the question uses the term "script" which if it is being used accurately implies an interpreted language, which is possible - the card contents then are merely data to be used by a program running from the ATmega's flash. \$\endgroup\$ – Chris Stratton Sep 23 '20 at 17:30
  • \$\begingroup\$ As @ChrisStratton says, scripts are just text files with data to be interpreted. I will create my own scripting language acording to my needs and the flash will have an interpreter for that language. \$\endgroup\$ – Ciro García Sep 23 '20 at 18:15
  • \$\begingroup\$ It's definitely do-able, though worth noting that there are a lot of ARM MCUs that get you resources at a cheaper price than an ATmega2560, run existing scripting solutions like micropython, and run at 3v3 removing the need for level conversion. Technically they can also execute actual code from RAM. \$\endgroup\$ – Chris Stratton Sep 23 '20 at 18:19
  • \$\begingroup\$ @CiroGarcía sure. Just wanted to make sure. \$\endgroup\$ – Tom Carpenter Sep 23 '20 at 18:32
0
\$\begingroup\$

Since the SD card only has 9 pins, I thought "maybe I can connect the pins directly to the board and find a way to read the data without the module". Does anyone know if this is even possible? If so, any good resources for me to learn how to do it?

It seems that is possible. You can find good resources to learn about it doing a search in Google, try a search for Google Images with the keywords "arduino sd card module schematic"...

I didn't tested the circuit linked. I just posted it to show how easy it could be found just googling. If you search, you will find a drawing with colour Arduino boards and color wires.

https://simple-circuit.com/arduino-sd-card-interfacing-example/

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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