Skip to main content
Nicolas Cmb
Associate III
June 26, 2017
Question

Using Interruption without Delay

  • June 26, 2017
  • 1 reply
  • 569 views
Posted on June 26, 2017 at 13:17

Hi community !,

I'm using STM32f1031RB Nucleo 64, and I wanted to know how can I programm my timer TIM2 (internal clock), in order to allow some of interruptions in my main programm. Actually; I'm using HAL_Delay and I want to replace it to TIM2's interruptions.

Thank you in advance,

Nicolas
    This topic has been closed for replies.

    1 reply

    Zt Liu
    Senior III
    June 26, 2017
    Posted on June 26, 2017 at 16:22

    Do you mean you need to perform a periodical job using timer?

    if so and suppose you are using HAL library, 

    please take a look at the cube example in

    STM32Cube_FW_F1_V1.4.0\Projects\STM32F103RB-Nucleo\Examples\TIM

    Basically, it just

    initialize the timer, enable the Timer interrupt, write your own callback function, then start the timer.