Skip to main content
john doe
Senior III
Jul 30, 2017 1:59 PM UTC
Solved

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

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.
    Vangelis Fortounas
    Associate II
    Jul 30, 2017 3:19 PM UTC
    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
    Jul 30, 2017 3:19 PM UTC
    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
    Jul 30, 2017 6:07 PM UTC
    Posted on July 30, 2017 at 18:07

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

    I learned something new today.