Go Down

Topic: SdFat for Due posted (Read 62087 times) previous topic - next topic

derniwi

@Paul: I have some "old" CAT6 wires (broken connectors or something like this) so it should be possible to use them for connecting and use 100 ohm terminator resistors? I haven't used term. resistors since I gave up using SCSI devices...  ;D

yoh-there

I would appreciate some help with the SdLibrary.

Software: I loaded it to the Due with the benchmark program, and set the CD pin to 10.

Hardware: MISO, MOSI, SCK are all connected to the proper SPI pins on the Due. it does NOT have level shifting, it only has 10K pull up resistors to the 3.3V bus. Also, while the card holder has it's own 3.3 volt regulator, I bypassed that and connected the 3.3 volt pin directly to the Due's 3.3 volt pin. Of course GND is connected, and CS to pin 10. All the wiring is short, can't be more than 3 inches.

While read latency seems ok (average 83 us), the write latency is horrific: 3470 us. Average write speed is under 30 KB/s.

The card is a run-off-the-mill 2GB Kingston card.

Any hints would be greatly appreciated!


Quote
Free RAM: 93235
Type is FAT16
File size 5MB

Buffer size 100 bytes

Starting write test.  Please wait up to a minute

Write 28.80 KB/sec

Maximum latency: 195699
 usec, Minimum Latency: 5                                                       
 usec, Avg Latency: 3470 usec                                                   
                                                                               
                                                                               
Starting read test.  Please wait up to a minute                                 
Read 1169.59 KB/sec                                                             
                                                                               
Maximum latency: 2741                                                           
 usec, Minimum Latency: 5                                                       
 usec, Avg Latency: 83 usec                 

ninja2

#62
Aug 21, 2016, 01:36 am Last Edit: Aug 21, 2016, 01:38 am by ninja2
@SdFatLib: can you point me to the best of your libraries for Due, please sir.

I have found these but am not sure which to choose:

1) https://code.google.com/archive/p/beta-lib/downloads
This is only one I've found that includes ArduinoDue.txt but is a bit old? (June 2013)

2) https://github.com/greiman/SdFat-beta

or is it now merged into your standard SdFafLib:

3) https://github.com/greiman/SdFat

or:

4) none of your libs support Due any more? :(

TIA

ghlawrence2000

UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

ninja2

tks G

Assuming I wire the SD correctly for DUE, should code that ran SD OK on a Mega work for Due without any modifications?


ghlawrence2000

Syntax wise there is no difference. But the DUE with sdfat has a clever DMA system that really helps speed things up somewhat!  8) ;D (As long as further down the road you don't also want to use Ethernet!)


G
UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

ninja2

OK good.
Do I need to modify my code to get benefit of the DMA speed, or will it do that for me automagically using Mega code?

ghlawrence2000

UTFT_SdRaw now included in library manager!! ;) High speed image drawing from SD card to UTFT displays for Mega & DUE.
UTFT_GHL - a VASTLY upgraded version of UTFT_CTE. Coming soon to a TFT near you! 8) Shipping April 1 2016!

rochi2211

Hi! I've tried 3 different SD card socket . 2 are just SD card holders and one is a catalex module on 3.3. Nothing works and every connection is in its own place. Do I need something more to get the thing running on Arduino due? Thank you

ard_newbie


rochi2211

Do you think it is library wise?

rochi2211

Still having problems even with that library... Wiring is correct cs pin declaration as well wiring is as well short.... Maybe the module is faulty? Do you have a model for use with due?

ard_newbie


Check your wiring, it should be similar to the one in #reply 6 of this thread:

http://forum.arduino.cc/index.php?topic=266597.0


And declare pin 4 as an output if you use this pin as CS.

rochi2211

sorry man, wiring is completely correct. I've tried 3 adaptors, declared cs pin as output, tried 3 differens micro sds. wire are short likely 10 cm. Nothing works. Am i orgetting somethig?

ard_newbie


 You could find a tutorial for SD card reading in a document provided by EVTV Motor Verks: candueusermanual.pdf from page 39.

Go Up