Go Down

Topic: [SOLVED]frequency measurment (Read 1 time) previous topic - next topic

varangupta

Jul 19, 2014, 06:53 pm Last Edit: Jul 20, 2014, 08:23 pm by varangupta Reason: 1
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

Peter_n

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 ?

varangupta

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

Peter_n

Does SPI disable interrupt ? Who told you that  ]:)
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

varangupta

i use ps2 controller to controller motor speed.

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

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.

varangupta


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

Go Up