I have measured the frequency using PIC micro-controller, but the accuracy is not good at higher frequency.
I have an idea for the better accuracy. I'm going to measure the no. of pulses occurred in a specific time duration(say about 100msec). That will give the frequency with better accuracy.
But i don't know how to count the rising edges during the 100 msec time interval. Please help
Use one AND gate & connect a 100mS pulse generated from a uC port pin. Connect the output to the microcontroller Timer 1 clock input & configure the timer1 as a counter... reset the timer before you apply the 100mS pulse...
use external interrupt
use timer1 and load it with a value and scale it to form a sub multiple of 1 second and timer 1 overflow interrupt
on each ext_int increase variable frequency
after one second read variable frequency and it should be actual if you are using exact calculations
if you are using prescaler different of 1/1
don't forget to add remaining counts inside prescaler to the global counting.
and survey timer overflow counting wich can occurs for high frequency...
you must add nb of overflow x 65536 to the final counting.