Posted on January 15, 2018 at 19:53 Hi folks, I'm having an issue with the TIM2 interrupt firing as soon as I start the timer rather than when the timer overflows -- was hoping someone could help me. I've set up TIM2 to interrupt once every 860 m...
Posted on January 29, 2018 at 18:46I found the issue, on the 20-pin STM8S003F3 the PWM outputs are an alternate function on the pins. These alternate functions must be activated by setting the Option bytes. In IAR this can be done from the menu opti...
Posted on January 26, 2018 at 01:22Were you ever able to get this working? The configuration I had to output PWM on TIM1 CH1,2,3 worked on the stm8svldiscovery board with the 3K3 chip but not on the 3F3 I used on my own board.
Posted on January 17, 2018 at 19:08You're right, that is the problem -- thank you @dragomir.raimond! I looked at the manual to see what I might do about it and the prescaler register description had this in section 8.6.15, reiterating what you'd sai...
Posted on January 17, 2018 at 00:48That's what I'm doing at the moment, but I'm tying up RAM with a static bool in the ISR that I have to check each time it runs... it's fine, I suppose, but I was hoping to get away from that. Thanks!Todd
Posted on January 17, 2018 at 00:47Hi dragomir.raimond, and thanks for the reply. The value of ARR set by to 0xFFFF by TIM2_Deinit(); it is then changed to (a value of approximately) 0x0344 by TIM2_TimeBaseInit() before the timer it started:void TI...