Go Down

Topic: SD card chipSelect setting? (Read 6318 times) previous topic - next topic

nrceptor

Dec 28, 2016, 06:22 pm Last Edit: Dec 28, 2016, 06:40 pm by nrceptor
I set up a MKRZero as shown in the example for the Weather_Data_Logger, downloaded the source and ran it with 2 different cards.  The SD cards were formatted and work on other Arduino boards.  The MKRZero board was installed under the Atmel Studio 7 IDE with Visual Micro for Arduino 1.6.  I always get as output
"chipSelect = 28
DataLogger Example:
Card failed, or not present"
I added println chipSelect to see what was going on and see it is selecting pin 28 (the code assigns "SS1"), which seems off.  I tried 4 and 10 with same result.  Others build the example and run the provided code with no reported problems.  What am I not getting right?  I have the Adafruit SD library loaded, which I needed for their logger shield, which uses pin 10, but RTCZero and DHT libraries are also installed.

sandeepmistry

Hi @nrceptor,

Pin 28 is the right chip select pin, however, please make sure you are using the latest version of the SD library. Version 1.1.0 is required for the MKRZero, as it uses a secondary SPI port.

sandeepmistry

@nrceptor could you download IDE v1.8.0 and try with that?

Also, it would be great if you could enable verbose build output via the IDE preferences and provide the log from the build output. Thanks.

nrceptor

This morning it is working perfectly!  :o  Even under 1.6.  All I did was to again take the card out to inspect the card holder and re-insert it, as I have done several times.  This time it started working.  Must have been corrosion/dirt on the contacts(?).  It is a new card so maybe it needed "breaking in" a bit. Thank you very much for your replies and apologies that it was a hardware problem!

yasunari

Hi
MkrZero use

I also have the same problem Card failed, or not present"
"chipSelect = 28
DataLogger Example:
Card failed, or not present"

"chipSelect = SSI1" <= same problem

Does everyone work normal?

Use This
SD library. Version 1.1.0
IDE v1.8.0

The PIN name of this board(MkrZero) is
Where is the document located?

yasunari

// MKRZero SD: SDCARD_SS_PIN
const int chipSelect = SS1;

About writing SD card,
Please tell me the correct name of the CS(chipSelect ) pin.
i try
SS1,SS,27,28 <-  All NG

sandeepmistry

Hi @yasunari,

This might be related to an issue introduced in v1.1.0 of the SD library. The SD slave select pin is 28.

There's a pull request on Github to fix it: https://github.com/arduino-libraries/SD/pull/29

Suggested work around in the meantime it to downgrade to v1.0.9 of the SD library using the IDE's Library manager.

yasunari

Hi,
Thank you reply

select pin is 28.
v1.0.9 of the SD library

 ALL OK!
Thank you

sandeepmistry

Hi @yasunari,

Thanks for the update. Just to let you know, v1.1.1 of the SD library has been released with the fix.

Go Up