Skip to main content
SWenn.1
Senior III
May 13, 2022
Question

TIMx_RCR IRQ?

  • May 13, 2022
  • 2 replies
  • 605 views

I am using TIM16 as a one second counter on an STM32WB55. I would like to generate an interrupt after it rolls x times (as example 2). I set the TIMx_RCR to a 1. Can someone tell me what function I need to call in the HAL library and should I place that function within the "HAL_TIM_PeriodElapsedCallback" which I am using?

I only see the "HAL_TIM_GenerateEvent" which to me sounds like if you want to do a software generate of an event????

Thank you.

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
May 13, 2022

Only Advanced TM support repetition counts, so typically TIM1, TIM8 in most STM32.

It decimates the Update IRQ calls.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
SWenn.1
SWenn.1Author
Senior III
May 13, 2022

TIM16 on STM32WB55 has a setting for (see below)....My ISR goes off every 1 second....I am under the impression that using this 'event' (ie RCR) that I can generate interrupts every 2 seconds or 3 seconds, etc. I am not sure what the value of this is because I could just as easily create a variable to count how many times I go into the ISR??

0693W00000NpvolQAB.png