2014-12-09 05:19 AM
Dear All,
My board is 429I-DISCO. I tried to code a continuous A/D conversion via DMA on FreeRTOS.
At first A/D conversion shortly after power-up was starting nomally by ADC_SoftwareStartConv(ADC3). On the rest of the next sequence, the value of uhADC3ConvertedValue - mostly copy & paste from STM's Peripheral_Examples\ADC_DMA - is not updated.According to single step execution, it seems to stopped the conversion in vTaskStartScheduler().
Does anyone knows why stop the A/D conversion process? How should I fix this?tyro
2014-12-13 09:56 PM
I found that OVR(overrun) register is assarted on ADC3 Status Register.
2015-01-07 11:53 PM
Problem solved - Maybe.
ADC_DR was overwitten with new converted value before DMA readout, OVR is set to 1 and DMA transfer is disabled. The reason why framework-side DMA transfer interfere withmyreadout cycle. So Iregulated to slow ADC clock./* ADC Common Init */
ADC_CommonInitStructure.ADC_Mode = ADC_Mode_Independent;
//ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div2;
ADC_CommonInitStructure.ADC_Prescaler = ADC_Prescaler_Div8;
// ADC works without overrun
ADC_CommonInitStructure.ADC_DMAAccessMode = ADC_DMAAccessMode_Disabled;
ADC_CommonInitStructure.ADC_TwoSamplingDelay = ADC_TwoSamplingDelay_5Cycles;
ADC_CommonInit(&ADC_CommonInitStructure);
tyro