To do this, I want to use one channel in compare mode, which will generate the pulse time, and one channel in capture mode, which will capture the rising edge time.
However, I want to do this in single-shot mode and not have the output reset when the timer stops. It appears that if I do this the simple way in edge-aligned mode, and set the compare match register for channel 1 to the length of the output pulse, then the output will reset right after the timer hits the period match, which I don't want.
If I instead make the compare match register a small value and time my pulse to the period match, inverting the output, I won't be able to capture the input edge, because the timer will have already stopped.
I could maybe use center-aligned mode and pre-load a value before starting the timer to be just before the compare match, and make the compare match close to the period match? The manual is a bit vague about how the active/passive rules apply in single-shot mode.
How can I prevent the output changing when the timer stops in single-shot mode, while still being able to generate a short pulse at the start of the timer run?
I am not sure I understood your request completely. Do you want the first channel to still continue counting ? What exactly needs to be done after period match for channel 1 ?
The thread was locked due to inactivity for a long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.
Thanks and Regards,