Skip to main content
Visitor II
March 21, 2024
Question

How to set clear on capture timer mode

  • March 21, 2024
  • 1 reply
  • 1806 views

Screenshot (49).png

Screenshot (46).png

Screenshot (47).png

 

I am using STM32G030F6P6TR controller,using cube IDE software.I am

using input capture direct mode for TIMER3 channel 2,I have signal coming

to the pin of this capture timer.I want to reset timer after capture has been triggered.The

document I am referring (Document name:STM32L4 TIMERS)mentions this as Clear On Capture Mode.

However while setting TIMER3 in this mode from device configuration tool that

is .ioc file,i am unable to find clear on capture option.

How do I clear this counter value once I receive capture event on input signal??

I want this timer to reset every time I get capture event(currently using risign edge of input

signal).

Right now this counter keeps counting and does not get reset when capture event is observed.

Do i need to clear any specific registers or can this be done from standard library functions or

.ioc file.

 

Any help is appreciated as I am new to ST controller.Thanks in advance.

    This topic has been closed for replies.

    1 reply

    ST Employee
    April 2, 2024

    Hello @reipl

    One way to do this is to enable interrupt and manually reset the counter in ISR, by calling __HAL_TIM_SET_COUNTER(htim, 0);

    it is also worth mentioning that there is the one pulse mode that automatically stop counting after a capture event, check dedicated paragraph in RM0454