cancel
Showing results for 
Search instead for 
Did you mean: 

TRGO and Repetition counter? STM32L476

SWenn.1
Senior III

I have a prescaler (20), an ARR of (65535) and a Repetition Counter of 3 on a 20MHz clock ....On the scope it all looks good...

Question if I set a timer up to be triggered by the Update Event, will the timer being triggered update on the output I see on the Repetition counter or will it update on every roll over of ARR value?

2 REPLIES 2
Sarra.S
ST Employee

Hello @SWenn.1​,

When the timer is triggered by the update event, it will update on the output you see on the repetition counter. The update event is used to reset the timer and the repetition counter will count up each time the timer is triggered.

The ARR value only sets the maximum value of the timer before it rolls back over to 0.

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.

SWenn.1
Senior III

Hello Sarra.....

That is not what I see on my scope (see attached).....I changed the Repetition Counter to 2 to catch a better picture....The green is a GPIO representing RCR of TIM1 getting turned on in HAL_TIM_PeriodElapsedCallback. The pink is TIM1 CH1 OutputCompare, it fires every ARR and within the callback HAL_TIM_OC_DelayElapsedCallback I manipulate it to turn it off again until the next event. The yellow is a PWM output from TIM15. TIM15 is uising internal clock, with slave mode set to trigger mode on ITR0.

Can you explain why TIM15 pwm output (yellow) is producing anything prior to RCR (green) supposed trigger event?? (As mentioned TIM1 Ch1 is set to Ouput Compare CH1 and TRGO is set to Update Event)

Also I would like to know if you can explain why in the debugger on TIM15 the SFR register tab does NOT show or give access to SMCR? I have attached a pic of this as well. I am using HAL stuff here and although I cannot see it in SFR I can create a dummy variable temp and read it......Note register 008 is missing

0693W00000Y8n3uQAB.png