-1
\$\begingroup\$

Hello I have been working with Arduinos and SD cards recently and I was able to use the SPI pins and a library to retrieve and send data from an SD card using an Arduino. I have been building a transistor computer with some D flip-flops for RAM. I was wondering how I would extract data from a txt file on the sd card with my logic gate transistor computer. I know the pinout for the SPI on the SD card: 1. CS 2. Data In 3. GND 4. 5v 5. clk 6. GND 7. Data out 8. unused 9. unused

So I know how to connect 5v and ground. What I am not sure is what to connect CS, CLK and the data pins to. DO I connect the clk pin to my 555 timer and have it run at the same speed as my logic gate transistor computer? Say I wanted to write "10001001" to the first txt file on the SD card. What would I send to the data pin and CS pins of the SPI/SD card?

\$\endgroup\$
  • 1
    \$\begingroup\$ Do you know how to implement SPI without the SD card? \$\endgroup\$ – Ignacio Vazquez-Abrams Jul 27 '16 at 19:26
  • \$\begingroup\$ I know certain things like mosi and miso \$\endgroup\$ – user2279603 Jul 27 '16 at 19:27
  • \$\begingroup\$ what about sclk? \$\endgroup\$ – JonRB Jul 27 '16 at 19:28
  • 2
    \$\begingroup\$ It doesn't work that way. You would need to build a 'computer' the size of your house using flip-flops & gates to be able to do anything useful with an SD card. \$\endgroup\$ – brhans Jul 27 '16 at 19:29
  • \$\begingroup\$ You need to implement all of this: elm-chan.org/docs/mmc/mmc_e.html ; you need either a small processor or quite a lot of state machines. \$\endgroup\$ – pjc50 Jul 27 '16 at 19:32
2
\$\begingroup\$

So I know how to connect 5v and ground

Not correct, SD card requires 3.3 Volts to work, as 5 Volts will fry them. That includes voltages on control and data pins - so your 5V logic gate transistor computer would require level shifter.

For SPI communication you could implement SPI in hardware or just use 4 GPIOs - 3 outputs and one input. This is usually called "software SPI". Talking to sdcards over SPI is not exactly simple, too.

| improve this answer | |
\$\endgroup\$

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