Sorry for keep asking questions, but I'd like to make sure I'm doing the right steps.
When reading about Analog Inputs ("analogRead()") on the Arduino boards, I get lots of different indications about their speed. Some say you should be able to read about ~10.000 samples per second while others tell to use delays so the analog Input gets a few milliSeconds to "settle".
I made a timed interrupt that reads 2 analog inputs about ~4000 times a second. The program runs, but who says I'm actually getting 4000 unique readings? I don't have testing equipment (yet) but maybe someone can already tell me if this is going to work or not.
I need to detect peaks in 2 signals that looks like a sine with a high period (~150 peaks per second). My PLC could read 500 samples per second, which was a little bit too slow as it would miss peaks sometimes. I'm using the "Arduino Mega".
the delay to let the analog settle afaik is used to 'debounce' buttons, I'm guessing for reading pulses you would want to read as much data as possible. If the arduino can run as an oscilloscope I'm guessing that waiting a 'few' milliseconds would make it unusable for this purpose
Analog-to-Digital Converter
23.1 Features
? 10-bit Resolution
? 0.5 LSB Integral Non-linearity
? ± 2 LSB Absolute Accuracy
? 13 - 260 µs Conversion Time
? Up to 76.9 kSPS (Up to 15 kSPS at Maximum Resolution)
Ah, that sounds good. I'm ashamed to ask but... 15 Ksps ("kilosamples per second"??) == 15.000 readings per second? Ifso, there is nothing to worry about for me.
There was one thread though where someone had problems with two analogRead's right after each other. http://forums.adafruit.com/viewtopic.php?f=25&t=11597
He was getting wrong readings unless he created some time between the 2 readings, or disabled 1 of the 2. That's why I though, let's ask it.