I am trying to read an analog input (A0) with a speed of 10KHz, using the library Due Timer, but, when I increase the value of the vector it crashs, the goal is to use the vector in a FFT analysis with a 5000 size vector. I have tried to work directly with SAM3X83 Timers but I get the same problema. and this prolem is driving me craaaazy!!
Pls, I would appreciate any help. Thx.
#include <DueTimer.h>
int v[5000];
void setup(){
Serial.begin(9600);
Timer3.attachInterrupt(Read);
Timer3.start(100);
analogReadResolution(12);
}
void loop(){}
void display(){
for(int j=0; j<5000; j++){
Serial.println(v[j]);
}
}
int i=0;
void Read(){
v[i]=analogRead(A0);
i++;
if (i>=5000){
i=0;
Timer3.stop();
}
}