2017-10-12 01:25 PM
I want to set a timer to trigger a ADC conversion at 100Hz. I know how to set up a timer to achieve that. I tried per example to start the ADC conversion on a Timer IRQHandler but should be a better way to do that without cpu.
Thank you
#adc-trigger #trigger-timerSolved! Go to Solution.
2017-11-02 02:40 AM
Thank you all,
I have that working!
2017-10-12 02:12 PM
>>
I don't understand if we can only use the timers for input capture or we can use use a timer event (without external signal) to trigger the conversion.
Either method would work.
You can use the TIM to control periodicity and phase angle when the ADC is fired.
Not sure I've posted examples for the STM32F0, but have for several STM32 SPL platforms
https://community.st.com/0D50X00009XkibiSAB
2017-10-12 07:11 PM
For bringup and debug, use Timer output compare pin connected to the ADC trigger pin. Then you can even trigger your adc by hand and monitor what is happening on an scope. Once this is fine, use the equivalent internal signal (this will tell you which timer to use right from the beginning). No Timer interrupt service routine needed here.
2017-10-26 03:36 AM
Hi Xavier,
In addition to Clive One comment, there are several examples showing how to use ADC+timer using recent drivers HAL or LL.
The examples are available for each STM32 serie.
For example, in the case of STM32L4, you can find some examples in STM32L4 FW package (can be downloaded here:
http://www.st.com/en/embedded-software/stm32cubel4.html)
.You can find an example here:
Using driver HAL:...\Projects\STM32L496ZG-Nucleo\Examples\ADC\ADC_AnalogWatchdogUsing driver LL:...\Projects\STM32L476RG-Nucleo\Examples_LL\ADC\ADC_SingleConversion_TriggerTimer_DMA2017-11-02 02:40 AM
Thank you all,
I have that working!