nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6975
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #30 on: March 16, 2013, 12:18:06 pm » |
@fat16lib I plan to play with 4-bit SDIO mode sometime in the future for SdFat. Any progress with this? I'm designing a Due clone at present and wondering if I should incorporate the HSMCI interface to an SD socket. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 30
Posts: 1105
Arduino rocks
|
 |
« Reply #31 on: March 16, 2013, 04:45:56 pm » |
It is unlikely that SdFat will support 4-bit SDIO on SAM3X since it won't work on Due.
I am reconsidering support for non Arduino boards. I can't test unless I have a board and it's a lot of labor for a few users.
I have been playing with SDIO on STM32F4 for my own RTOS use. SDIO provides super performance but you need large transfers with a lot of buffer.
I would be interested to know what Arduino applications would require more than a few MB/sec of I/O to an SD card.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6975
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #32 on: March 16, 2013, 09:32:48 pm » |
I can't test unless I have a board and it's a lot of labor for a few users. I understand, maybe I can bribe you with some hardware when the time comes  As for the number of users, that's in the lap of the Gods. SDIO provides super performance but you need large transfers with a lot of buffer. External RAM is supported, so buffer space should not be a problem. I would be interested to know what Arduino applications would require more than a few MB/sec of I/O to an SD card. That's probably the $64 question. I'm hoping to also have I2S support so maybe audio apps that analyse sound, a DSO that saves the waveform, logic analyser. I guess I'm working on the "if you build it they will come" model, but they may not. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 30
Posts: 1105
Arduino rocks
|
 |
« Reply #33 on: March 17, 2013, 03:41:47 pm » |
I wouldn't do anything to prevent use of HSMCI. I was very disappointed with Due. All of these sound great: I'm hoping to also have I2S support so maybe audio apps that analyse sound, a DSO that saves the waveform, logic analyser.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #34 on: April 30, 2013, 06:31:56 am » |
I would like to experiment with the new system. But I am in the dark how you hook up an Arduino Due with an Sd card shield (I have a SEEED Studio SD card shield v 3.1). Could you please give me some details on how you do that?
Kindest Regards, MJM
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6975
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #35 on: April 30, 2013, 10:07:59 am » |
How about a link to that shield?
In lieu of one I assume it uses SPI so you would connect it to the SPI pins and a CS pin of your choice on the Due.
One possible problem is that it may be designed for a 5v host and level shift the voltages, this may or may not work well with a 3v3 host.
Once again more information (and a schematic) of the shield would help.
_____ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #36 on: May 01, 2013, 05:07:30 am » |
The web site with only a description (no schematic) is http://www.seeedstudio.com/depot/sd-card-shield-p-492.htmlThere is no description of the connectors to this SD shield. It seems to me that a 6 pin connector on the arduino due (next to the processor chip) needs to be connected to the connectors on the SD shield. I don't know the name of these and at the store they couldn't help. The 5V vs 3.3 V problem you mention could be solved with a jumper from the Due to the SD shield. Any ideas on the connectors and how to connect them? MJM
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 75
Posts: 6975
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #37 on: May 01, 2013, 09:55:10 am » |
The first thing I see on that page is Arduino and Seeeduino compatible ( Do not compatible with Mega) That might be a problem  But without a schematic or some real information I don't know what to suggest except map out the schematic yourself from the PCB or buy a board from someone who does provide proper documentation. ______ Rob
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 9
|
 |
« Reply #38 on: May 01, 2013, 10:43:43 am » |
Thanks, That is probably wise councel.
Kindest Regards, MJM
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 26
Posts: 460
|
 |
« Reply #39 on: May 06, 2013, 08:00:46 pm » |
There's an issue when SdFat and the VGA library are used together (see http://arduino.cc/forum/index.php/topic,150517.msg1226434.html#msg1226434) I've been looking into this and the problem seems to be down to an SPI overrun. The VGA library is quite a DMA hog, and what appears to happen is that in spiRec() the TX DMA sends data faster than the RX DMA can write it to memory due to the bus contention. Looking at the data sheet, the SPI_MR register has a flag SPI_MR_WDRBT which should hold up the TX DMA until the RX DMA has read the SPI_RDR register. I'm experimenting with the following fix: in Sd2Card.cpp, in spiRec() around line 234 after this line: #if USE_SAM3X_DMAC add this line: pSpi->SPI_MR |= SPI_MR_WDRBT; in spiSend() around line 268 after this line: #if USE_SAM3X_DMAC add this line: pSpi->SPI_MR &=~ SPI_MR_WDRBT; The idea is that in spiRec() the SPI_MR_WDRBT flag helps keep the two DMA channels in sync, but spiSend needs the flag turned off again otherwise it will hang. I have not given this fix much testing other than running bench and QuickStart, and a modified QuickStart which outputs to VGA, which all work correctly.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 30
Posts: 1105
Arduino rocks
|
 |
« Reply #40 on: May 07, 2013, 09:44:34 am » |
I am rearranging SPI into files for each processor so I will add the SPI_MR_WDRBT fix to SAM3X.
I will soon post this in an SdFat beta.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 1
|
 |
« Reply #41 on: May 08, 2013, 05:33:29 am » |
Hi I followed that thread but i cant get it to work. I am using Breakout Board for SD-MMC Cards: https://www.sparkfun.com/products/11403I am confused about the pin connection. what i did so far i connected: D0 ===> MISO (ICSP-1) CLK ===> SCK (ICSP-3) CMD ===> MOSI (ICSP-4) D3 ===> PIN 10 GND ===> GND VCC ===> 3.3V the rest of the ICSP pins are not connected can anyone help me with schematic for this break board connection to the DUE?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 30
Posts: 1105
Arduino rocks
|
 |
« Reply #42 on: May 08, 2013, 10:10:34 am » |
I did tests with the SPI_MR_WDRBT bit set on SPI receive. I used a 1 GB ATP industrial grade SD card which has SLC flash. Setting the bit slows read a lot. Here are results of bench with SPI_MR_WDRBT set in receive: Free RAM: 79135 Type is FAT16 File size 10MB Buffer size 16384 bytes Starting write test. Please wait up to a minute Write 3833.62 KB/sec Maximum latency: 65578 usec, Minimum Latency: 3866 usec, Avg Latency: 4265 usec
Starting read test. Please wait up to a minute Read 2993.18 KB/sec Maximum latency: 5752 usec, Minimum Latency: 5457 usec, Avg Latency: 5472 usec
Here are the results with SPI_MR_WDRBT clear in receive. Free RAM: 79135 Type is FAT16 File size 10MB Buffer size 16384 bytes Starting write test. Please wait up to a minute Write 3832.15 KB/sec Maximum latency: 65958 usec, Minimum Latency: 3864 usec, Avg Latency: 4267 usec
Starting read test. Please wait up to a minute Read 4391.14 KB/sec Maximum latency: 3956 usec, Minimum Latency: 3715 usec, Avg Latency: 3730 usec
Read is about 1,400 KB/sec slower with the bit set so I don't think I can justify setting the bit as the default.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Sr. Member
Karma: 26
Posts: 460
|
 |
« Reply #43 on: May 08, 2013, 06:01:50 pm » |
Yes that's too much of a compromise :-( I've been experimenting with other flags and DMA settings and I can't get the lost speed back.
Also after modifying the bench example to output to the VGA library, it turns out that setting SPI_MR_WDRBT is slower than disabling DMA (#define USE_SAM3X_DMAC 0) when using both libraries together. There is no way I can find of getting the two libraries to share DMA without either SdFat going too slow or getting SPI underruns, or the VGA library getting visual glitches. Disabling DMA in SdFat is faster by about 50% (800KB/s v 1200KB/s) with no glitching.
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 1
|
 |
« Reply #44 on: May 31, 2013, 01:49:21 am » |
Hi,
Don't mind me asking this NOOBY question, but how do i connect my Arduino Due --> SD Card Shield? Can i got the proper pin number and if req., any resistors?
Thanks for your help.
-- Rohin
|
|
|
|
|
Logged
|
|
|
|
|
|