title: Why can not trigger ADC with timer1 CC1 event?
body: <p>I am working on stm32f407. What I want to do is to trigger ADC1 and ADC2 with timer1 CC1 event, but it not work. I have tried to trigger ADC1 and ADC2 with timer3 trgo or cc1 event, it works fine. So I don't know why timer1 cc1 event not work, could anyone help me？ Thanks, following is my code.</p>
  
  <pre><code>int main(void) 
  {
      GPIO_InitTypeDef GPIO_InitStructure;
      ADC_InitTypeDef  ADC_InitStructure;
  
      NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);    
  
      /* Config GPIO */
      RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA, ENABLE);
      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5|GPIO_Pin_4;
      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN;
      GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
      GPIO_Init(GPIOA, &amp;GPIO_InitStructure);
  
      /* Config ADC1 */
  
      /* ADC1 clock and reset*/
      RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);
      RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1,ENABLE);
      RCC_APB2PeriphResetCmd(RCC_APB2Periph_ADC1,DISABLE);
  
      /* ADC1 config */
      ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b;
      ADC_InitStructure.ADC_ScanConvMode = ENABLE;
      ADC_InitStructure.ADC_ContinuousConvMode = DISABLE;
      ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
      ADC_InitStructure.ADC_NbrOfConversion = 2;
      /* config trigger event */
      // ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T3_CC1;
      ADC_InitStructure.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T1_CC1;
  
      ADC_Init(ADC1, &amp;ADC_InitStructure);
  
      /* ADC1 channel config */
      /* channel 4 for PA4 */
      ADC_RegularChannelConfig(ADC1, ADC_Channel_4, 1, ADC_SampleTime_480Cycles);
      /* channel 5 for PA5 */
      ADC_RegularChannelConfig(ADC1, ADC_Channel_5, 2, ADC_SampleTime_480Cycles);
  
      /* ADC Common config */
      ADC_CommonInitTypeDef  ADC_CommonInitStructure;
      ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent; 
      ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles;
      ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled;
      ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div4;
      ADC_CommonInit(&amp;ADC_CommonInitStructure);
  
      /* Enable ADC1 */
      ADC_Cmd(ADC1, ENABLE);
  
      /* Configure TIMER1 */
      TIM1_Int_Init(5000-1,8400-1);
  
      while (1) {} 
  }
  void TIM1_Int_Init(u16 arr,u16 psc) 
  {
      TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure;
      TIM_OCInitTypeDef       TIM_OCInitStructure;
  
      RCC_APB2PeriphClockCmd(RCC_APB2Periph_TIM1,ENABLE);
  
      TIM_TimeBaseInitStructure.TIM_Period = arr;
      TIM_TimeBaseInitStructure.TIM_Prescaler=psc;
      TIM_TimeBaseInitStructure.TIM_CounterMode=TIM_CounterMode_Up;
      TIM_TimeBaseInitStructure.TIM_ClockDivision=TIM_CKD_DIV1;
      TIM_TimeBaseInit(TIM1,&amp;TIM_TimeBaseInitStructure);
  
      TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
      TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
      TIM_OCInitStructure.TIM_Pulse = 0xFF;
      TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_Low; 
      TIM_OC1Init(TIM1, &amp;TIM_OCInitStructure);
  
      TIM_OC1PreloadConfig(TIM1, TIM_OCPreload_Enable);
      TIM_ARRPreloadConfig(TIM1, ENABLE);
  
      TIM_CtrlPWMOutputs(TIM1, ENABLE);       
      TIM_Cmd(TIM1, ENABLE); 
  }
  </code></pre>
  
  <p>What makes me more confused is that if I enable TIM1_CC_IRQn interrupt, I can really capture the CC1 interupt in TIM1_CC_IRQHandler.</p>
  
  <p>Does anyone have some ideas about this ?</p>
  
  <hr>
  
  <p>Most resent status is I found that if I enable the CC1 interrupt then the CC1 event can triger ADC1, and now my problem is why I have to enable CC1 interrupt ? Does it matters whether I enalbe CC1 interrupt or not ? 
  And I really do not need to enable CC1 interrupt if I trigger ADC1 with timer3's CC1 event.</p>