Frequency calculation

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

cross mob
Anonymous
Not applicable

Helle everybody,

I am usin cy8c29466 PSOC1 and i want to calculate frequency. I have 50Hz clock palse. And i am gonna input that any port. I want to show frequency measuremant on LCD at port2.

Please don't advice me "ad2283 example" because it is useless. It's half of C and half of assembly and so complicated. I want to calculate it just 1 Timer. Noting else. Timer8 or 16 will be enough. And I want to hear solutions just in C language. Also there are some examples on internet which are using just in designer 4.4 and this is meaningless. I am using designer 5.1.

So if anybody who can help me i will be appraciate.

Please be quick !!

0 Likes
133 Replies
Anonymous
Not applicable

 Just remember that with a 10Hz gate time, your resolution is 10Hz. 

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

Resolution = 1 / Tgate = Fgate.

   

 

   

Ap notes on F and T measurement, attached.

   

 

   

Regards, Dana,

0 Likes
Anonymous
Not applicable

 Dana: which measurement technique u've used here for measuring frequency. 

0 Likes
Anonymous
Not applicable

 Dana: which measurement technique u've used here for measuring frequency.  what is the known timebase frequency u've provided here

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

Read my post on 4/27/2013, 8:30 am

   

 

   

The approach was gated frequency counter. Please google "frequency counter"

   

and you will get 1,000,000 + hits on this topic. Or read the ap notes I posted for

   

you.

   

 

   

The notes in the project and the post of the project tell you what the

   

gate time value is........

0 Likes
Anonymous
Not applicable

 Dana: thanxs for really helping me out...:)

0 Likes
Anonymous
Not applicable

Dana: can u please tell me why measuring frequency of light is better than any other microcontroller. if i m using tsl235 as light sensor. please helpith some good point and justification

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

Why are you asking the forum about something which you did propose in the first place? (This question looks like it some homework assignment...)

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

If all you are doing is simple frequency measurement, then frankly there

   

are many vendors with UP's that can do this. However Cypress tools

   

with prewritten APIs have an advantage over some of these vendors.

   

 

   

If you need a part that under code can transform itself into a completely

   

different HW machine only PSOC 1 can do this because machine HW is

   

registered based configuration and function.

   

 

   

If you need analog capability, like hi resolution > 12 bits, or analog

   

filtering or instrumentation amps or analog reference or full 24/32 bit

   

counters/timers or.....then PSOC shines.

   

 

   

Of course there is family progression in capability, tools, HW, from PSOC

   

1 > PSOC 4 > PSOC 3 > PSOC 5. As you design in lowest familiy and find

   

you need more capability the ease of upgrade is present.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 ok....i got that....what if i've to used any analog output based sensor...then how could the frequency be measured. what are the components we will used in PSoC designer to change that particular analog output into frequency..??  i think we have to use PGA, filters and ADC for signal conditioning and then provide it to the counter input.??? can u help me in designing

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

Post the sensor datasheet or a link to it and I will take a look at

   

it. Its not the TSL235, right ?

   

 

   

Regards, Dana.

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

@ishu: can you tell us what you are up to? You seem to get the forum member to do _all_ the work, and everytime you get an answer there is a new problem which you don't can't / want to solve by yourself. I cannot see that you do any investigation or problem solving on your own.

   

To your last question: when you have a sensor that returns an analog value (e.g. a voltage) corresponding to a light level (e.g. a LDR) then you just use an ADC to measure it. Maybe you need a PGA to amplify the signal. There are plenty of AppNotes and tutorials available for the ADC, and the PGA is rather simply to use.

0 Likes
Anonymous
Not applicable

I wrote these 2 weeks ago.

   

********

   

I have a suggestion.

   

Since this thread was started by another member and seems they come in and disappear. I would suggest you start a new topic.

   

On the topic. SPECIFY

   

1. The requirment of the project in details. NOT WHAT your think it means. BUT the exact wording of specification given to you.

   

2. State what have you done...hardware & software...  NOT I did a routine, BUT post the routine here. IF you designed a HW, POST the HW here.

   

3. State what problem you have. IF you don't know how a I/O option works. SAY IT.

   

4. Remeber. People here are willing to help, but nobody will do the job for you. IF you write some code that doesn't work, post it here so others can help your. BUT don't just say I NEED CODE to do this....

   

5. Also remember that we have no idea what to help without you giving us the details.

   

***

   

 

   

I still hope that we are not getting Ishu to a wrong path and end up failing his/her project.

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

Ishu, consider opening a new thread, as this one is so long my

   

browser is slow/cypress server slow, because of the thread length.

   

I keep getting script error messages trying to get to end of threaad.

   

 

   

Regards, Dana.

0 Likes