cancel
Showing results for 
Search instead for 
Did you mean: 

ADC3 Trigger acquisition by Timer2

Fede Rico
Associate III
Posted on May 18, 2018 at 10:21

Hi there,

I'm using a STM32F103 MCU and I want to sample two signals with ADC3.

I also want to sample the signals at 1kHz and to do that I think to use:

  • ADC3 with 2 channels
  • Trigger the ADC with a Timer running @ 1kHz
  • Use the DMA to transfer the samples

With Cube32Mx, I configure the ADC3 to be triggered by TImer2 Caputre Compare 3 event.

My problem is: I don't know ho to configure the timer to generate the trigger for ADC3.

These are my settings for ADC3

0690X0000060BHbQAM.png

These are my settings for Timer2:

0690X0000060BHRQA2.png

Thanks for the help!

Best regards,

Federico

#stm32f1 #adc3 #timer-triggered-adc
4 REPLIES 4
Nesrine M_O
Lead II
Posted on May 18, 2018 at 11:02

Hi

Rini.Federico

,

In the

http://www.st.com/content/ccc/resource/technical/document/application_note/59/ed/30/07/55/76/4e/82/DM001549pdf/files/DM001549pdf/jcr:content/translations/en.DM001549pdf

application note you may find an example with snnipet of code about how to set up ADC1 to start single conversions every time TIM 8 overflows. Each time an end of conversion occurs the DMA transfers the converted data from the ADC to memory:

0690X0000060BHvQAM.png

-Nesrine-

Posted on May 18, 2018 at 11:10

Hi Nesrine,

thanks for the reply.

The application note refers to STM32F4 MCU. I use the STM32F1 serie.

Posted on May 18, 2018 at 11:27

Hi

Rini.Federico

,

I give you this application note as reference to develop your own application.

otherwise refer to this example under the STM32F1 cube package :

STM32Cube_FW_F1_V1.6.1\Projects\STM32VL-Discovery\Examples\ADC\ADC_Regular_injected_groups

-Nesrine-

Posted on May 18, 2018 at 11:29

I understand how to trigger the adc conversion by timer but I don't understand how to configure the peripheral with CubeMx and if my settings (show on top) are correct.