Skip to main content
Visitor II
June 28, 2018
Question

Can create the 1 us period with the timer 2 of STM8L051F3 ?

  • June 28, 2018
  • 4 replies
  • 1188 views
Posted on June 28, 2018 at 07:13

Hello, 

I would like to make 1 us period with timer 2 of STM8L051F3.

currently I checked that 1 ms is correct, if trying to use under 1 ms (like 100 us or 10 us), the period is not correct....

I measured the period with GPIO(LED).....

please help to let me know whether can make 1 us period with timer 2 or not..

and if has another solution, please help to provide the example with detailed information...

thankful for your support in advance,

thanks.

#stm8l051f3
    This topic has been closed for replies.

    4 replies

    Visitor II
    June 28, 2018
    Posted on June 28, 2018 at 07:23

    at least, need to make 5 us....please help me,,,,

    Graduate II
    June 28, 2018
    Posted on June 28, 2018 at 07:53

    For practicalities sake you aren't going to be able to interrupt at 1 MHz (1us)

    You can set a prescaler on the TIM to get the 16-bit portion to clock at 1 MHz, and then you can observe ticks of the counter.

    Visitor II
    June 28, 2018
    Posted on June 28, 2018 at 09:04

    and I am using 3 timer (2/3/4), so sometimes I need to set the priority of each timer,

    I don't know the method, please help to let me know it with example.

    and I wonder whether STM8L051F3 can support float calculation or not, please help to let me know the fact...

    when trying to do 'printf('test %f \r\n', 0.12345);' in code, I can see only '%f' output... why ?

    it is float support issue or printf library compile issue ?

    thankful for your support in advance,

    thanks.

    Visitor II
    June 28, 2018
    Posted on June 28, 2018 at 13:29

    '

    why ?'

    you may find it helpful to read your compiler manual.

    Visitor II
    June 28, 2018
    Posted on June 28, 2018 at 13:17

    '

    Can create the 1 us period with the timer 2 of  STM8L051F3 ?'

    yes, if you can run that chip at 100s of Mhz.

    Visitor II
    June 29, 2018
    Posted on June 29, 2018 at 13:58

    Hello, Dhenry,

    I give up it, instead I make another solution, currently I can control the gpio pin what I want,

    thanks.