cancel
Showing results for 
Search instead for 
Did you mean: 

Why I am not able to get Half conversion complete call at my 700 samples complete? I am missing anything?

MGami.1
Associate III

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

1 REPLY 1
TDK
Guru

>  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;

Your ADC is free-running. It's not being triggered by TIM5.

If you feel a post has answered your question, please click "Accept as Solution".