2020-03-07 04:59 AM
Hello everyone,
I am using ADC + DMA + TIMER for my analog samples on STM32 nucleoF401RE.
I am new into the STM32 family.So I refer some code as per given some examples in this community.But I am not able to achieve it.
I wanted to follow below method for my code.
1) Configure Peripherals (For that any External trigger convergence required in terms of ADC.)
2) I want sample at every 1 ms.
3) Wanted to collect 1400 samples in DMA(Approx time to collect all samples is 1.4 seconds).
4) After 1400 Samples successfully completed, trigger interrupt.
5) Want to process on received samples.
6) Again follow same procedure from step number 3.
Internally This HAL_ADC_ConvHalfCpltCallback & HAL_ADC_ConvCpltCallback setting HT & TC bits.
But when I am using HAL_ADC_ConvHalfCpltCallback function and for debug I am toggling LED in this function. Because of Half transfer complete I have to get 700 samples But I am getting all 1400 values in my buffer.
Also Attached a code for sample.
Thank you in advance.
Regards,
Milan
2020-03-08 03:57 PM
> hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
Your ADC is free-running. It's not being triggered by TIM5.