Skip to main content
Floki.1
Associate II
January 27, 2022
Solved

PWM Input capture reset behaviour

  • January 27, 2022
  • 16 replies
  • 7948 views

Hello,

I have a question regarding several timers which are confiugred in PWM input mode (CCR1 is used to measure the PWM period and CCR2 is used to measure the PWM Width). So far when I plug a user signal on the evalution board, I can see the correct values captured in both registers. When I switch off the user signal, I see that the CCR1/2 registers are holding the last captured value, even if nothing is connected to this pin. I was expecting to read a 0 once I disconnect the user signal in order to perform a reset of the registers.

Is there a way to take advantage of the internal status registers (SR) or Event generation registers ( e.g. CC1IF) in order to poll flags to check if new updates have occured? I would like to avoid to use additional compare registers e.g. CCR3 or CCR4 and create unnecessary interrupt overhead. Moreover, this pattern is only applicable on advanced timer, not on basic timers which only have two compare registers CCR1 and CCR2.

I was thinking in case internal registers can be used for this purpose to use an internal timestamp and to check that everytime.

Is there a method available ?

This topic has been closed for replies.
Best answer by TDK

I made no assumptions about interrupts being enabled or not. CCxIF is set even if CCxIE isn't set.

0693W00000JNcDoQAL.png

16 replies

mpen.1
Associate II
February 1, 2022

so would have to find the pin vdd reset data gnd corresponding to the board,right?

mpen.1
Associate II
February 1, 2022

to those pin corresponding to the picture attached..

mpen.1
Associate II
February 1, 2022

from the board right?that should be standard for each board,I recon

Paul1
Senior III
February 1, 2022

FYI: For your future boards: The MIPI14 on many ST Demo boards matches the cables included with the STLINK-V3MINI, and connects the STLINK UART for diagnostics.

Making your own cables for the tiny connectors on STLINK isn't fun.

The STLINK-V3SET has more connector options.

Paul

ANeam.1
Associate II
November 23, 2022

Hi @Floki.1 ,

I'd like to do exactly the same as you with little overhead. Could you describe more precisely how you used the flags in the SR in order to know if the signal stopped or not? A code snippet as an example will be much appreciated.

Thank you!