When timer0 uses 32 kHz as a clock,
Timing time calculation formula = 1/32K*TIM0_ON
The result is not correct. Is it correct for me to do this calculation?
void timer_init(void)
{
set_tmr_enable(CLK_PER_REG_TMR_ENABLED);
timer0_init(TIM0_CLK_32K, PWM_MODE_ONE, TIM0_CLK_NO_DIV);
timer0_set(100, 0, 0);
timer0_enable_irq();
timer0_start();
}
Timing time = 1/32K * 100 = 3.125ms
The test time is 9.61ms
Device:
Hi Wally,
The frequency and time periods are calculated according to the formulae below. Please note that the interrupt time period from the ON counter is dependent on the M and N values of the PWM signal.
Best,
LC_Dialog