2018-06-27 10:13 PM
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.
#stm8l051f32018-06-27 10:23 PM
at least, need to make 5 us....please help me,,,,
2018-06-27 10:53 PM
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.
2018-06-28 12:04 AM
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.
2018-06-28 04:17 AM
'
Can create the 1 us period with the timer 2 of STM8L051F3 ?'
yes, if you can run that chip at 100s of Mhz.
2018-06-28 06:29 AM
'
why ?'
you may find it helpful to read your compiler manual.
2018-06-29 06:58 AM
Hello, Dhenry,
I give up it, instead I make another solution, currently I can control the gpio pin what I want,
thanks.
2018-06-29 08:06 AM
Perhaps you can use ftoa() to generate a string, and print that. Check compiler setting
Or create a Float2String() function.
Pretty sure the STM8 can support floating point, I was using floating point on 8-bit micros decades ago. The real issue is the size of the library code, and whether the application and part can, or want, to support that.