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!
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)
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'
ups....
thanks! still learning
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?