2014-06-18 05:34 AM
Hi Everyone
In my project, I need to capture 6 channel ADC signals in Regular Simultaneous Mode. for that, I just started for 2 channels (Channel 0 in ADC1 & Channel 1 in ADC2). Since it does simultaneous conversion, I gave the conversion sequence as 1,1 (i.e Rank for Ch0 is 1 & Ch1 is 1). It is working fine. But when i try it for 6 channels I'm getting problem, I'm not getting the actual signal, what I'm giving. I just confused with the sequence. For 6 channels i gave the sequence as (ADC1 Ch0 is 1 & ADC2 Ch1 is 1 ) (ADC1 Ch2 is 2 & ADC2 Ch3 is 2 ) (ADC1 Ch4 is 3 & ADC2 Ch5 is 3 ) is it right ??? can anyone help me... Please.Part Number - STM32F103VDT7Number of Samples - 256Thank You...Regards Selva #adc-in-regular-simultaneous-mode2014-06-18 07:48 AM
Cancelled comment.
2014-06-18 09:55 PM
2014-06-19 06:09 AM
I believe the sequence is correct. And you are correctly not trying to sample the same channel simultaneously.
There may be a DMA setup problem. If you are still stuck, post the code. Cheers, Hal2014-06-21 03:34 AM
2014-06-21 05:16 AM
Is there a strong reason for not having a much bigger buffer, and interrupting on the DMA HT/TC? This would significantly reduce the interrupt loading.
The ADC must be configured as they would be individually, and then tied togetherADC_RegularChannelConfig(ADC1, ADC_Channel_0, 1, ADC_SampleTime_1Cycles5);
ADC_RegularChannelConfig(ADC2, ADC_Channel_1, 1, ADC_SampleTime_1Cycles5);
ADC_RegularChannelConfig(ADC1, ADC_Channel_2, 2, ADC_SampleTime_1Cycles5);
ADC_RegularChannelConfig(ADC2, ADC_Channel_3, 2, ADC_SampleTime_1Cycles5);
ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 3, ADC_SampleTime_1Cycles5);
ADC_RegularChannelConfig(ADC2, ADC_Channel_5, 3, ADC_SampleTime_1Cycles5);
2014-06-21 05:23 AM
Your code is also unnecessarily complex, why can't you just use the TIM to trigger the 6UP conversion when you need them (at desired period/frequency), get the DMA to do the whole sample buffering, and then interrupt you when it is done?
You might also want to review STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\ADC\RegSimul_DualMode2014-06-25 12:01 AM
2014-06-25 03:48 AM
Yes, you should be able to sample 6 channels at 1 KHz, the sample pairs will not occur at exactly the same time, ie pair 2 and 3 will be delayed by the sample+conversion time
Like I said you could make the buffer bigger, either x256 or x512, the former filling the buffer at the TC interrupt, or ping-pong halves at HT/TC interrupt. The latter is safer as the portion of the buffer you are working on won't be modified while the DMA fills the second half. You'd pace the ADC by using a 1 KHz timer trigger, and not using continuous mode.