Showing results for 
Search instead for 
Did you mean: 

Not getting expected output on TIM1CH1?

Senior III

I have TIM1 clocked at 20MHZ, PSC = 20000 - 1, ARR = 1000 - 1, RCR = 2 -1 .....I have Channel 1 as Output Compare CH1....I have TRGO set to Output Compare (OC1REF). Finally to validate what I hope TRGO is doing (since there is no way to see TRGO directly) I have Output Compare Channel Mode set to Toggle on Match with Pulse = 0....I am monitoring TIM1CH1 (PA8) on a scope...My expectations are to see the output toggle every 2 seconds instead it toggles every 1 second....It appears there is no way to send what RCR is doing directly to an output channel, is this correct?? Seems the only way is to Can someone please explain why the RCR is not playing a role here? Is the ONLY way to handle this by using the PeriodElapsedCallback and setting a GPIO???

If this is the case then this seems like a bad oversight because there seems to be no mechanism for allowing RCR to be part of the equation to be a part of the source to slave a timer input.....(Hmmm maybe setting TRGO to Update Event uses RCR??? .....if so does Update Event on TRGO correspond to PeriodElapsedCallback timeout?? )

ST Employee

Hello @SWenn.1​ ,

The RCR impact only the update event flag. This is why you are observing 1Hz via the output compare.

If you want to see the impact of RCR without the input, you can try with another timer in slave mode through Update event on TRGO.

Best regards,