Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Frequency Meter in assembly language

Status
Not open for further replies.

giangpoh

Newbie level 4
Newbie level 4
Joined
Mar 4, 2005
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Malaysia
Activity points
1,351
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.
 


    giangpoh

    Points: 2
    Helpful Answer Positive Rating
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).
 

    giangpoh

    Points: 2
    Helpful Answer Positive Rating
+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?
 

pic asm code for count number of pulses

Here is another PIC-based frequency meter project:
**broken link removed**
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.
 

assembly language frequency

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

lm311 oscil

You can always insert assembly code:

#asm

code

#endasm

rgs
IanP
 

    giangpoh

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top