Speed of writing in SD Card memory.

Go To Last Post
10 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 Hi friends,

 

 What is the writing speed in the SD Card?.

 

 I am using ATSAMD20-XPRO, ATIO1-XPRO, and Base SD/MMC card example with FatFs. I'm recording data every 100ms, is this correct?

 

 Best Regars,

 

 Percy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Chocolin wrote:
What is the writing speed in the SD Card?.

 

Depends on the SDcard. There's different specifications. Faster ones are more expensive.

 

Chocolin wrote:
I am using ATSAMD20-XPRO, ATIO1-XPRO, and Base SD/MMC card example with FatFs. I'm recording data every 100ms, is this correct?  

Depends on how much data you're writing. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 Ok, Karman. 

I need to record data in SD CARD memory every 10ms. What SD CARD memory do you recommend me?.

 

 Thanks,

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how much data are you writing every 10ms?

 

Read https://en.wikipedia.org/wiki/SD...

 

you can measure how fast it takes to write a given amount of data. This will tell you if the card and system is fast enough.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I need to write 20 bytes every 10 ms, however it takes about 100ms.

Last Edited: Thu. Feb 21, 2019 - 03:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I need to write 20 bytes every 10 ms, however it takes about 100ms.

 

Thanks

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://stackoverflow.com/questi...

 

Note, if you do fopen,fwrite,fclose then the performance will be slow. But you sort of need to do this to keep the filesystem intact.

 

Writing only 20 bytes means you need to find the sector, read the sector, add new data then write the sector then update the fat/directory. 

 

 

You might need to consider other techniques, like only having one allocated file and writing directly to it rather than using fatfs. Once you know the start sector, you can scan through the file to find the first free sector.

Last Edited: Thu. Feb 21, 2019 - 03:52 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

 Does Atmel has a faster library than Fatfs?.

 

 You propose to consider using another technique, for that reason I would appreciate to indicate me where to locate that information.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What makes you think fatfs is slow? Your choice in using a filesystem adds overhead.
Once you understand where the fundamental limitations are, then you can think about what compromises can be used.

As such, you don’t need a filesystem to write your data - its only needed when you want to read the data on a PC. One compromise as i mentioned earlier is you write one large file of 0xff on the sdcard. When your code starts, it opens the file and searches linearly for the end of data. This may take some time- such is a compromise. Once it has found the end of previously written data, then it appends new data from here. Another compromise is to write your 20 bytes into one sector of 512bytes. This means you don’t need to do a read/modify/write on the sdcard, thus speeding things up. The downside is you loose 1/25th of your storage capacity. You could store 25 lots of 20 bytes in one sector.
One thing’s for sure, you’re not the first to have this dilemma, so Google is your friend.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ok. Kartman. I will consult with google.

 

 Thanks