2014-07-25 01:38 PM
How to Synch my PWM signal to the rising edge of an external signal. i.e The rising edge of my external signal should be on in synch with the leading ege of my PWM.
I am using STM32F4 discovery board.Thanks #mow-my-lawn #stm322014-07-25 02:23 PM
Have a channel in Input Capture mode, latch the time base and interrupt, adjust count/period/pulse as required.
Some of the PWM Input mode examples also illustrate how to reset the timer count.2014-07-26 03:55 PM
Thanks Clive,
if I reset the timer's counter when I detect the rising edge by[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/Setting%20the%20UG%20bit%20in%20EGR%20register%20of%20the%20TIMER%201%20of%20STM32f4%20discovery&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=247]Setting the UG bit in EGR register
would I be able to sync the rising edge of my PWM and the external trigger.
ThanksAlso is it possible to send a small example to the above method u have suggested.2014-07-26 05:42 PM
You can write TIMx->CNT with any value you want. You'll have to experiment with your own signals (at whatever rate,width,periodicity they have)
Many things are possible, I'd be able to work on your problems if you work on mine.2014-07-27 02:22 PM
thanks clive,
sorry, I didnt mean to burden u with my work...I tried to reset the UG bit on the rising edge (using EXTI ) of the external signal to synch the self generated PWM signal , yes it did work but with a delay of abt 800ns. Is there a way to reduce this error.Thanks