CLK pin 13 connecting A-star sd card breakout

Hello there,

I’m trying to connect an adafruit microsd card reader to the A-star 32UA, but can’t figure out how to connect to the CLK pin (arduino pin 13) which just seems to be connected to the yellow led and not broken out with the rest of the SPI pins ( 10, 11, 12 for CS, MOSI (DI), MISO, (DO) respectively.

Do I have to try to solder to the edge of the yellow led or is there a better way, to get the sd card reader working?

The arduino sd library example sketch just freezes after uploading.

Any help appreciated.

Chris

Hello, Chris.

You should be able to use that MicroSD card breakout board with the A-Star by connecting to the SPI pins available on the ISP header. You might find the diagram below helpful for using those pins (we will try to add this to the user’s guide soon).

Please note, that the SPI pins on the A-Star do not correspond with the SPI pins on the Arduino UNO (the A-Star uses the ATmega32U4 and is more similar to the Arduino Leonardo than the Uno). You will want to connect the CLK pin from that breakout board to the SCK pin on the ISP header. DI and DO should connect to MOSI and MISO, respectively. You should be able to use any of the other digital IO pins for the CS pin.

- Jeremy

Thanks jeremy,

I’ve made some progress on this after your advice, but I’m still unable to reliably read or write to an SD card (same card and reader that I’ve used connected to an arduno nano) ocassionally the ‘CardInfo’ example in the arduino SD library will run OK and report either that there is a problem with the card or wiring, but mostly the sketch loads into the A-star (with associated flasing of green and yellow leds + 1 flash of the red led on the card reader) then nothing happens, no output to the serial line at all.

I tried commenting out the wait for Leonardo section, with no effect,

// while (!Serial) {
    //; // wait for serial port to connect. Needed for Leonardo only
  //}

I also tried editing the part of the Sd2PinMap.h file which corresponds to the Leonardo to ensure that the pinouts are correct

#elif defined(__AVR_ATmega32U4__)
// Leonardo

// Two Wire (aka I2C) ports
uint8_t const SDA_PIN = 2;
uint8_t const SCL_PIN = 3;

// SPI port
uint8_t const SS_PIN = 10; (originally set to 17)
uint8_t const MOSI_PIN = 16;
uint8_t const MISO_PIN = 14;
uint8_t const SCK_PIN = 15;

I also tried using the latest SdFat library “Google Code Archive - Long-term storage for Google Code Project Hosting.

Any thoughts as to what the problem might be?

If it is only working sometimes, it sounds like it might be a connection issue. Could you post pictures of your setup? Could you also post your entire code (A simplified version with just a few lines that are problematic would be helpful)?

If you have other devices that use SPI to communicate, you might try testing the A* with it to make sure its hardware SPI is working properly.

- Jeremy