CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Error trap for CCS Example EX_CCPMP.C

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ac34856



Joined: 14 Dec 2009
Posts: 33
Location: Wales

View user's profile Send private message

Error trap for CCS Example EX_CCPMP.C
PostPosted: Tue Dec 15, 2009 9:04 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Dec 15, 2009 1:11 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group