Skip to main content
yang hong
Associate III
June 8, 2021
Question

fast adc calculation

  • June 8, 2021
  • 2 replies
  • 594 views

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,

This topic has been closed for replies.

2 replies

MM..1
Chief III
June 8, 2021

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
yang hongAuthor
Associate III
June 9, 2021

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.