Clearing CCU4 Timer Register in Gated Mode

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

cross mob
User7902
Level 2
Level 2
Hello,

will the gating mode (i.e. CC41CMC.GATES = 1) also gate the Timer Clear Function (CC41TCCLR.TCC = 1)?

I created a Dave Project with an IO002 connected to Event0 of a PWMSP003. Event 0 is configured as Gate Event.
After stopping the timer (CC41TCCLR.TRBC) and reading out the CC41TIMER value, i want to clear the CC41TIMER register (CC41TCCLR.TCC).
This does only work if i apply "active" level to the gate event line.
The reference manual says, that "This function is used to gate the timer increment/decrement procedure".

BTW. i tried switching off the GATES Bit after stopping the timer and before clearing the timer register. That works only when i single step through the readout function.

My questions:
1) Will the gating mode also gate the TCC Bit, and if so, is that intended behaviour?
2) Can someone provide a working example? (No Capture Mode workarounds pls, i want a gated timer)

Best Regards,
Daniel
0 Likes
2 Replies
Not applicable
Hi Daniel,

When the Gate signal is applied, it is applied to the timer module and it gates the timer increment and decrement, as well as the TCCLR clear for the timer.
In the use case we have experience, we normally use the gate event to gate of unwanted count when using the timer as a counter.
Why do you need to clear the timer when it is gated?

Also, if you have not used DAVE4, I strongly recommend that you switch to DAVE4 as they are now many more APPs that are supported there.
For counter function, you can refer to a "COUNTER" APP in DAVE4.

Regards,
Daryl
0 Likes
Not applicable
Hi Daniel,

When the Gate signal is applied, it is applied to the timer module and it gates the timer increment and decrement, as well as the TCCLR clear for the timer.
In the use case we have experienced, we normally use the gate event to gate of unwanted count when using the timer as a counter.
Why do you need to clear the timer when it is gated?

Also, if you have not used DAVE4, I strongly recommend that you switch to DAVE4 as they are now many more APPs that are supported there.
For counter function, you can refer to a "COUNTER" APP in DAVE4.

Regards,
Daryl
0 Likes