I'm making a datalogger with an Arduino UNO board, and the data acquisition part was working properly, but the data were too fast for the Arduino to read it.
I read the suggestions on this post http://arduino.cc/forum/index.php/topic,6549.0.html and try it myself, so the analogRead would go at a higher frequency. After this, the program wouldn't work, none of the values were read (random symbols were printed instead), and now it just stops when it arrives to the analogRead instruction.
So, you had some code we've never seen. You made some changes to it, and now it doesn't work. But, you want us to help you fix it. Something's missing here...
Thanks for your observations, I'll try not to be so messy with my codes... What I pretend to do is an IV curve tracer, so I have to take measures every hour from 7 am to 7 pm (10 pm on the sketch for testing), first I get a direct value from my voltage source (a PV), afterwards I connect a load to the PV, and take data again.
I've uploaded my sketch (the one without the prescaler change) into another UNO board already, and it doesn't work either! I'm collapsing! Could it be the serial port? It gives me this:
I think I've solved it! Without using the FASTADC though, it seems to be a problem with the SD card setup, without it, it runs and takes the data (random values, different from those on the voltmeter) so I'll see if there's another way to get the correct data.
Thanks a lot, that explains it! Now it gives the value I want
The problem I had wasn't with the SD card code, it was an RTC issue, it reseted itself, so it was 1am for my circuit, and the program entered into the "dormir" routine, putting low the USART0.. Could it be that the FASTADC caused this to the RTC?
I'm still having trouble with the analogRead in my program, I'm no longer using the FASTADC routine, because I've changed my load so the voltage increase will become slower.This way the 100µs per sample are enough, since I have 20ms from 0 to the top voltage, this allows me to have 200 samples and I only require 100.
BUT, the analogRead gives me random values! I keep getting 5V (1023) when I actually have 3.7V maximum.. What can be wrong? I'll appreciate any thoughts on this! Thanks!