![]() ![]() ![]() PinMode(10, OUTPUT) // change this to 53 on a mega // don't follow this!! or the SD library functions will not work. (10 on most Arduino boards, 53 on the Mega) must be left as an output Note that even if it's not used as the CS pin, the hardware SS pin So after making the change, the CardInfo sketch should look like this. For Arduino Mega you have to do exactly the same ignore pin 53 completely though the comment asks you to change it to 53. The solution to this problem, is that you have to let digital Pin 10 as output (for the SD library to work) and put out a logic HIGH by adding “digitalWrite(10,HIGH) ”. It took me a while to find out the solution. Most of the Ethernet shields have SD card slot, it would be pointless buying one without it. So I decided to buy a low cost W5100 Ethernet shield which has an SD card slot (Image of which is featured in the heading of this post). I read in some forum posts that the resistive network introduces a latency in the SPI bus and could be the reason for the problem. Then as usual I suspected my resistive network, especially after reading this “Is there a wiring/soldering problem?” I built another one and then another! Yet the problem persisted. One after the other I tried all their example sketches without any luck. SD chip select is the key hardware option. When I tested the quick start sketch form the newly installed library, I got this error message, Then after some research I discovered that, the Arduino SD library is just a colorful wrapper for the SDfatlib, and the actual library has much more options and can be used to debug properly. * did you change the chipSelect pin to match your shield or module? Initializing SD card initialization failed. When I burned one of the example sketch to check the Card Info, I got this error “SD card initialization failed”. I have some experience with Arduino in the past (all good ones), and I expected things to work out of the box. I was getting voltage levels that were withing the absolute maximum ratings of the SD card. I had an Arduino Mega at my disposal and built a resistive network to step down the logic levels of the Arduino SPI bus at 5v to the SD card’s at 3v3. I chose Arduino as it had a vary stable FAT (File Allocation Table) library. I was working on a project that involved the use of an SD (Secure Digital) card to log data into a text file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |