AnsweredAssumed Answered

Setting interrupt ADC conversion is complete using HAL

Question asked by britwa.boris on Aug 5, 2015
Latest reply on Aug 12, 2015 by britwa.boris

STM32F407VG
When Interrupt function looks like this:

void ADC_IRQHandler(void)

{

adc=HAL_ADC_GetValue(&hadc1);

 HAL_ADC_IRQHandler(&hadc1);

  HAL_ADC_Start_IT(&hadc1);

}

Everything works well.

But when I want to do the ADC conversion one by one.(  hadc1.Init.ContinuousConvMode = ENABLE;)

void ADC_IRQHandler(void)

{

adc=HAL_ADC_GetValue(&hadc1);

 HAL_ADC_IRQHandler(&hadc1);

 // HAL_ADC_Start_IT(&hadc1);

}

 OVR bit in the SR register is set and ADC is not working.As the end of conversion, we get to ADC_IRQHandler, collect our data .All right. Bit OVR shall not be installed so as we all do in time.

I have to constantly reset the OVR bit or make the setting(hadc1.Init.EOCSelection = EOC_SEQ_CONV;) and then the OVR bit will not be installed. ADC conversion again works well.

                                                           

Why OVR bit is set?

 

 

Outcomes