Using I2S event queue or Task queue for passing adc values from buffer.
Posted: Mon Oct 28, 2019 2:34 pm
I can not find any reliable solution for the implementation of the I2S event queues on the Arduino framework.
Currently i'am measuring a 4khz signal from a signal generator with the I2S adc via dma.
The data goes into a buffer on a task and i read that buffer from an other task.
The problem is that i think some data get lost because the other task reads the data from the buffer even when the reader does not finished.
My code right now:
I'am sampling with 144444hz right now, and the readed data looks like this on the web:
Currently i'am measuring a 4khz signal from a signal generator with the I2S adc via dma.
The data goes into a buffer on a task and i read that buffer from an other task.
The problem is that i think some data get lost because the other task reads the data from the buffer even when the reader does not finished.
My code right now:
Code: Select all
static void loop0(void * pvParameters){
for( ;; ){
Sampling(); // RETRIVE DATA FROM DMA BUFFER
}
}
static const inline void To_the_Stars(){
if(millis() - Start_Millis >= 1000){
Start_Millis = millis();
for(int i = 0;i<NUM_SAMPLES;i++){
Send_Data_to_Plot(i2s_read_buff[i]); // RETRIVE DATA FROM i2s_read_buff FOR CALCULATION AND VISUALIZATION
}
}
}