- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
we are using PSoC4100s, setup WCO as timer0's clock source, measure the frequency of timer0 and found it not in WCO's 32768 frequency.
our configuration as the follows.
codes like the follows:
void timer0_isr(void)
{
set_a_Write(1);
set_a_Write(0);
CySysTimerClearInterrupt(0);
CySysTimerSetMatch(0, CySysTimerGetCount(0) + 100);
}
void timer0_init(void)
{
CySysClkSetTimerSource(CY_SYS_CLK_TIMER_SRC_WCO);
CySysTimerDisable(CY_SYS_TIMER0_MASK);
CySysTimerResetCounters(CY_SYS_TIMER0_RESET);
CySysTimerSetInterruptCallback(0, timer0_isr);
CySysTimerSetMode(0, CY_SYS_TIMER_MODE_INT);
CySysTimerSetClearOnMatch(0, 1);
CySysTimerSetMatch(0, CySysTimerGetCount(0) + 100);//100 ticks
CySysTimerEnableIsr(0);
CySysTimerEnable(CY_SYS_TIMER0_MASK);
set_a_SetDriveMode(set_a_DM_STRONG);
set_a_Write(0);
}
we want pull up set_a pin in every 100 ticks, but the frequency is not from WCO's 32768 but seems from the ILO.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
problem have been resolved. software found that using wco and ilo in same counter, their time period different much. hardware check its circurt and fix it.
now the ticks calculated match with the waveform.
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Qipan,
Can you paste your captured waveform here?
Hao
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
we setup it in 10ms period, but from the waveform it is about 15ms.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
problem have been resolved. software found that using wco and ilo in same counter, their time period different much. hardware check its circurt and fix it.
now the ticks calculated match with the waveform.
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The ILO timer is very inaccurate I believe, but good that you got it working for your case.