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

looking for the best way to measure freq DSPIC33EP512MU814

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



Joined: 06 Jan 2013
Posts: 6

View user's profile Send private message

looking for the best way to measure freq DSPIC33EP512MU814
PostPosted: Tue Aug 26, 2014 4:42 pm     Reply with quote

hi
i start a little project with DSPIC33EP512MU814.
and I'm looking for the best way to measure frequency
i tried to use the interrupt on setup_capture and count every rise edge
in one second.

and my results are not so good ...
the freq that i try to measure is between 0hz - 400hz

hope you have some ideas for me Smile
temtronic



Joined: 01 Jul 2010
Posts: 9240
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Aug 26, 2014 5:24 pm     Reply with quote

There is no 'best way' to measure frequency...
.. probably 15-20 factors will contribute to a 'good' way that works for you.

CCS does supply some 'example' code in the examples folder....
...might be a good place to start

also use the 'search' feature on this forum( takes some practice) or use Google to find a LOT of 'measure frequency' type code.

hth
jay
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Aug 26, 2014 6:17 pm     Reply with quote

There are several threads on frequency measurement for 16F and 18F:
http://www.ccsinfo.com/forum/viewtopic.php?t=29963
http://www.ccsinfo.com/forum/viewtopic.php?t=41172
http://www.ccsinfo.com/forum/viewtopic.php?t=33153

You would have to convert the method used in these threads
to use PCD-compatible functions. I can't easily do it because
I don't have the PCD compiler.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Wed Aug 27, 2014 7:38 am     Reply with quote

For low frequencies you are usually better off measuring the period of one (or several) cycles, then doing the maths.

I showed a method for PIC16-18s some time ago which worked well for high frequencies.
The process was very portable, maybe you could modify it.

Mike
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