I am new to microcontroller programming but work around industrial PLCs, so some concepts are familiar to me.
I would like to use an Arduino Mega as a datalogger to capture an analog signal at 500 Hz, save the individual data with a timestamp for each point in a pain text file on a flash card. These data will later be downloaded to a laptop and an FFT routine run on the data.
I need sampling of one analog signal at 500 Hz. I would like sampling of 8 analog signals at 500 Hz, and the possibility of sampling 1-2 signals at up to 1500 Hz. I imagine that the timestamp on each line would be the time the variables were scanned sequentially with a very slight delay between each signal due to processing time. This is not a problem for the application. When including the time required to write to flash, and potential delay due to communication with an external ADC if resolution better than 10 bits is required, would the Mega 2560 be fast enough for the different scenarios above?
For best results, I need consistent delays between each sample. It seems like adding a realtime clock would be a good start. From there, what would be the best way to achieve regular sampling? Would using the clock to trigger an interrupt be consistent, or is there a better way to do this?
I would like better resolution than 10 bits from the onboard ADC, and am not opposed to using an external ADC IC for better resolution. It seems that an external ADC using SPI for communication would be faster than I2C or plain serial communication. Understanding that the conversion speed of the external ADC IC must be accounted for, could this be a practical solution to obtain higher resolution without running into problems with sampling frequency?
Thank you for any advice that you can offer on my questions.