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

missing pulses in counting

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



Joined: 29 May 2008
Posts: 8

View user's profile Send private message

missing pulses in counting
PostPosted: Thu May 29, 2008 9:32 am     Reply with quote

hi, i am programming a pulse counter. there is a proximity sensor... my program takes its movement as pulses. it works. but if speed rise, it is happening some missing pulses, rarely but exist.

how can I do not to miss pulse and counts exactly.

by the way, i use capture compare module
RLScott



Joined: 10 Jul 2007
Posts: 465

View user's profile Send private message

Re: missing pulses in counting
PostPosted: Thu May 29, 2008 9:39 am     Reply with quote

mutevaggil wrote:
hi, i am programming a pulse counter. there is a proximity sensor... my program takes its movement as pulses. it works. but if speed rise, it is happening some missing pulses, rarely but exist.

how can I do not to miss pulse and counts exactly.

by the way, i use capture compare module

You must decide how close together the pulses can be, and then determine how frequently your program is checking for the pulses. If you are counting pulses in your CCP interrupt service routine, and if that
routine takes too much time, then you might easily miss some pulses.

Just because you are using a C compiler, that does not relieve you of the responsibility of checking for time-critical code. It is useful to examine the disassembly listing and count instructions to see how long things take. Or, your could toggle unused outputs at certain places in your code and then measure the timing of those outputs with a 'scope.

Robert Scott
Real-Time Specialties
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