Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

User16616
Level 1
Level 1
I'm trying to use a CCU8 timer slice to generate a short output pulse and then capture the time of an input rising edge, which will arrive sometime after the output pulse is finished.

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?
0 Likes
2 Replies
Vasanth
Moderator
Moderator
Moderator
250 sign-ins 500 solutions authored First question asked
Hi,

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 ?

Best Regards,
Vasanth
0 Likes
ncbs
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi,

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,
Nikhil

0 Likes