+ Post New Thread
Results 1 to 7 of 7
  1. #1
    Newbie level 4
    Points: 1,532, Level: 8

    Join Date
    Mar 2005
    Location
    Malaysia
    Posts
    7
    Helped
    4 / 4
    Points
    1,532
    Level
    8

    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.

    •   AltAdvertisement

        
       

  2. #2
    Full Member level 1
    Points: 2,553, Level: 11

    Join Date
    Feb 2004
    Location
    near Finland
    Posts
    107
    Helped
    8 / 8
    Points
    2,553
    Level
    11

    lm311 oscillator



    1 members found this post helpful.

    •   AltAdvertisement

        
       

  3. #3
    Full Member level 6
    Points: 3,633, Level: 14

    Join Date
    Jun 2004
    Location
    Sao Paulo - Brasil
    Posts
    332
    Helped
    68 / 68
    Points
    3,633
    Level
    14

    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.

    •   AltAdvertisement

        
       

  4. #4
    Newbie level 4
    Points: 1,532, Level: 8

    Join Date
    Mar 2005
    Location
    Malaysia
    Posts
    7
    Helped
    4 / 4
    Points
    1,532
    Level
    8

    +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. #5
    Advanced Member level 5
    Points: 74,061, Level: 66

    Join Date
    Oct 2004
    Location
    West Coast
    Posts
    7,942
    Helped
    2331 / 2331
    Points
    74,061
    Level
    66

    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.



    •   AltAdvertisement

        
       

  6. #6
    Newbie level 4
    Points: 1,532, Level: 8

    Join Date
    Mar 2005
    Location
    Malaysia
    Posts
    7
    Helped
    4 / 4
    Points
    1,532
    Level
    8

    assembly language frequency

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



  7. #7
    Advanced Member level 5
    Points: 74,061, Level: 66

    Join Date
    Oct 2004
    Location
    West Coast
    Posts
    7,942
    Helped
    2331 / 2331
    Points
    74,061
    Level
    66

    lm311 oscil

    You can always insert assembly code:

    #asm

    code

    #endasm

    rgs
    IanP


    1 members found this post helpful.

--[[ ]]--