View previous topic :: View next topic |
Author |
Message |
ssaakmnt
Joined: 03 Dec 2011 Posts: 27
|
Modification on EX_FREQC |
Posted: Mon Mar 05, 2012 4:41 am |
|
|
Hi guys, EX_FREQC is great code to measure
input frequency period of 1 second but what modification
we need to take measurment for quarter of second thus
take reading for faster time ? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Mon Mar 05, 2012 7:45 am |
|
|
There's probably a dozen different ways to accomplish the task.
Though without knowing which PIC it's impossible to tell you how.
You might actually open the CCS onscreen Help files..look in the FAQ section....
or
you could dump the listing, see what's being done , and edit a copy of the source to observe the results of your modifications
or
you could just replace the xtal with one 4 x faster
or
...... |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
250ms period gate |
Posted: Tue Mar 06, 2012 3:03 am |
|
|
I wrote code for maria100 in the topic titled "Internal Prescaler EX_FREQ.C" back in February this year. It's complete, compilable, and worked as expected when I tried & tested it with a 'scope.
I showed how to achieve a 100ms gate period using interrupts. I've slept since, bit believe it should be easy to modify for different clock speeds and gate periods.
When measuring high frequency inputs you have to deal with accumulator overflow. As often happens, I've had no feedback, so can't be certain there are no issues.
What the heck, it's a freebie, you can't complain. The CCS code is not straight forward to modify, mine ought to be piece of cake.
Mike |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Tue Mar 06, 2012 9:45 am |
|
|
"As often happens, I've had no feedback, so can't be certain there are no issues." ... the least they could do is tell you what grade you got in their class for doing their homework :-)
mikey _________________ mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3 |
|
|
|