AnsweredAssumed Answered

RTC internal timer or TIM 1 and TIM2 application from HAL library

Question asked by Md Mubdiul Hasan on Oct 6, 2016
Latest reply on Oct 18, 2016 by Md Mubdiul Hasan
Dear Sir,

While configuring STM32cubemx, my design does not contain any TIM1 or else.
Now I am confused how should I configure Timer application for GPIO or other things.
According to this vedio,https://www.youtube.com/watch?v=_wE7tbilca4&list=PLDin7xWrqlc-gJUiyHNHpfm9wjbsPBz5y&index=5
timer can be applicable for input capture.

You suggest me to apply systick in this case.

What should I do now ?

Look at this code kindly,


void SysTick_Handler(void)
{
     static uint32_t time = 0;
     time++;
     if ((time > 0) && (time <= 5)){
          write_digit(1);
          write_led_7_segment(led_number[0]);
     }
     if ((time > 5) && (time <= 10)){
          write_digit(2);
          write_led_7_segment(led_number[1]);
     }
     if ((time > 10) && (time <= 15)){
          write_digit(3);
          write_led_7_segment(led_number[2]);
     }
     if ((time > 15) && (time <= 20)){
          write_digit(4);
          write_led_7_segment(led_number[3]);
          if (time == 20){
               time = 0;
          }
     }
}

Outcomes