AnsweredAssumed Answered

Dual Interleaved mode with external trigger for each sample. STM32F103xx

Question asked by Buchholz.Alexander on Aug 26, 2015
Latest reply on Aug 26, 2015 by Keaven
hi, im using STM32F103 ADC1 with external trigger (ADC_ExternalTrigConv_T2_CC2) and DMA1 at this moment.
its important to trigger each adc conversion with the external trigger.
this  works great - but its to slow for my application.

    RCC_ADCCLKConfig(RCC_PCLK2_Div4);
    /* Enable ADC1 and GPIOC clock */
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 | RCC_APB2Periph_GPIOC, ENABLE);


    /* ADC1 configuration ------------------------------------------------------*/
    ADC_InitStructure.ADC_Mode = ADC_Mode_Independent;
    ADC_InitStructure.ADC_ScanConvMode =DISABLE;
    ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
    ADC_InitStructure.ADC_ExternalTrigConv =  ADC_ExternalTrigConv_T2_CC2;
    ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
    ADC_InitStructure.ADC_NbrOfChannel = count;
    ADC_Init(ADC1, &ADC_InitStructure);

    ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1,ADC_SampleTime_1Cycles5);
    
    /* Enable ADC1 DMA */
    ADC_DMACmd(ADC1, ENABLE);


    /* Enable ADC1 external trigger */
    ADC_ExternalTrigConvCmd(ADC1, ENABLE);
    /* Enable ADC1 */
    ADC_Cmd(ADC1, ENABLE);
    /* Start ADC1 Software Conversion */
    ADC_SoftwareStartConvCmd(ADC1, ENABLE);
    
    

   
im now planning to use ADC1 and ADC in interleaved mode to double the sampling freq.
Tigger  TrigConv_T2_CC2  -> Sample ADC1 CH1
Tigger  TrigConv_T2_CC2  -> Sample ADC2 CH1
Tigger  TrigConv_T2_CC2  -> Sample ADC1 CH1
Tigger  TrigConv_T2_CC2  -> Sample ADC2 CH1
.
.
.

But with thís configuration, the trigger dosnt work anymore. both adc works - but its untriggerd.


        /* ADC1 configuration ------------------------------------------------------*/
    ADC_InitStructure.ADC_Mode = ADC_Mode_FastInterl;
    ADC_InitStructure.ADC_ScanConvMode =DISABLE; //single channel mode
    ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
    ADC_InitStructure.ADC_ExternalTrigConv =  ADC_ExternalTrigConv_T2_CC2;
    ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
    ADC_InitStructure.ADC_NbrOfChannel = 1;
    ADC_Init(ADC1, &ADC_InitStructure);

    /* ADC1 regular channels configuration */
    ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1,ADC_SampleTime_1Cycles5);

    /* ADC2 configuration ------------------------------------------------------*/
    ADC_InitStructure.ADC_Mode = ADC_Mode_FastInterl;
    ADC_InitStructure.ADC_ScanConvMode = DISABLE;
    ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
    ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_None;
    ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
    ADC_InitStructure.ADC_NbrOfChannel = 1;
    ADC_Init(ADC2, &ADC_InitStructure);

    /* ADC2 regular channels configuration */
    ADC_RegularChannelConfig(ADC2, ADC_Channel_1, 1, ADC_SampleTime_1Cycles5);


    /* Enable ADC2 external trigger conversion */
    ADC_ExternalTrigConvCmd(ADC2, ENABLE);


 


  Is the ADC_Mode_FastInterl the correct mode ? Thanks.
  

Outcomes