Frequency measurement using a counter in PSoC 5

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

cross mob
Anonymous
Not applicable

Hi Folks

   

 

   

I'm doing a frequency measuremenst using the PSoC5 with a counter. Could someone help me with the example code for this. I've tried the  EP64441 and having problems with it. It gives me the error code.

   

The command 'arm-none-eabi-gcc.exe' failed with exit code '1'.

   

Regards

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

Probably you made a typo in your program, this error usually is not the only one, check and correct any errors before (above) this one.

   

Bob

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I have attached a project which builds fine when the device selected is PSoC5.

   

Let us know if there is any error when building the same at your end.

   

 

   

I have used PSoC Creator 2.0 (2.0.0.828).

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

The relevant document is also attached.

0 Likes
Anonymous
Not applicable

The project is giving me clock related problems. will forward them

0 Likes
Anonymous
Not applicable

Hi Maduna,

   

 

   

If you are unable to upload the project, you can mail it to me ( dasg@cypress.com ).

0 Likes
Anonymous
Not applicable

hi ghautam 

   

i juste send to u a mail for asking som information, but i had delevery mail error!

   

i need some help plz

   

thank you  

0 Likes
Anonymous
Not applicable

 i want counter program for rpm measurement

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

This might help -

   

 

   

http://www.cypress.com/?docID=33528

   

 

   

and

   

 

   

http://www.cypress.com/?app=forum&id=2232&rID=53631

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

hi DANA, i juste mail u too

   

realy need some help plz

   

thank you ^^

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

Depending on what you are doing, measurement goals, accuracy,

   

attached useful references.

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 PULSE COUNTNG FOR 1SEC COUNTER USING PSOC

0 Likes
Anonymous
Not applicable

good morning evry one

   

Am working on a project with psoc 4, i want to pilot a motor brushless with a drive carte "BLHD30K", and i want to calculat the speed motor!!

   

this drive carte give a Pulse signals (pulse width: 0.3 ms) of 30 pulses per revolution of the motor output shaft are output in synchronism with the motor drive.
Motor speed can be calculated by measuring the SPEED output frequency.

   

Motor speed [tr/min] =(SPEED output frequency (hz)*60)/30

   

SPEED output frequency =1/T
 

   

like that i can also calculat the position of the motor by using an interruption every 30pulse -----> one revolution (tour),

   

but i dont khnow how to calculat that? any idea !!

   

thank you

   

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

You can read the counter value at any time and calculate from its value the actual position. In case of overflow you may maintain an integer counter within an interrupt handler.

   

 

   

Bob

0 Likes
DaHu_285096
Level 5
Level 5
10 likes received 250 replies posted 100 replies posted

I am also having trouble with frequency measurement. I have set up the schematic and components as in the frequency counter application note. The interrupt simply clears the interrupt and sets a flag like below.

In the code I clear the "countDone" flag and wait for it to be set again (which it does) but the value I read in Count is always "1". I verified on scope the input (DAT pin) is square wave at 125 kHz. I also verified the desired sample time for measurement (10ms) is correct at "pwm". The code is going to the interrupt routine ok.

void ISR_Compare_Interrupt(void){

  PWM2_ReadStatusRegister();

  countDone = true;

}

uint16 GetFrequency(void){

  uint16 count;

  countDone = false;

  while(!countDone){}

  count = Counter_ReadCounter();

  return count;

}

fcounter.png

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I wonder if posting a new message to this very old thread is right...

I hacked my version of frequency counter for 125kHz with CY8CKIT-050

The left side is my frequency coutner,

the right-upper is 125KHz PWM generator,

the right-bottom is our friend UART 😉

To test please connect puls_out and puls_in.

021-Freq-Counter.JPG

The TeraTerm log is something like below

020-Freq-Counter.JPG

moto

0 Likes

Thanks, I'll try it in the morning.

Works a treat!

0 Likes