Go Down

Topic: AnalogLogger trouble (Read 602 times) previous topic - next topic

godo

Hi all,
I have a project going on (http://arduino.cc/forum/index.php/topic,68925.msg555639.html#msg555639) in which I use the SdFatLibrary with a modified version of the AnalogLogger (NOT SdFatAnalogLogger; see code here: http://efpu.org.ar/new/en/gente/koroljov.html).
I had problems with swithcing the device off and on again: after a restart (which is basically unplugging the power) I frequently got errors with the SD-card. For some reason, this is pretty much gone now, I guess, using SPI_HALF_SPEED instead of full speed helped, or the fact that I have 15 ms delay between reading the analog pins instead of 10ms?.
Anyway, what I find more interesting is that the sampling rate in the dive mode drops from 3/s to pretty exactly 1/s until I press the reset button (oh ya, I use an Arduino 2009 and some wires to connect my baby to the computer (Arduino IDE 022 on Windows 7)). Also, if I press the reset button while connecting the power again it starts to sample the quick way. What happens there? I tried to implement something with "logfile.close(name)", but I could get it to proper work, instead I got file.open errors.
Another riddle is the fact that I had to outcomment the header for the csv-files. Even starting with the above mentioned reset-button-method I only get rubbish in the first line of the file at the end (sort of: ¯·…d²Ôµk†úßQ»Ó^î+{gF(v²™.BF¹sóy5Ã|Tý³ÿf?ü8ñ/…´Ïˆ:Æ©ãû»ù5_øI¼?k§ÝÜÜÍQò2011/11/30 18:05:46,2267,1015,24.00,488,8,0,0,24.94 as you see, the first data line is also up there), sometimes excel even complains that it cannot recognize the file format. Why is that? I tried to calculate the size of the datastream (2 bytes per char, right?) and it looks like I am good with char buf[80] (could anybody please confirm that [80] means the buffer size is 80 byte, thanks).
Right now I think I will include a reset button in the instruments housing and figure out a hardware solution (something with a capacitor maybe which keeps the reset pin low after restart until it is charged or so, no better idea yet). But it really bothers me that I do not fully understand what is going on there. Any comments are aprechiated, thanks very much! Also, any reading suggestions regarding SD protocoll would be interesting.

Go Up