The initialization of STM8?

Hi,

This is what I write:
void Time1_Init()
{

CLK_PCKENR1 |= SETBIT7;// open the TIM1 clock
TIM1_EGR = 0x0; // Allow the generation of update events
TIM1_PSCRH = 0x00;
TIM1_PSCRL = 0xef;//240 points of frequency,100kHZ
//Initialize the counter value,set auto reload register values,count 125 and get 800 hz
TIM1_ARRH = 0x00;
TIM1_ARRL = 0x7c;
TIM1_CNTRH = 0x00;
TIM1_CNTRL = 0x00;
//SysTick_CounterCmd counts along fringe up
TIM1_CR1 = 0x81;
//Allows you to interrupt the update
TIM1_IER = 0x01;
}

But I see some program also to counter such assignment
TIM1_CNTRH = 0x00;
TIM1_CNTRL = 0x7c;

According to my understanding of the STM8301 datasheet counting up should be CNTR starting from 0, to ARR value overflow. Then it starts from 0. So 0 shouldn’t be assigned to CNTR .I don’t know whether my understanding is right.

Regards.

Imported from wikidot

Maybe I am missing some context here. Is this related to Smoothie in any way ?

Cheers.