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

Low frequency measurement
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 28, 2005 2:34 pm     Reply with quote

My intent was to show him how to re-arrange his equation
so that only integer math was necessary.
OSUschap



Joined: 26 Sep 2005
Posts: 4

View user's profile Send private message AIM Address

new life
PostPosted: Wed Sep 28, 2005 2:51 pm     Reply with quote

Thanks guys for all the help. Mark, my problem was this: I knew that CCP_2 was a long, and I had in my head that a long was just a float with more precision. I see now why this won't work. I actually did add lines to turn off the other LEDs as well, but thank you. PCM programmer, thanks for the link to the other forum, I will definitely check that out, but first I want to fix my silly math error here and see if that helps. Thanks again guys
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Sep 28, 2005 3:22 pm     Reply with quote

PCM programmer wrote:
My intent was to show him how to re-arrange his equation
so that only integer math was necessary.


My intent Wink was to show that there is no need for any math. He just needs to take 5M and divide by the freq to derive his consts.

So to test for 100Hz, that would be 50000 or 5M/100.

This keeps the ints short.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 28, 2005 4:28 pm     Reply with quote

OK I understand you now. I was thinking in terms of making a
tachometer (which I've done). But I can see now that he doesn't
want to do that, he just wants to test if the freq is within certain
fixed ranges, so your method of pre-calculating the constants is
a good idea.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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