Created Mon, 23 Jul 2012 18:10:45 +0000 by steamnut
Mon, 23 Jul 2012 18:10:45 +0000
I am using a Chipkit Uno32 to save an analog value along with the time ( in usecs) when it was measured to an SD card. It all looks fine and it looks like I get 3376 data points/sec which is fine for my application. But when I look closer, I see that I get 23 points over a time of 2.32 msec (a rate of 9894 points/sec) and then nothing for 3.992 msec so I am missing a lot of data. The pattern is totally repeatable.
Does anyone have an idea why this is happening? Is there a way to get rid of the blank spots?
Thanks, Roger
Tue, 24 Jul 2012 18:58:32 +0000
How exactly are you extracting the data? Are you using the SD library or are you doing it manually?
Tue, 24 Jul 2012 19:48:13 +0000
I am using the SD library. Here is the code for the loop that is causing the problem. while(!switchState) I tried a standard Uno and get about 3000 data points/second which is about the same total as the Chipkit but it is only pausing about 9% of the time instead of the 62% of the time the Chipkit is. So it works much better even though it is slower because it records more of the time. Roger
Tue, 24 Jul 2012 20:51:35 +0000
I am not too familiar with the timing of those functions, some might cause a small amount of delay, but I think your longest pause is happening when you print. Every time you right to the serial you waste time for every character printed. Try taking it off and just have the timer at the end and see if it speeds anything up.
Tue, 24 Jul 2012 21:11:18 +0000
But I am printing to the file, right? Not the serial. I am sure that if I don't write to the SD, it will go faster but then I don't have the data.
Wed, 25 Jul 2012 18:12:34 +0000
Yes, your right... I think it would be best to go into the SD library and dissect thos functions and look for any delays or anywhere where the process may be taken up for too long. Other than that I wouldn't be able to tell you where you could find the speed.
Wed, 25 Jul 2012 18:56:32 +0000
OK. Thanks.