2021-06-08 10:34 AM
I am using 46uSec sample rate adc to acquire 6 channels data using adc time to trigger adc with dma transfer, but I would like to do average every 4 samples, and do some other calculation every 30 samples. I use 3 channels in Timer 4 to realize adc trigger, average calculation and other calculations every 30 samples, but it looks the thing doesn't work properly. Anybody knows how to use counter to trigger caluclation?
Regards,
2021-06-08 12:33 PM
I mean your idea with timer miss. For start calculation you need use complete DMA IRQ half and full.
For example you define circular buffer for 60 samples and do calculation on half and full IRQ.
Or you can use triggered normal single DMA but here you need more MCU power...
2021-06-09 06:34 AM
actually I set 2x120 samples buffer, it works properly when only do average every 4 samples or do some other calculation every 30 samples enabled, which means only one task work. When I enable 2 tasks, program seems get messy.