[SOLVED]frequency measurment

i am using a encoder which generate a square wave of frequency less than equal to 4khz .
how can i measure the frequency of the wave without using interrupt .

is there any IC which can measure the frequency can output it as analog ouput

Which encoder is it ?
Search for : arduino frequency counter
Converting it to analog seems not right, why would you do that ?
Is there a special reason that you don't want to do this with the Arduino ? Are you running out of timers ?

it is a rotary encoder of resolution 512 PPR rotating at max. of 450 rpm .

as i am using spi device with arduino it disables interrupt therefore i do not want to use interrupt
and also as i only want velocity ( which will be proportional to frequency ) i want to remove load from arduino

Does SPI disable interrupt ? Who told you that ]:slight_smile:
Which Arduino board are you using ?

The microcontroller on the Arduino board (often a ATmega328p) has a number of hardware devices inside. There are for example timers that can also count. The ATmeg328p has three counters, and one is used by the Arduino software. So you still have a 16-bit and a 8-bit counter. Using a timer, measuring the frequency is possible with only one interrupt at the end of a measurement.

I think I misinterpreted your question. You don't want to measure the frequency of a single signal, but you need to capture both signals of a rotary encoder.
Because of the two signals, often interrupts are used:
http://playground.arduino.cc/Main/RotaryEncoders
And you would like an external chip to do that ?

There are rotary encoder modules, some of those have a SPI or I2C interface.
https://www.ghielectronics.com/catalog/product/457

i use ps2 controller to controller motor speed.

and in ps2 library while sending and recieving bytes cli() is used

If you want to measure speed but not direction of the encoder then you could use LM2907/LM2917 frequency to voltage converter IC and use an analog pin to read the output.

Christo:
If you want to measure speed but not direction of the encoder then you could use LM2907/LM2917 frequency to voltage converter IC and use an analog pin to read the output.

thanks that helped