AnsweredAssumed Answered

Single 0V GPIO Pulse Synched w/ Timer

Question asked by Joshua on Oct 1, 2014
Latest reply on Oct 2, 2014 by sung.chen_chung
Using a STM32F427, I've got TIM5 generating an 8MHz PWM output. I've also got a GPIO output that is hooked to an active LOW enable on a device that needs to be turned on every once in awhile. What I'd like to do is, at the appropriate time in a simple superloop of code (i.e., non-RTOS), generate a single 0V pulse (2uS width) on the GPIO output (enabling the device), but synchronized with the next positive edge of the PWM output on TIM5. After the single low pulse, This would then be disabled until my next time through the superloop.

The 8MHz PWM generation is no problem. And I've got CH4 of TIM4 available on the GPIO output pin I want to use. Further, I don't use TIM4 for anything else. So I thought I could simply enable the peripheral clock for TIM4 when I want to generate the single pulse, then immediately disable it. But it doesn't seem to be working.

I think I'm missing two parts:
1) Is it possible to generate a negative pulse using the one-shot function that ST provides?  
2) Leaving the periph clock for TIM4 disabled until I want this pulse SHOULD allow me fine control of enabling this single pulse, correct? If so, is it simply a matter of ensuring that I have a delay of at least (1/8MHz * 2) to ensure I can expect one, and only one, positive edge from the 8MHz PWM output?

Or am I overthinking this and there's a much easier way to accomplish what I'm trying to do?

Thanks!

Outcomes