2017-05-21 08:55 AM
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 #tim12017-05-21 12:05 PM
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.
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.
2017-05-22 03:31 AM
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
2017-05-22 03:41 AM
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.
2017-05-22 07:50 AM
Dario,
Output Compare event betweenTIM1 Ch1 and ADC1 is fully internal. No
Take a look at sources fileattached (tested on NucleoF446RE) as an example of ADC IN0 (PA0) triggered with TIM1 OC1 event at1ms rate.
It should works on STM32F401RE.
Best regards
________________ Attachments : main.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyaa&d=%2Fa%2F0X0000000bAZ%2FUjIZzPMx6wXAsPLspJIUDCWlhMCl3UfvQE1aO0W4vF8&asPdf=falsestm32f4xx_hal_msp.c.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyMs&d=%2Fa%2F0X0000000bAa%2FK0SrkHMhmyOIFgvq9vp9rDKN4bd4nIgAdQVNiSklGrQ&asPdf=falseTo give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.