Hello. I am using Teensy 3.2 for my final paper and I need some memory, where I could store analog data, captured using analog output type acccelerometer through Teensy. For that, I purchased one Catalex MicroSD card adapter (Link of product is here: http://www.amazon.in/Core-Technolog...scsubtag=83bd8cdd-b0ae-4e66-928b-d102a2c77bd2). It has a slot to hold microSD card and has six pins to be connected (VCC, ground, CS, SCK, MOSI and MISO). While I am able to run it perfectly using Arduino, but the same code that I used with Arduino(and some modifications) when uploaded on Teensy and the MicroSD adapter connected to Teensy, it is displaying the message that that the card could not be initialized.
I have connected Teensy with the adapter in the following way:
VCC: teensy 5V
GND: teensy Ground
SCK: PIN 13
MOSI: PIN 11
MISO: PIN 12
CS: PIN 10
I have attached a photograph of the setup, though not very clear.
The code which worked fine with Arduino but not with Teensy is the following:
#include "SD.h";
#include <SPI.h>
const int chipSelect = 10;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.print("Initializing SD card...");
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
return;
}
Serial.println("card initialized.");
}
void loop()
{}
Finally, to do some modifications in the code , I downloaded and installed SDFat library, as suggested here(https://github.com/greiman/SdFat), however I got no success.
Please someone suggest me what should I do so that I could run the adapter using Teensy 3.2. I specifically want to use Teensy 3.2 and not Teensy 3.6 as the former requires lesser area space. Thanks.
I have connected Teensy with the adapter in the following way:
VCC: teensy 5V
GND: teensy Ground
SCK: PIN 13
MOSI: PIN 11
MISO: PIN 12
CS: PIN 10
I have attached a photograph of the setup, though not very clear.
The code which worked fine with Arduino but not with Teensy is the following:
#include "SD.h";
#include <SPI.h>
const int chipSelect = 10;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.print("Initializing SD card...");
// see if the card is present and can be initialized:
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
return;
}
Serial.println("card initialized.");
}
void loop()
{}
Finally, to do some modifications in the code , I downloaded and installed SDFat library, as suggested here(https://github.com/greiman/SdFat), however I got no success.
Please someone suggest me what should I do so that I could run the adapter using Teensy 3.2. I specifically want to use Teensy 3.2 and not Teensy 3.6 as the former requires lesser area space. Thanks.
Last edited: