AnsweredAssumed Answered

ADC resolution for stm32f205

Question asked by cihan.ahmet on Dec 19, 2011
Latest reply on Dec 20, 2011 by cihan.ahmet
Hi, 

ADC resolution is working for "ADC_Resolution_6b" and "ADC_Resolution_12b" but not working for "ADC_Resolution_8b" and "ADC_Resolution_10b" resolutions, they're same with 12-bit resolution. Does anyone have an idea? Here's the initilize code;

definitions;
#define ADC_Resolution_12b                         ((uint32_t)0x00000000)
#define ADC_Resolution_10b                         ((uint32_t)0x01000000)
#define ADC_Resolution_8b                          ((uint32_t)0x02000000)
#define ADC_Resolution_6b                          ((uint32_t)0x03000000)

Code;
/* ADC Common Init **********************************************************/
     ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent;
     ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div8;
     ADC_CommonInitStructure.ADC_DMAAccessMode =      ADC_DMAAccessMode_Disabled;
     ADC_CommonInitStructure.ADC_TwoSamplingDelay =      ADC_TwoSamplingDelay_20Cycles;
     ADC_CommonInit(&ADC_CommonInitStructure);

     /* ADC1 Init ****************************************************************/
     ADC_InitStructure.ADC_Resolution = ADC_Resolution_8b;
     ADC_InitStructure.ADC_ScanConvMode = DISABLE;
     ADC_InitStructure.ADC_ContinuousConvMode = ENABLE;
     ADC_InitStructure.ADC_ExternalTrigConvEdge =      ADC_ExternalTrigConvEdge_None;
     ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right;
     ADC_InitStructure.ADC_NbrOfConversion = 1;
     ADC_Init(ADC1, &ADC_InitStructure);

     /* ADC1 regular channel7 configuration      *************************************/
     ADC_RegularChannelConfig(ADC1, ADC_Channel_1, 1,      ADC_SampleTime_480Cycles);

     /* Enable DMA request after last transfer (Single-ADC mode) */
     ADC_DMARequestAfterLastTransferCmd(ADC1, ENABLE);

     /* Enable ADC1 DMA */
     ADC_DMACmd(ADC1, ENABLE);

     /* Enable ADC1 */
     ADC_Cmd(ADC1, ENABLE);

     ADC_SoftwareStartConv(ADC1);

Outcomes