MCU timer initial value calculation