cancel
Showing results for 
Search instead for 
Did you mean: 

Overrun flag set immediately after starting ADC conversion

danielsygnat9
Associate
Posted on April 28, 2016 at 10:42

Hello everyone,

I have a problem with the following ADC1 initialisation code with a STM8S003F3.


void ADC_StartNtcMeasurement(void)

{

ADC1_DeInit();


ADC1_Init(ADC1_CONVERSIONMODE_CONTINUOUS, //ADC1_ConversionMode

ADC_CHANNEL_NTC, //ADC1_Channel

ADC1_PRESSEL_FCPU_D8, //ADC1_PrescalerSelection

ADC1_EXTTRIG_TIM, //ADC1_ExtTrigger (not used)

DISABLE, //ADC1_ExtTriggerState

ADC1_ALIGN_RIGHT, //ADC1_Align (Byte order)

ADC1_SCHMITTTRIG_CHANNEL0, //ADC1_SchmittTriggerChannel

DISABLE); //ADC1_SchmittTriggerState


ADC1_DataBufferCmd(ENABLE); //Buffered mode


ADC1_StartConversion();

}

As soon as ADC1_StartConversion

() is executed (it sets the ADON bit), the OVR bit in ADC1->CR3 is set. After the initialisation I wait in a while loop until the EOC flag is then. Then I read out all 10 hardware buffer registers. It seems to work fine but I don't want to ignore the OVR flag. But at the moment I have to, otherwise I would not get any measuring value. Any idea? Thanks. Third Eye #overrun-ovr
0 REPLIES 0