Posted on February 11, 2013 at 08:24 Hello,
I will like to convert 4 Channel Voltages in STMF103RB ADC in dual mode configuration.Please correct me if I am mistaken, from the reference manual (Reference manual RM0008:: 11.9.1 Injected simultaneous mode) ADC1 covert CH13 -CH10 while ADC1 convert CH10-CH13 i.e when ADC2 is converting CH13, ADC1 is simultanously converting CH10.I want a situation where by ADC1 convert CH10 & CH11 only while ADC2 Convert CH12 & Ch13 simultanously. How do I go about it?.
----------------ADC Initialization Code---------------
/* ADC Configuration for CH10 - CH13 in Dual Simultaneous Injected Mode*/
void Init_ADC(void)
{
/*Injected simultaneous Mode Only | Interrupt enable for injected channels | Scan Mode*/
ADC1->CR1 = ADC_CR1_SCAN | (ADC_CR1_DUALMOD_0 | ADC_CR1_DUALMOD_2) | ADC_CR1_JEOCIE;
/* Turn On ADC from Power Down Mode |Conversion on external event enabled |
* Timer 4 CC4 event | DMA Enable*/
ADC1->CR2 = ADC_CR2_ADON | ADC_CR2_JEXTTRIG | ADC_CR2_JEXTSEL_0 |
ADC_CR2_DMA;
ADC1->SMPR1 = ((uint32_t)0x00000000); //CH10 - CH13 Sample Time = 1.5 cycles
ADC1->JSQR = ADC_JSQR_JL | //4 Injected conversions
(ADC_JSQR_JSQ1_1 | ADC_JSQR_JSQ1_3) | //CH10=> 1st Conversion
(ADC_JSQR_JSQ2_0 | ADC_JSQR_JSQ2_1 | ADC_JSQR_JSQ2_3)| //CH11 => 2nd Conversion
(ADC_JSQR_JSQ3_2 | ADC_JSQR_JSQ3_3) | //CH12=> 3rd Conversion
(ADC_JSQR_JSQ4_0 | ADC_JSQR_JSQ4_2 | ADC_JSQR_JSQ4_3); //CH13 => 4th Conversion
}
Slim
Please forgive my English