Skip to main content
Visitor II
May 11, 2018
Question

Timers

  • May 11, 2018
  • 3 replies
  • 916 views
Posted on May 11, 2018 at 11:33

Hi,

I am using  stm8s controller. I am using TIM1,TIM4 for timing delay now i need to use PWM for led blinking. Can i use TIM3(general purpose timer) for timing delay or not , because TIM1(16 bit advanced control timer) having 4 capcom channels for PWM  that's why I am asking  TIM1 using for PWM . Can I replace TIM1 with TIM3 or not . 

Can you please help on this.

Thanks & Regards,

Sateesh.

    This topic has been closed for replies.

    3 replies

    Graduate II
    May 11, 2018
    Posted on May 11, 2018 at 11:49

    Please don't put the entire question in the summary/title, edit to fix.

    ST Employee
    May 17, 2018
    Posted on May 17, 2018 at 07:50

    Hello,

    Yes, you can use TIM3 instead TIM1 to generate delays. All of the timers have similar time base unit which is generating an update event on overflow which can be used to generate delays. TIM4 is used here usually due to the fact that we are not 'wasting' timer input/output channels which can be used to some other purposes.

    Best Regards,

    Artur

    Visitor II
    May 17, 2018
    Posted on May 17, 2018 at 13:15

    You can use any timer for delays. The overflow interrupt is often the way to go. If your timer has unused output compare channels they can be used for delays as well