[SOLVED]ProMicro with Adalogger Connection Issue

Hello All,

Back with another likely simple fix that I've been struggling with for hours.

Description: I have an Inland Pro Mico and Adafruit Adalogger, links below.
In the screen shot below you will see my current setup. Im not worried about the RTC on the board.

I understand the Pro Micro pinout to be
SD card attached to SPI bus as follows:
** MOSI - pin 16
** MISO - pin 14
** CLK - pin 15
** CS - pin 10? I've also tried pin 3

My output from the code below is always: Initializing SD card...initialization failed!

Thank you for any guidance.

Code:

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

File root;

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(10)) {
    Serial.println("initialization failed!");
    while (1);
  }
  Serial.println("initialization done.");

  root = SD.open("/");

  printDirectory(root, 0);

  Serial.println("done!");
}

void loop() {
  // nothing happens after setup finishes.
}

void printDirectory(File dir, int numTabs) {
  while (true) {

    File entry =  dir.openNextFile();
    if (! entry) {
      // no more files
      break;
    }
    for (uint8_t i = 0; i < numTabs; i++) {
      Serial.print('\t');
    }
    Serial.print(entry.name());
    if (entry.isDirectory()) {
      Serial.println("/");
      printDirectory(entry, numTabs + 1);
    } else {
      // files have sizes, directories do not
      Serial.print("\t\t");
      Serial.println(entry.size(), DEC);
    }
    entry.close();
  }
}

Links:

you swapped MOSI and MISO.
and this module is 3V powered, not 5V.

I thought the VCC on the inland board is 3.3v.
Ive tried the MOSI & MISO in both direct and swapped configs all with the same result.

not a name of file

True but i get stuck at "initialization failed". To me its not evwn seeing the SD logger

oh! it's work on Wokwi, and shows file list.

you may done:
wrong connection of 3 SPI wires
wrong power
wrong lib
damaged SD card or module

Thats kinda why im here..
Sd card is brand new and only ever been in the sd logger

The website shows 5V and 16MHz clock frequence. If you have a 3.3V version the clock would be 8MHz.

Have you soldered the wiring, or otherwise connected it securely?

I checked and I have the 5v board. I rewired the SD logger to 3v and i still get stuck at "initialization failed" This is in a breadboard for now.

connecting a mini SD card reader to a Pro micro (3.3V 8MHz) so

// Pro Micro (3.3V 8 MHz version) connections
// Pro Micro SCK pin 15 to SD card SCK
// Pro Micro MISO pin 14 to SD card MISO
// Pro Micro MOSI pin 16 to SD card MOSI
// Pro Micro pin 10 to SD card CS
// Pro Micro pin GND to SD card GND
// Pro Micro pin VCC to SD card 3V3

and running your code of post 1 the serial monitor displays

Initializing SD card...initialization done.
SYSTEM~1/
	INDEXE~1		76
DATA.TXT		486
TEST.TXT		77824
FOO.TXT		13
done!

I appreciate your confirmation. I have tried 3 SD cards of various size and brand new. I may have a damaged SD board. I have other SPI devices working so ill have to investigate further it seems.

connected a different SD card reader to a Pro Micro 5V 16Mhz
same connections as post 10
worked OK - photo
image

  1. reader on left I used with Pro Micro 3.3V - clearly labeled 3.3V power
  2. reader on right I used with Pro Micro 5V - worked OK with VCC connected to RAW (5V) or 3.3V power - note MISO is labeled MOSO!

what are the labels on your SD reader?

EDIT: do you have any other devices connected to the Pro Micro?

SOLVED

Needed an logic level shifter for SI,SO,SCK. Not just to power the board.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.