AnsweredAssumed Answered

Injected channel trigger not executing

Question asked by fyfe.zoe on Apr 24, 2012
Latest reply on Apr 27, 2012 by baird.hal.001
Hi, I am using an STM32F103 chip.  I programmed injected channels on ADC1 and ADC2 to trigger off TIM3 when the CC4 flag triggers.  TIM3_IRQHandler interrupt triggers as expected, but even though I have JEOCIE set, ADC1_2_IRQHandler is never entered.  I used similar code to an example supplied by STM and have included it below.  I also tried setting JAUTO to 1 so that the injected channel will automatically trigger off a regular channel conversion and that does work, so I believe the problem lies in my having not programmed the settings between the CC4 event and the injected channel trigger correctly.  I would appreciate any suggestions from the forum.


***Injected channel set up***
// Set SCAN to true since there are a group of regular channels
ADC1->CR1   = ADC_Mode_RegInjecSimult | kBIT_08;//
ADC2->CR1   = ADC_Mode_RegInjecSimult | kBIT_08;//
  // Set injected sequencer length
  ADC_InjectedSequencerLengthConfig(ADC1, 1);
  ADC_InjectedSequencerLengthConfig(ADC2, 1);
  // Set injected channel configuration
ADC_InjectedChannelConfig(ADC1, ADC_Channel_3, 1, ADC_SampleTime_28Cycles5);
ADC_InjectedChannelConfig(ADC2, ADC_Channel_15, 1, ADC_SampleTime_28Cycles5);
  // Set injected external trigger configuration
  ADC_ExternalTrigInjectedConvConfig(ADC1, ADC_ExternalTrigInjecConv_T3_CC4);
  ADC_ExternalTrigInjectedConvConfig(ADC2, ADC_ExternalTrigInjecConv_None);

  // Enable injected external trigger conversion
  ADC_ExternalTrigInjectedConvCmd(ADC1, ENABLE);
  ADC_ExternalTrigInjectedConvCmd(ADC2, ENABLE);
  // Enable JEOC interrupt

*** Timer trigger set up (note: there is additional timer code not included) ***
TIM_SetAutoreload(TIM3, tim_TimeBase.TIM_Period);
TIM_ARRPreloadConfig(TIM3, ENABLE);