Skip to main content
CanisSomnolentus
Associate III
September 23, 2010
Question

EOC not set when attempting to manually read ADC

  • September 23, 2010
  • 1 reply
  • 532 views
Posted on September 23, 2010 at 11:09

EOC not set when attempting to manually read ADC

    This topic has been closed for replies.

    1 reply

    CanisSomnolentus
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 14:08

    Strange:

    I first change these things:

    Instead of using ADC_SoftwareStartConvCmd(ADC1, ENABLE);

    I changed code to:

    ADC1->SR = ~(u32)ADC_FLAG_EOC;

    ADC1->CR2 |= 0x1; // ADC Messung starten

    and there this: 

     // Wait until conversion completion

     //while(ADC_GetFlagStatus(ADC1, ADC_FLAG_EOC) == RESET);

    //

     while(ADC1->SR & ADC_FLAG_EOC == 0); Then this seemed to work, it got through the loop...

    But I changed back the code to the lib functions,

    and now that works, too, like from what I remember to have been the case yesterday!

    (I did clear target, build all, and manually uploaded to device, just to be sure!)

    This is rather odd.