2013-10-17 01:03 AM
I have about 2 - 3 channels which I need to sample differently , as in, say:
ch1 : at 400 Hz, batch processing samples at 100, (possibly one more chan like that) ch2, 3: one sample every 100 is ok. The ADC sampling is triggered by external timer trigger. What would be proper way to do this? Can this be done somehow with regular vs injected channels, without extra handling/reconfiguring in isr? #the-part-is-complicated2013-10-17 06:53 AM
It's going to be fairly complicated, you'd need to review the manual and resources of each ADC, trigger sources, DMA etc. for the part you're talking about and own the design choices/tradeoffs. You'll likely have to experiment.
The injected route seems to be one way of attacking the problem, but you'd still need to manage that, and where the data goes.2013-10-18 01:27 AM
clive1, what would be the other?
im very very , very open from suggestions from a pro :)2013-10-18 06:29 PM
Is it a mandatory requirement that nothing extra be done in the ISR ?
The simple approach is to sample all channels at 400 Hz. Save channel 1 and ? every time in the ISR and use a counter in the ISR to determine when to save channels 2 and 3. Regards, Hal2013-10-21 01:25 AM
Hey hal,
>Is it a mandatory requirement that nothing extra be done in the ISR ? well yes because we want to do as little as possible in software. i mean stm32 is such an advanced mcu, i thought such things can be totally done with proper config. But otherwise yes, its in ISR. Currently i'm sampling at 400 but interrupting only every 4th sample after dma transfer completes to pass on a batch for processing. Have an overhead of extra buffers.