cancel
Showing results for 
Search instead for 
Did you mean: 

fast adc calculation

yang hong
Associate II

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,

2 REPLIES 2
MM..1
Chief II

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...

yang hong
Associate II

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.