In a project ( suppose an ECG project) that is based on an arduino leonardo board, I am in need of capturing exactly 1000 samples per second for more than 3 ADC channels.
But as every ADC process needs exactly 13 ADC clocks I have to change the oscillator of board to get 1000 samplws and it is not a good idea.
I thinks there is other way based on timers. In that I need to set a timer to produce interrupts 1000 times per second and in interrupt routine I start an ADC process and in interrupt of ADC I get samples.
I need exact sample rate because DSP algorithms need it as an input argument.
Now my questions:
1. Am I in the right way? or other standard routine shall be used?
2. Is there any source code that I could get hints from it?