Searching \ for 'CCS - MEASURE FREQUENCY' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=ccs+measure+frequency
Search entire site for: 'CCS - MEASURE FREQUENCY'.

Truncated match.
PICList Thread
'CCS - MEASURE FREQUENCY'
1998\08\25@124216 by WF AUTOMACAO

flavicon
face
Is it possible to measure a frequency with the CCS compiler? Is
there a built-in function?

       Miguel.

1998\08\25@153346 by Andy Kunz

flavicon
face
At 01:34 PM 8/25/98 -0700, you wrote:
>Is it possible to measure a frequency with the CCS compiler? Is
>there a built-in function?

Miguel,

Why not measure the time, then do 1/t?

Andy


==================================================================
Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
==================================================================

1998\08\25@155013 by WF AUTOMACAO

flavicon
face
Andy Kunz wrote:
>
> At 01:34 PM 8/25/98 -0700, you wrote:
> >Is it possible to measure a frequency with the CCS compiler? Is
> >there a built-in function?
>
> Miguel,
>
> Why not measure the time, then do 1/t?
>
> Andy
>
> ==================================================================
> Andy Kunz - Statistical Research, Inc. - Westfield, New Jersey USA
> ==================================================================

Which is the function to measure the TIME elapse? :)

Sorry, but i'm not with my CCS compiler in my businnes at moment!

Miguel.

1998\08\25@170503 by Peter Schultz

flavicon
face
Hi Miguel,
The function in the CCS complier would be
GET_RTCC(),GET_TIMER1();,GET_TIMER2();
To set the timer at the start You can use the following functions:
ET_RTCC( value);SET_TIMER1(value);SET_TIMER2(value);
Also You have to use the SETUP_COUNTERS(rtcc_state,ps_state);SETUP_TIMER_1
(mode);SETUP_TIMER_2(mode,period,postscale)
After it is fairly easy just use some math to get the frequency. I just
finished a project I measuring pulses with the counter for 1000us so the
number of
pulses give the frequency in KHz already. It is working great.
If You want more info on those I can scan the pages from the manual and
E-MAIL it to You.
Good luck,
PeterS

1998\08\25@171326 by WF AUTOMACAO

flavicon
face
Peter Schultz wrote:
>
> Hi Miguel,
> The function in the CCS complier would be
> GET_RTCC(),GET_TIMER1();,GET_TIMER2();
> To set the timer at the start You can use the following functions:
> ET_RTCC( value);SET_TIMER1(value);SET_TIMER2(value);
> Also You have to use the SETUP_COUNTERS(rtcc_state,ps_state);SETUP_TIMER_1
> (mode);SETUP_TIMER_2(mode,period,postscale)
> After it is fairly easy just use some math to get the frequency. I just
> finished a project I measuring pulses with the counter for 1000us so the
> number of
> pulses give the frequency in KHz already. It is working great.
> If You want more info on those I can scan the pages from the manual and
> E-MAIL it to You.
> Good luck,
> PeterS

Thank you Peters! I will see this function in my home!

:)

Miguel

1998\08\26@022312 by Dr. Imre Bartfai

flavicon
face
Hi,

I did it, but not with CCS. But the idea is the same.

1. Set up a TMR0 IT for a time base (it is adviseable the time is about 10
times longer as 1/f(min).
2. Set up an INT IT to count the pulses coming on RB0 independently (I did
16 bits, in particular cases 8 bit may be sufficient). Assign thus a
counter.

In the main program:

@. set up time base using OPTION

A. allow TMR0 IT.
B. clear the counter mentioned above.
C. wait until TMR0 IT occur (e. g. put a flag into ISR).
D. now reset that flag, and allow also INT IT.
E. wait until TMR0 IT occur again (i. e. flag set)
F. turn both IT off.

Now you have the frequency in the counter with a given time base.

Imre


On Tue, 25 Aug 1998, WF AUTOMACAO wrote:

{Quote hidden}

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...