> > >Anyone ever implemented a frequency counter with a C84 or C54 ? > >Schematics,source code, etc. > > A PIC is a bit overkill for a freq counter. The layout is simple: > 1. Have a good clock at least several times faster than the freq you > want to count. > > 2. Count the number of clock cycles for each cycle of the signal you want > to measure. > > 3. F = 1/(# clock cycles * time of each clock cycle) OR > F = (Clock freq) / (# of clock cycles) > > That's the most accurate way. However, if you don't want to need to divide: > > 1. Have a good clock several times SLOWER than the freq you want to count. > > 2. Count the number of cycles for each clock cycle. > > This approach limits your LOW freq accuracy. It can only measure integer > multiples of your clock frequency. Actually, a PIC is not overkill if you want a good freq. counter, as it can make a much nicer freq. counter than descrete logic. Most notably, it can time a precise number of samples and output a frequency result with precision comparable to the time measurement. For example, if you had a timer capture with 5MHz resolution and were trying to measure an audio tone, you could start a timer when you get the first wave, stop it when you get the first wave after 200ms, then divide (number of waves minus one) by (elapsed time) and receive the frequency accurate to six significant figures (e.g. 440.015); getting comparable accuracy with a hardwired frequency counter would either require [1] a 1,000 second acquisition time (ick) or [2] measuring the time for a fixed number of waves and letting the user do the division.