Skip to main content
Dario Laezza
Associate II
May 21, 2017
Question

TIM1 to trigger ADC conversion

  • May 21, 2017
  • 1 reply
  • 1421 views
Posted on May 21, 2017 at 17:55

Hi to everyone, I apologize for the umpteenth discussion on this topic.

I have some questions about Timer in general to which I did not found good answers:

1- I would like to use TIM1_CH1 to start ADC conversion but from the reference manual of Nucleo 401RE I do not understand how it is linked to the ADC or what procedure I have to use for evoke an event on this channel. 

2- I have understood that the Timer can output a PWM signal if used in PWM mode. Do I need to pick up this signal from a PWM pin and send it back to the external trigger of the ADC to start the peripheral? Or can I use it through the internal connections?

Thank you so much to everyone, 

Dario Laezza

#trigger #f401re #tim1_ch1 #timx-trigger #adc #tim1
This topic has been closed for replies.

1 reply

RomainR.
ST Employee
May 21, 2017
Posted on May 21, 2017 at 21:05

Hello Dario,

STM32F401 Ref Manual Chapter 11.6 give the internal signals which do the job.

For ADC regular channels, TIM1_CH1, CH2 and CH3. 

Timer generate an internal event at each overflow.

You need to configure your ADC handle structure to get event from TIM1 Ch1 Event for External Trigger.  

0690X0000060744QAA.png

Let me know.

Best regards.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Dario Laezza
Associate II
May 22, 2017
Posted on May 22, 2017 at 10:31

Hi romain, thank you for your answer. I tried to set the ADC the way you suggested to get an external trigger for starting conversion before starting this discussion, in particular I set the EXTEN for rising edge and I leave EXTSEL to 0000 to catch the event on CH1. But I have noticed that the ADC does not work, is there something else to configure in the ADC to get the event?

Best regards

Dario Laezza

AvaTar
Senior III
May 22, 2017
Posted on May 22, 2017 at 10:41

It not supposed to work that way.

Check the second column in the table, it says 'internal signal from on-chip timers'. No need to break it out and feed it back in.

Triggering the ADC by external events is suited for action-triggered sampling with non-uniform, asynchronous timing.

Triggering by a timer is intended for equidistant sampling, which is good for most cases.