Skip to main content
john doe
Senior III
July 30, 2017
Solved

When using HAL_TIM_OC_Start_IT, shouldn't I get a Period Elapsed interrupt, too?

  • July 30, 2017
  • 2 replies
  • 1889 views
Posted on July 30, 2017 at 15:59

Playing around with timer/counters, trying to learn things.

When I use HAL_TIM_OC_Start_IT, the callback HAL_TIM_OC_DelayElapsedCallback gets called at the appropriate time. The counter continues on happily about its way, and when it rolls over, shouldn't I expect to also get a callback for PeriodElapsed?

    This topic has been closed for replies.
    Best answer by Vangelis Fortounas
    Posted on July 30, 2017 at 17:19

    Hello!

    The answer is no, with this callback function.

    When you start your timer with  HAL_TIM_Base_Start_IT... you get callback  HAL_TIM_PeriodElapsedCallback  , means that timer's 'Update Flag' is set.

    You can call both functions to get two types of callbacks.

    2 replies

    Vangelis Fortounas
    Associate II
    July 30, 2017
    Posted on July 30, 2017 at 17:19

    Hello!

    The answer is no, with this callback function.

    When you start your timer with  HAL_TIM_Base_Start_IT... you get callback  HAL_TIM_PeriodElapsedCallback  , means that timer's 'Update Flag' is set.

    You can call both functions to get two types of callbacks.

    john doe
    john doeAuthor
    Senior III
    July 30, 2017
    Posted on July 30, 2017 at 18:07

    >You can call both functions to get two types of callbacks.

    I learned something new today.