cancel
Showing results for 
Search instead for 
Did you mean: 

How to set clear on capture timer mode

reipl
Associate

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.

1 REPLY 1
Sarra.S
ST Employee

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

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.