cancel
Showing results for 
Search instead for 
Did you mean: 

PWM Input capture reset behaviour

Floki.1
Associate II

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 ?

16 REPLIES 16

@mpen.1​ Create a new thread instead of posting on an unrelated one.

Look at "SWJ debug port pins" here:

https://www.st.com/resource/en/application_note/an4938-getting-started-with-stm32h74xig-and-stm32h75xig-hardware-development-stmicroelectronics.pdf

ST boards have a debugger on them already which you can use.

If you feel a post has answered your question, please click "Accept as Solution".
mpen.1
Associate II

I know what do you mean! the thing I ve done it already!They didn't replay me yet.Do you thing there s a way to work wireless in the maintime?

mpen.1
Associate II

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

to those pin corresponding to the picture attached..

mpen.1
Associate II

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

Paul1
Lead

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

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!