I've been testing the above routine for counting the pulse width.
I note it works with a 20MHz xtal quite reliably upto about 20KHz
after which it slows down the main program loop and eventually
stops it.
Even with WDT_ON set the program is frozen up.
Is there a way past this and why does this occur ?
Rob
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Tue Dec 15, 2009 1:11 pm
Please don't start a new thread every time you have an new idea or
question on the "Measure Pulse" problem. Just add it on to your
existing thread.
But to answer your question, read this comment from the Ex_ccpmp.c
file:
Quote:
// In order for this to work the ISR
// overhead must be less than the
// low time. For this program the
// overhead is 45 instructions. The
// low time must then be at least
// 9 us.
In other words, there is a limit to the maximum frequency that can
be detected, due to the time required to get in, and out, of the interrupt
routine. Read this thread for more information on that. See the link in it.
http://www.ccsinfo.com/forum/viewtopic.php?t=40169
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum