2016-03-21 03:50 PM
Hello there,
I was wondering either in STM32F4 it is possible, to get a similar functionality to C2000 one, that can trigger an ADC conversion after certain counter valueon a timer is reached, like here:https://www.dropbox.com/s/d6lonep1m3i5x4d/Zrzut%20ekranu%202016-03-21%2023.48.06.png?dl=0
(point CA, middle). In stm34f4 I am using center aligned pwm mode. I can trigger ADC each time timer starts counting up/down or both. But I need to trigger the adc when the counter is halfway down or up. Is there a way to do this? I would appreciate all help. #timer #adc #synchronization2016-03-23 08:57 AM
But can a channel from another timer be slaved to this channel? So lets say TIM1 OC1 triggers interrupt and it makes TIM5 OC3 channel start counting?
The clocks on the chip are synchronous. You could set up another timer that gets reset by the master at it's update, you set the slave timer to count at a comparable rate, and use that to manage the phase angle of the trigger. You have a common understanding of what zero is.2016-03-23 10:43 AM
Hi Bremen,
In fact those are the capture/compare events (occurs when there is a match between CCRx and counter value) and I am talking about the update event ( which occurs on the counter overflow). So if you take a look to the table of ADC external trigger , you find both ( TIMx_CHx_envent and TIMx-TRGO event ). The second will serve your need.Please, try to apply the recommendations already mentioned and come back if it is not OK for you.
-Hannibal-
2016-03-23 10:48 AM
Ok, I get it now. Ill try it tommorow and post back. Thank you very much.
2016-03-24 12:27 AM
I am trying to make the configuration now. I am trying to enable TIM1 trgo to trigger and injected channel conversion, but It doesnt seem to work (injected channel conversion interrupt is not triggered). Are there any other considerations taht has to be taken when using injected channel?
2016-03-24 07:14 AM
Hi Bremen,
Please, try to share your code (Timer configuration , ADC configuration ..clock ..) to figure out what you have missed. -Hannibal-2016-03-25 12:02 AM
I think I got it now, I had some config errors and now its ok. Thank you very much for help guys, your help is priceless.
2016-03-25 03:29 AM
Hi Bremen,
It's nice to hear that. Keep up the good work. -Hannibal-