TCPWM measure frequency

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ShSh_291626
Level 3
Level 3

 Dear All,

   

TCPWM can capture and compare, but it seems not count counter

   

How do I use TCPWM count counter to measure frequency?

   

Thanks.

0 Likes
16 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Configure TCPWM as Timer or Counter in the initial dialog when setting the properties.

   

The counter may count up, down or up and down and the timer counts incoming pulses up to a given limit.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

And don't forget to use a second one as timer, to define the measurement period.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

One possibility -

   

 

   

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Looks like there are some clocking problems in my prior post, I fixed Gate clocking error,

   

but the Fin error, still trying to figure that out. Tried Sync module, and D approach, neither

   

working.

   

 

   

0 Likes
ShSh_291626
Level 3
Level 3

 Thanks friends,

   

I can use (see below) to measurement period

   

   

Retranslation back with a period frequency

   

if capture get 2480 then frequency equal (500KHz/2480) = 201.61Hz

   

This will get the input frequency ....lol, really silly

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Yes, you have made a reciprocal counter, great for low F measurement.

   

 

   

What is the F range and resolution you need for the design ?

   

 

   

Some useful ref material, attached.

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Keep in mind the error grows rapidly as Fx grows, approaching the Gate period,

   

in a reciprocal counter, whereas that occurs in a frequency counter as Fin

   

approaches its low F Gate period.

   

 

   

Regards, Dana.

0 Likes
ShSh_291626
Level 3
Level 3

 My project is have use ADE7755 to measurement watt, max frequency about 5Khz ,I think we should meet.

   

approaches its low F Gate period. Is represents the input frequency is low when, capture counter is have overflow problem?

   

My English is poor, not very able to understand the meaning of this phrase@@

   

Thanks!

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

You should be fine at 5 Khz, the +/- 1 count represents 1%.

   

 

   

If you had a conventional F cntr, gate 1 Hz or 1 sec, and Fx = 2 Hz then

   

reading would be 2 Hz +/- 1 Hz, -50% to +50% error. Due to +/- 1 count

   

problem. If Fx = 10 Hz then error drops to -10% to + 10%. Thats why Reciprocal

   

counters are used, like what you did, for low Fx measurement.

   

 

   

But in my prior post I was in error, regrarding reciprocal counter error, it is fixed,

   

as shown by the below graph -

   

 

   

0 Likes
ShSh_291626
Level 3
Level 3

I might understand, calculated by the following 

   

I should pay attention to the error problem +-1count

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
500000/999500.500501 
500000/10005000.10%
500000/1001499.5005 
     
500000/995050.505 
500000/10050000.99%
500000/1014950.49505 
     
500000/955555.556 
500000/1050000.0009.09%
500000/1145454.545 
   

I do understand what you mean, right?  :'-(

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Thats correct.

   

 

   

Regards, Dana.

0 Likes
ShSh_291626
Level 3
Level 3

I found that I had to go to count pulse, because ADE7755 output is pulse, rather than the frequency

   

There any way can be let the GPIO as an input clock to do it?

   

So I can pulse input to TCPWM, then go read the counter value within one second

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Since PSoC4 is a bit different, have a loook here: http://www.cypress.com/?rID=80799

   

 

   

Bob

0 Likes
ShSh_291626
Level 3
Level 3

 I have read this article,

   

but it is the system clock output to the I / O feet, and my aim is to be I / O pin as a clock input to TCPWM 😞

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

According to the datasheet the outputs are frequency, although not

   

necessarily a square wave.

   

 

   

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

From tech support the only way to clock a counter externally is

   

by use of the UDB based counter/timer.

   

 

   

Regards, Dana.

0 Likes