I am working on a project where i collect the external ADC results through the I2S peripheral (using double buffer DMA).
The algorithm works in the following way:
- Once memory 0 is filled, interrupt occurs, a flag is set, and in the while loop i execute a processing algorithm on the memory 0 data
- Then if memory 1 is filled, again interrupt occurs, flag is set, and in the while loop i process again the memory 1 data
The aforementioned algorithm worked fine so far. However, recently i implemented some higher order filters and i realized that the mcu doesnt have enough time. Namely, for example, the flag related to "memory 0 is filled" event is set before the processing have been finished on memory 0 data.
I am curious, does the array size could affect the idle time of the mcu?
Or the other way around: Could bigger arrays solve this issue?
Currently the array size is:
#define ADC_REC_DATA16_NO 600
this number is given to the HAL_I2S_Receive_DMA function with the corresponding arrays.
I hope the question is clear.
Thanks for the help in advance.
Best regards, Ákos