Using pmod microSD

Hello,
I bought the pmod microSD to write data measured by a temperature sensor to a micro sd card. it is one of my first projects using this breakout boards, which is a little bit more complex than what I did before.
the breakout board I bought was this one Pmod MicroSD - Digilent Reference
but the documentation to use with the arduino and the example is not clear at all.
so, I went to the examples/SD/readWrite.ino
but I have some questions:
in the example it mentions:

  The circuit:
   SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

but never assign the pin 11 / 12 / 13 only the 4 when doing SD.begin(4)
so 'in principle' the code do not use this MOSI MISO and CLK ? as they are not defined anywhere in the ino file... if yes, how can I change the pin numbers?
also and more important, in case that this pins are used the breakout board I bought does NOT have the CLK, but it has other things:
DAT1, DAT2, CD, (NC), GND, VCC, CS, MOSI, MISO, SCK, GND and VCC
what should I use?
thanks in advance!

Can you say which Arduino you are using ?

my bad;
I am using an arduino uno R3 right now

Stick with default pins of your board:
MOSI = COPI
MISO = CIPO
CS = SS
SCK = CLK

P.S.
Also verify the voltage level compatibility, as I see the module is powered at 3.3V ( and your board is at 5V )??

Hello @davidefa
thanks for the answer,
so, following what you mentioned and the link, I connected the followings:
CS -> 10
MOSI -> 11
MISO -> 12
SCK->13
then I changed my code so it initialize the SD.beging in the correct CS pin (so 10).
but I still not being able to connect to the SD card.

#include <SPI.h>
#include <SD.h>

const int CSpin=10; 
File myFile;

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  Serial.print("Initializing SD card...");

  if (!SD.begin(CSpin)) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");
  }

yes, I am supplying voltage from the 3.3V pin of the arduino UNO R3 (as it has the two output 5 and 3.3 V)

Dont do that !!!!

Your still feeding the 3.3V logic SD card with 5V logic signals, it could be damaged.

Your using the wrong type of SD card adapter for a UNO, you need one that looks like this;

Screenshot - 23_08_2024 , 09_15_36

1 Like

But the output pins of your board ( cs, clock and mosi ) are at 5V at high level, is this ok for the module ( is it 5V tolerant )?
If not you need a 'voltage level translator'

1 Like

ups....
thanks! still learning :smiling_face_with_tear: :sweat_smile:
and how I saw in the first tutorials 'the good thing is that this components are inexpensive and better that way as you might burn some while learning'.
thanks a lot in any case!
a small question then from your input,
so the arduino uno digital pins, all have 5V at high, and you can not set to change the value of the 'max' of a pin, no?

No.

1 Like