2016-01-30 04:38 AM
hello all
I need advice about using the ADC embedded in the STM32F03. I am connecting 5 analogue sources which I want to acquire with different rateS0 every 2nd sampleS1 every 3rd sampleS2 every 6th sampleThe idea is to connect teh highest sampled souce S0 to 3 channel at the same time, S1 at 2 channels and S1 just one channel. S0 data are stor into 3 variables, S1 into 2 variables, S2 just one variable (transfer is of course via DMA and ADC is working in continuous mode with a sequence alength accordingly)Is this approach correct? This prevent me from changing the sample rate whenever I acquire a channelI am also looking for some examples showing ADC in contionuous multichall mode and DMA (using HAL is better): I attended a training in Milan a few weeks ago but I lost the ecercise example. thanks much2016-01-31 05:13 AM
Ah, yes, that would be nice. You configure the ADC sequence to: S0, S1, S0, S2, S0, S1 set it going and use the results anyway you like.
From memory however this is not possible. F4 devices have a ''what channel should I sample at position X in the conversion sequence?'' where you would be able to configure multiple instances of a single source. But F0 devices have a ''should input X be sampled?'' register. So the order in which they are sampled is always the same and you cannot specify one to be sampled twice as there is just a yes/no bit.2016-01-31 06:39 AM
Yes, I think you're going to have to create a much larger buffer to fit the pattern (basically the minimum repeat length), double that so you can use DMA HT/TC and then extract the elements you want from the time line of data, discarding/ignoring the over sampling