cancel
Showing results for 
Search instead for 
Did you mean: 

Can COMP7\ETR1 reset TIM20 on only one edge instead of both?

KHarb.1
Senior

I have TIM20 configured in reset mode and I want the output of COMP7 to reset it. I have TIM20 configured with ETR routed to COMP7 and I can see the timer being reset on both of the edges of the COMP7 signal. I only want TIM20 reset on one edge. 

I'm using CubeIDE and I see options for choosing rising\falling\both for input capture, but no way to do it when routing from the internal comparators. Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions

Yes, I saw that, but that didn't seem to do what I need.  The board I'm using makes it difficult to detect if the behavior I'm seeing is due to lack of hysteresis on the COMP and input filtering on the timer...which would make noisy transitions show up as triggering on both edges. 

 

View solution in original post

2 REPLIES 2
Sarra.S
ST Employee

Hello @KHarb.1

check the TIMx_SMCR.ETP bit, you can use it to control the polarity of the external trigger

According to RM: "Bit 15 ETP: External trigger polarity
This bit selects whether tim_etr_in or tim_etr_in is used for trigger operations
0: tim_etr_in is non-inverted, active at high level or rising edge.
1: tim_etr_in is inverted, active at low level or falling edge" 

 

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.

Yes, I saw that, but that didn't seem to do what I need.  The board I'm using makes it difficult to detect if the behavior I'm seeing is due to lack of hysteresis on the COMP and input filtering on the timer...which would make noisy transitions show up as triggering on both edges.