AnsweredAssumed Answered

STM8S003 BUG IN TIMER(not confirmed)

Question asked by qin on Dec 21, 2014
set up the prescaler and period, and let it run.
then at certain point, I want to set the counter to some specific value.

however, it seems that setting counter using TIM1_SetCounter(), can actually clear the prescaler setting(TIM1->PSCR = 0).

I wasn't sure whether this is a silicon bug or not. would anyone make a test about this problem with his STM8S?

and solution: set the desired prescaler immediately after SetCounter(), like my example below.

void setcntr()
  TIM1->PSCRH = 0;
  TIM1->PSCRL = 15;