PDA

View Full Version : SD card write speed



Alex41
12-15-2009, 12:55 AM
Hello,

I'm new to the propeller. I see alot of info about using a SD card with the propeller.

At this point I don't have any specific code or application to post.

1. Say I'm using the SD card to record data through an ADC. I want to read 10 channels, each one 10 times per second. Can I write to the SD card fast enough to keep up with this?

2. I'd like to import this data into an excel spreadsheet. The data has to be saved in a certain format to be read by excel? This is where My understanding gets a little fuzzy. What do I need to do to save this data in the correct format?

Thanks for any help,
Alex

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If at first you don't succeed, then skydiving is not for you.

blittled
12-15-2009, 01:11 AM
1. Look at this thread :http://forums.parallax.com/showthread.php?p=824166. It describes a SD Card reader in detail.

2. I would use comma delimited data eg. 1,2,3.56,4.56 since Excel excepts this format. You'll have to use Floatstring to convert the raw data to ascii. Also you should buffer your incoming data since the conversion to Ascii will be slower than your sampling rate.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Will work for Propeller parts!

lonesock
12-15-2009, 03:48 AM
The latest versions of FSRW are definitely fast enough for this application (100 samples a second, say 10 characters per sample, is 1kB/s). Even using FSRW in the absolute slowest mode (using the pputc calls for one byte at a time) you will have plenty of speed. (You can write at ~ 25 kB/s in the slow mode, and if you buffer the output data and write it in blocks of 512 bytes, you can get speeds of ~ 1 MB/s).

Jonathan

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
lonesock
Piranha are people too.

MagIO2
12-15-2009, 04:53 AM
@blittled:
about 2.) Is this knowledge or just a feeling? My feeling is that SPIN should be fast enough to convert 100 numbers into ASCII per second. Isn't it?

blittled
12-15-2009, 08:10 AM
Just a feeling... I was just thinking it would be slower.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Will work for Propeller parts!

MagIO2
12-15-2009, 01:45 PM
Then you should adjust your feelings about the prop ;o)

80_000_000 cycles per second makes 20_000_000 MIPS in PASM.
I measured some SPIN instructions when I started with the propeller and they needed ~450 cycles. Maybe some need more, some need less. So, you can have ~170 MSPINIPS per second. That should be enough to convert some more numbers into strings.

Alex41
12-16-2009, 05:13 AM
Many thanks for all of the replies.

It has me pointed in the right direction for learning more about logging data to a SD card.

Alex

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
If at first you don't succeed, then skydiving is not for you.