AnsweredAssumed Answered

ADC Calibration needed after Wakeup from Sleep ?

Question asked by simma.lukas on Jun 27, 2011
Hello,

to reduce powerconsumption during sleep the ADC and DMA are stopped befor the controller is send to sleep mode.

What is the correct sequence to start an ADC conversion after wakeup from sleep ?
Is the ADC calibration sequence needed in the wakeup sequence ?


Here is my actual code

      // Prepare for Sleep: Stop ADC and DMA Peripherie (and there Clocks)
      ADC_Cmd(ADC1, DISABLE);
      DMA_Cmd(DMA1_Channel1, DISABLE);
      ADC_SoftwareStartConvCmd(ADC1, DISABLE);
      RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, DISABLE);
      RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, DISABLE);  
     ....
     ....
     // Request Sleep Mode
        __WFI();

Here is the code to start ADC Conversion after wakeup

    // Enable ADC, DMA and Start a Conversion Sequence
    RCC_AHBPeriphClockCmd(RCC_AHBPeriph_DMA1, ENABLE);
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1, ENABLE);
    DMA_SetCurrDataCounter(DMA1_Channel1,    ADC_CONVERTED_VALUE_TAB_LENGTH);
    DMA_Cmd(DMA1_Channel1, ENABLE);
    ADC_Cmd(ADC1, ENABLE);
    ADC_SoftwareStartConvCmd(ADC1, ENABLE)


Many Thanks,
Lukas

Outcomes