# Frequency Meter in assembly language

1. ## g4gxo

Good day,

I need to design a digital LC meter for my final year project. I'm planning to make a frequency meter for this semester. so far I have done the oscilator circuit using LM311 (based on AADE website). It has reaseonable resonant frequncy.

My idea of building this frequncy meter is to set a time frame to capture to pulse differentiated from the oscilator circuit (so that only 1 pulse for 1 cycle).
Frequncy = (number of pulse)/time

Is there any special counter in assembly code that can count the time and number of pulse? I am not familiar with assembly language. I hope u guys can give me some hints or clues so that I can proceed on my thesis. thank you very much.

•

2. ## lm311 oscillator

1 members found this post helpful.

•

3. ## pic15c54

Hi !

If you intend to use a PIC as uC to measure the frequency from the LM311 oscillator, chose the TMR1 to count pulses. It can count up to 65535 so as AADE´s LC meter has the maximum frequency of around 700kHz fo the oscillator, you just count on TMR1 for just 10 ms (7000 pulses) and make the calculations with a frequency 100 times smaller. But you can change the counting period to 100 ms if the frequency falls below 100kHz (1000 pulses - for larger capacitanges or inductances) for example, so TMR1 counts up to 10000 instead. After the counting time, you turn off the TMR1, read the registers and make the calculations (remember you have to use floating point math).

1 members found this post helpful.

•

4. ## +lm311 +maximum frequency

thanks guys.

is it possible for me to write the code in C? Assembly language is quite tough, u know... : ) do u guys have any example codes for the frequency meter or LC meter in C?

5. ## pic asm code for count number of pulses

Here is another PIC-based frequency meter project:
http://www.apogeekits.com/counter_article.htm
The sourc code is in PIC15C54 assembly, but PICs have only limited number of instructions, so I don't think it is terribly difficult to understand this.

•

6. ## assembly language frequency

well, is there anyway to use the real time clock register, TMR0 in C++ coding?

7. ## lm311 oscil

You can always insert assembly code:

#asm

code

#endasm

rgs
IanP

1 members found this post helpful.

--[[ ]]--