Pages: 1 [2]   Go Down
Author Topic: Any interest in an ARM version of SdFat  (Read 3794 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 11
Posts: 323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think you may have gotten my comment about the shield mixed up with my comment on graynomad and that explaining were the laughter part must have came in but anyways to tell you more about the avr/arduino shield it will include a 1.8v regulator and a 3.3v regulator so that it is compatible with 5v the arduino and many other micro-controllers that use 5v also it will include a level shifter to get the logic down from 5v to 3.3v and it will include a regular sized sd card interconnect. And also I will include a real time clock. I have not worked out all the details yet as I still don't even own this chip or an adapter for it but like I said if I do make a shield I will make sure that it is better than buying an sdio101 and a dip adapter.
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1599
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SPI is the fastest bus on AVR.  For Arduino the max speed is 8 MHz and it is programmed I/O so the The best speed to an SD is about 820 microseconds to write a 512 byte block.  I don't see how your shield will improve much on this.  The current SdFat can do this.

Other modern micro-controllers have fine SDIO controllers so a shield makes no sense.

The problem is not so much hardware but how to handle file systems on SD flash.  This is what I am working on.

There are at least two type of apps that one can optimize.  One is data logging where latency is the problem so you don't lose data.  The other is where the average rate is important.  These require different approaches.

What are you trying to accomplish?  What is your application?
Logged

Offline Offline
Sr. Member
****
Karma: 11
Posts: 323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SPI is the fastest bus on AVR.  For Arduino the max speed is 8 MHz and it is programmed I/O so the The best speed to an SD is about 820 microseconds to write a 512 byte block.  I don't see how your shield will improve much on this.  The current SdFat can do this.

Other modern micro-controllers have fine SDIO controllers so a shield makes no sense.

The problem is not so much hardware but how to handle file systems on SD flash.  This is what I am working on.

There are at least two type of apps that one can optimize.  One is data logging where latency is the problem so you don't lose data.  The other is where the average rate is important.  These require different approaches.

What are you trying to accomplish?  What is your application?
Thank you for that you brought up some points that I haven't considered. Some of my current goals that I wish to accomplish some now some maybe later once I learn more include:
high sample rate audio playback and recording.
Right now I can playback 24khz 8-bit mono using pwm using a high sample rate just ends up playing to slow for example 44khz plays almost twice as slow.
Time-lapse using a camera  and saving a raw image. using something like this:
http://www.ebay.com/sch/i.html?_nkw=ov7670+module&_sacat=0&_odkw=ov7670+module&_osacat=0&_trksid=p3286.c0.m270.l1313
see the one with lens for less than 9 dollars
And if it is relay just software then I would of course reconsider this sdio chip thing I thought that the reason why spi is so much slow than sdio is because sd cards are more designed for the sdio interface and spi was just more of an add-on but I may be wrong.
« Last Edit: April 19, 2012, 09:35:50 pm by Mr_arduino » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I think I may hear laughter in the distance
That would be me, I'm a long way away.

Quote
he was joking with me
Yep.

So is SDIO 4 or 8 pin data?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1599
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mr_arduino,

I was hopping this topic would be about the future.  What you want to do was done years ago with AVR Arduinos.

Hope Graynomad contains his laugher and I am sure he will.  He is a gentleman.

Just buy an Adafruit Wave Shield and use my old WaveHC library or WaveRP library.  WaveHC can play 16-bit 44.2 ksps files.  The DAC on the shield is only 12-bit for cost reasons but Ladyada did a great job for the low price and the sound is good.

WaveRP can record 8-bit 44.2 ksps audio using the AVR ADC.   

My binaryLogger sketch can record 8-bit data at 90 ksps and 16-bit data at 45 ksps using Microchip ADC chips.

My SdFatRawWrite sketch can write to an SD at about 500 KB/sec.  This uses 100% CPU but at 250 KB/sec you have 50% cpu to generate data.  This should do for your image data.
Logged

Offline Offline
Sr. Member
****
Karma: 11
Posts: 323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That would work fast enough to save an image I do not own the camera module yet as I am still learning alot and will save that for latter and it appears you are getting more out of your library than I am maybe it is the way I am reading the data maybe instead of just doing
Code:
OCR2B = myfile.read();
I should have 2 buffers and I could play buffer 1 while playing buffer 2.
« Last Edit: April 20, 2012, 07:35:08 pm by Mr_arduino » Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1599
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is this for real? This won't give you any performance.
Code:
OCR2B = myfile.read();
I am trying to understand.  Are you a young student trying to learn electronics?
Logged

Offline Offline
Sr. Member
****
Karma: 11
Posts: 323
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not a young student but I am a beginner to electronics and programming and I did come up with a solution by using 2 512 byte buffers and I can play buffer one while loading data into buffer 2.
Logged

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1599
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I did come up with a solution by using 2 512 byte buffers and I can play buffer one while loading data into buffer 2.
Sorry that idea is from the 1960s and I was there.  Actually we used circular buffers which is a better idea. If you want to be more than a dabbler go to school.

You need to learn about the internals of SD cards and how that relates to file systems.  That's how you get performance.

Logged

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2061
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Fyi - SDIO and SPI pinout (from pinouts.ru) I-input, O-output, PP-push-pull, OD-open drain, S-power


* sdcardpinout.jpg (38.52 KB, 503x404 - viewed 26 times.)
« Last Edit: April 22, 2012, 08:01:08 am by pito » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's the full SD pinout and I'm using microSD.

Is SDIO not compatible with microSD then?

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2061
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Of course microSD does support SDIO. The microSD omits pin 3 (VSS). So as the above pinout:
1 2 4 5 6 7 8 9 (contacs side view  9 1 2 4 5 6 7 8 then).
« Last Edit: April 22, 2012, 10:22:23 am by pito » Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

OK from that it seems that the following is the pin mapping for the two using the microSD pinout I've got from several sources.

    microSD    SDIO
1      DAT2     DAT3
2      DAT3     CMD
3      CMD      GND1
4      VCC       VCC
5      CLK       CLK
6      GND      GND2
7      DAT0     DAT0
8      DAT1     DAT1
9                  DAT2

So while very similar they are not physically compatible which I find unbelievable if true.

EDIT: It looks like SDIO is not compatible with microSD, from the "Simplified SDIO Card Spec"

Quote
The SDIO definition encompasses different form factors:
• Full-Size SDIO — compatible with host sockets designed for SD memory cards
• miniSDIO — compatible with host sockets designed for miniSD memory cards

No mention of microSD.
« Last Edit: April 23, 2012, 10:55:22 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

0
Offline Offline
Edison Member
*
Karma: 63
Posts: 1599
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

MicroSD cards are SDIO devices. 

That's what the adapter you get with a MicroSD shows.  It connects the correct MicroSD pins to the SD connector and a PC/Mac used the SDIO to access it.
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8471
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
MicroSD cards are SDIO devices.
Sorry but I'm being a bit thick with this then.

In the spec I see no mention of microSD, just mini and full-size.

The pinouts in my last post are not compatible and I can't find an SDIO pinout that's microSD compatible anywhere.

I cannot use an adaptor because microSD is already the smallest.

What am I missing here?

Or are you saying that my above 8-pin microSD pinout is also an 8-pin SDIO pinout, all the other stuff is just for adapting microSD cards to larger sockets etc and for my processor board is of no concern to me.

_______
Rob



« Last Edit: April 24, 2012, 10:12:30 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Pages: 1 [2]   Go Up
Jump to: