⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
Wally
Offline
Last seen:3 weeks 4 days ago
加入:2016-06-21 01:23
timer0 clock

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:
LC_Dialog
Offline
Last seen:4 weeks 3 hours ago
工作人员
加入:2016-09-19 23:20
Hi Wally,

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