2012-02-24 09:11 AM
The F4 library ADC examples typically contain the following structure initialization:
/* ADC1 Init ****************************************************************/ ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; 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); The structure contains a 7th value not initialized in the examples: ADC_InitStructure.ADC_ExternalTrigConv = x; The example code assumes that memory in initialized to zero, which can be a bad assumption. My EWARM environment does not, and it caused strange results and an assertion error. Forum posts by others have been triggered by the same problem. Fix all the ADC library examples with this problem. In the interim, users should initialize the value to zero if there is no external trigger. Cheers, Hal2012-02-24 09:35 AM
Hi Hal,
We are aware about this. We will update the ADC driver and it will be fixed on the next Std Lib release. Cheers, STOne-32