Hi all, after a few days of testing, I achieved a great writing speed with SdFat library, so I want to tell you how to do this. First you have to do this, like admin posted before (many thanks for your support):
The basic problem is that the SD card driver is hard-wired into the ShieldBuddy Arduino library so the SdFAT library is ignored. It looks like the SdFAT library is much faster than the standard one is because it uses a DMA-based SPI driver. Theoretically this is possible on the ShieldBuddy also but we have not implemented it yet.
The SdFAT library can be used but you will have to remove the hard-wired one. This is done by editing the platform.txt in "C:\Program Files (x86)\Arduino\hardware\aurduino\aurix".
platform.txt (11.23 KB)
Make sure you save the original one!
Delete the "C:\Program Files (x86)\Arduino\hardware\aurduino\aurix\libraries\SD" directory
The SdFAT library is then used. However we have not extensively tested this and there is no guarantee it will work properly. Running the SPI at 50MHz will not work. 10MHz is a safe starting point!
Then enable the SdFatSoftSpiEX class in SdFatConfig.h, initialize your sd object with SdFatSoftSpiEX<61, 63, 62> sd; // that are the MISO, MOSI and SCK pins on P201 Afterwards you can do sd.begin(SD_CS_PIN, SD_SCK_MHZ(40)) So I achieve 981KB/sec writing speed in a simple bench test with an 16GB MicroSDHC card. I think this is pretty fast! I am very happy with this, because now my project is working like it should do.
I have been trying to get an ADAfruit Display/SD card board operating
I have not succeeded in getting the SD Card using Pins 13,11,10 on the ShieldBuddy despite the fact that the display works fine on these pins. I have tried all the fixes suggested on the Web to no effect.
I then read this thread on "Fast SD" and realised that the SD software seems to use the SPI pins on the P201 connector using the guidance above was able to get a stand-alone ADAfruit SD Breakout Board working.
I am using the Arduino/VB IDEs but this strategy would probably work also with the Eclipse IDE
What to do: Just connect the board to Pins 61, 63. & 62 // that are the MISO, MOSI and SCK pins on P201.I used Pin 4 as the card select pin and bingo!
I've tested to change the SPI pins to other digital pins and it's working very well. So you can use every digital pin you want as MISO, MOSI, Clock and CS. I only want to tell you cause you can use more other shield easier if the pins P201 are free. You only have to change the pin numbers in the SoftwareSpiEX Class at the beginning of your program. Have fun!
I have the D step version would i remove the sd library from the same file as shown in this thread. Could you show what line was removed from the platform.txt file. I am comparing your posted file to mine using notepad ++ and it seems that the line removed is part of a long line of test and not a line by itself in the file. Could you show the changes made to the sdfat config file to get SPI working. In my case i am on pins 50,51,52 with CS on pin 48.
Thanks i will remove it from both directories and give it a go with sdfat.
Would you know what files are involved with the Ethernet example i am looking for which files define the cs pin for the card. The card by default uses 10 for inet and 4 for sdcard but i have remapped those to other pins since the card is hardwired off board so its not sitting on top of the shieldbuddy.
Will try and get this example working on the sdcard on the Ethernet shield which i have on pin 47 for chip select instead of pin 4 if i plugged it on top.
You may have problems if you try to use non-standard chip selects with the Ethernet/SD card shield. This example has the Ethernet shield on (randomly chosen!) pins 22 (Ethernet chip select),23,24,25 and 37 (SD chip select):