cancel
Showing results for 
Search instead for 
Did you mean: 

Timer: No complementary output in one pulse mode?

n2wx
Senior

Does one pulse mode offer the complementary output? My complementary output just sits there. I'm on TIM17 and I'm not sure if being on the 'lite' timer is the problem.

I suppose I'll try moving it over to TIM2 and see if the problem persists although it's not a straightforward move unfortunately.

7 REPLIES 7
berendi
Principal

What MCU, which pin?

Sorry, a STM32H743ZI rev V.

I'm getting good TIM17_CH1 on PF7 but TIM17_CH1N on PB7 is stuck low.

So the problem was that TIM_CCER_CC1NE needed to be set but that does something weird. 2uS before the inverted single pulse comes out there's a 175nS downward pulse. I'm about ready to tell them to put a 2n2222 on it and get their inverted output that way. Sometimes the path of least resistance is a little transistor.

Crystal cube hazy here, but I'm gonna guess it's the two enable bits being set in two separate steps, 175ns apart. Or something like that.

JW

0690X00000DYuOEQA1.pngThat's a good thought and I was in fact enabling the complementary output *after* the ordinary output. So for grins I reordered it and made sure I was only enabling it once. The first time It concides with the normal signal but then 2uS into the pulse it decides it wants to invert for 175nS. Subsequent output compare events trigger the positive channel normally but still the complementary channel has this weird pulse "from the future." Check it out. I'm bailing and will specify a 2n2222 or 2n3904 or something unless someone recognizes an easy fix because my volumes are small enough to support a three penny transistor and resistor.

maybe if we had some code to fix, and perhaps the timer register values

I know. I'll bring lots of code if I get the go ahead to continue. Right now the guy who writes my paychecks doesn't want me doing any more work on this, especially since it's dealt with for two tiny ports and less than $.05 in single quantities.