cancel
Showing results for 
Search instead for 
Did you mean: 

TIMER one pulse mode with variable time delay?

parth kothiya
Senior

i want to generate pulse which on time is fix(100us) but off time is variable(between 0-10ms) and it is synchronous with external interrupt how can i do this using HAL libraries ?

5 REPLIES 5
n2wx
Senior

@parth kothiya​, did you ever get this working? I'm attempting the same thing for an R/C controller to perform the ancient PPM modulation scheme. If so how did you do it?

I have my first pass 12 channel working a combination of software timers that kick off the single 100uS pulse but it's hacky and unsatisfying. Thanks!

I didn't see it - thank you for the pointer. I'll work it once I fix the complementary channel output. Assuming I can fix the complementary output on TIM17 in OPM comparison mode.

But this would be another timer, wouldn't it? TIM17 has no slave mode.

Indeed it would: TIM17 and 16 on my H743 are "lite" timers. And I couldn't fix the complementary channel, no matter what I do it has that weird "pulse from the future" that precedes the normal channel's one pulse. Anyway, for ganged timers I think I need to be on TIM1 and 15 or something that's not a lite timer. I picked a lot of these timers to avoid conflicting with timers our contractor selected for a sibling product that runs 95% of the same code, except for these timers =)

People higher up the corporate food chain will decide if they want me to put time into un-hackifying it and doing it properly with two timers. I'd like to work on it because I hate the jitter I'm getting with my software timer, which is actually tolerable and never worse than 1% but it feels wrong and it looks bad on the scope. Unfortunately allocating my time isn't my decision to make.