How to setup ADC 'smart' way to sample channels at different rates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-17 1: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-complicated- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-17 6: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.Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-18 1:27 AM
clive1, what would be the other?
im very very , very open from suggestions from a pro :)- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-18 6: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, Hal- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-21 1: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.