1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

Help needed desperately with PIC LCF meter

Discussion in 'General Electronics Chat' started by bigal_scorpio, May 2, 2008.

  1. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    This was the latest version for the16F628A , lets know if you have a problem.
     

    Attached Files:

  2. lynx

    lynx Member

    Joined:
    Mar 19, 2009
    Messages:
    221
    Likes:
    2
    Location:
    10km perimetrically
    Hi

    i have two questions...

    a comparator such as the LM393 is it suitable to be placed
    before the frequency meter so the instrument can measure sine wave
    other than square?

    second thing... what factors can cause instability to the instrument's
    4011 oscillator? a leaky capacitor can be a cause?

    P.S eric if you read this post still the LCF meter isn't working ok.
     
  3. lynx

    lynx Member

    Joined:
    Mar 19, 2009
    Messages:
    221
    Likes:
    2
    Location:
    10km perimetrically
    hi

    any help? :)
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK

    hi,
    The LM393 is not a 'fast' comparator, what frequency range is required.

    When you say the LCF is not working, whats the symptoms? Others have built the LCF and it works OK.

    BTW: its not my design.
     
  6. lynx

    lynx Member

    Joined:
    Mar 19, 2009
    Messages:
    221
    Likes:
    2
    Location:
    10km perimetrically
    the LCF i think it can measure up to 5MHz square so i guess i need a comparator
    for that frequency range .. how high the LM393 can go? also can you describe
    how i can add a comparator to the instrument so i can avoid mistakes...

    if you want check the previous pages and you'll understand ;)
     
  7. lynx

    lynx Member

    Joined:
    Mar 19, 2009
    Messages:
    221
    Likes:
    2
    Location:
    10km perimetrically
    any help??
     
  8. lynx

    lynx Member

    Joined:
    Mar 19, 2009
    Messages:
    221
    Likes:
    2
    Location:
    10km perimetrically
    up to what frequency the LM393 can go? sorry but i can't trace that detail at the PDF...
    also can somebody describe how i can add a comparator to the instrument so i can avoid mistakes?

    thanks in advance anyone willing to reply.. :)
     
    Last edited: Dec 13, 2011
  9. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
  10. plautz

    plautz New Member

    Joined:
    Sep 4, 2007
    Messages:
    4
    Likes:
    0
    Hi Eric.

    First, thanks for posting the code.

    I run a test with your code and it run really, but really fast.

    I noticed that the original welcome message (EPE LCF METER) doesn't show anymore.

    And another thing is that when enter either in IND or CAP correction mode, the first letter (I or C) doesn't show.

    Another thing that happens with all code I've tested is that when a overflow happens in the second line is displayed 'OVERFLOW 2'.

    Checking the code, in the INDUCT section, I found these lines:

    Code (text):

    call COPY_REGA_REGB     ; copy answer into REGB
    call MULTIPLY           ; REGA * REGB -> REGA (squaring REGA)
    movf STATUS,W
    andlw 1
    movwf OVERFLOW

    movlw '2'
    movf OVERFLOW,F
    btfss STATUS,Z
    goto SHOWOVERFLOW
     
    I'm not a asm programmer, but since values stored are not betwen ', I changed the line

    Code (text):

    movlw '2'
     
    to

    Code (text):

    movlw '!'
     
    With this modification, now when a overflow happens is displayed OVERFLOW !

    Maybe someone can try this too.

    Now the questions:

    1) Can you tell me how to put the welcome message back again?
    2) How to correct the missing first letters from IND and CAP correction modes?
    3) The modification I've made to show OVERFLOW ! can mess with the results from program?

    My project was running really good. I've put a 56pF (cause I don't have a 68pF) capacitor to solve problem with hang up in capacitance mode.

    I'll do a layout for this excelent project, with all components on board and if anyone want it I'll post here (I don't have much time, but try to do as fast I can).

    Thanks for all and happy new year.
     
  11. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi and welcome,:D

    All I did with the original code was to make the minor changes from 16F628 to 16F628A.

    I didn't remove any of the text messages or make any changes that you mention.

    I am little puzzled by what you are seeing, are you using the correct crystal.?? I will recheck the code I posted to make sure that a problem has not crept in.

    E
     
  12. plautz

    plautz New Member

    Joined:
    Sep 4, 2007
    Messages:
    4
    Likes:
    0
    Eric,

    I'm using the correct cystal (3.2768 MHz).

    The only different parts are the 10nF - 1% capacitors that I can't find, but since I have a commercial capacimeter, I've seleceted capacitors with 10nF closest value.

    But I think these have nothing to do with my questions.

    Thanks for all.
     
  13. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    I have found the reason for the fast running.

    Line 979 of the Code
    PAUSIT: return
    Delete that 'return' it was placed there for the Oshonsoft Simulator.! in order to speed up the simulation.

    Just remove the 'return' and re-assemble the source code, let me know.

    E
     
  14. plautz

    plautz New Member

    Joined:
    Sep 4, 2007
    Messages:
    4
    Likes:
    0
    Eric,

    Thanks. Removing return makes the code runs as it orginal speed, and also corrects the missing initial letters in correction modes.

    In code you posted are another thing to do (for all that want to build this LCF meter), that is to change the config line.

    In your code is this:

    Code (text):

    ;       __CONFIG  h'3F21'   ;628A ext xtal

        __CONFIG  h'3F30' ;[ int 4mhz osc 628A test ONLY]
     
    For propper function, these lines must be this


    Code (text):

           __CONFIG  h'3F21'    ;628A ext xtal

    ;   __CONFIG  h'3F30' ;[ int 4mhz osc 628A test ONLY]
     
    Last, what do you think about the modification I've made to show 'OVERFLOW !' instead 'OVERFLOW 2'.

    Thanks in advance.
     
  15. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    hi,
    Thanks for checking out the code in hardware, I dont have a LCF built on the bench.

    If you could post your working code listing here, it may help others, raise the issue name to
    LCFmet790_5.asm

    E.
     
  16. plautz

    plautz New Member

    Joined:
    Sep 4, 2007
    Messages:
    4
    Likes:
    0
    Eric,

    Here are the asm and hex files that is working on my hardware.

    I don't know why, but I noticed that this code is more accurate than original.

    I have a 10nF 1% (styroflex, with big body) that shows 10.003 in my commercial meter.

    With other codes are showed 10.200nF to 10.700nF.

    Whit your code it shows 10.019nF. This happens with other values too.

    Thanks for all help. Hope these files can help someone.

    Regards.
     

    Attached Files:

    Last edited: Dec 28, 2011
  17. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    Hi,
    Many thanks for that, I will keep a copy on file.

    E.
     
  18. mvs sarma

    mvs sarma Well-Known Member

    Joined:
    Oct 29, 2006
    Messages:
    3,512
    Likes:
    76
    Location:
    Hyderabad, India.
    congrats, so to Eric who structured the software to this accuracy... Best of many more designs in 2012 Eric !!
     
    Last edited: Dec 28, 2011
  19. testament

    testament New Member

    Joined:
    May 14, 2012
    Messages:
    1
    Likes:
    0
    Location:
    Italy
    Hi to all forum's members.
    I built epe lcf meter in accord with modifications of
    http://calatron.me.uk/calatronweb/Electronics_Hobby/pe_lcf_meter_modifications.htm
    for the capacitors.I put 1k resistors parallel to R2,because the values were too high.
    Now i have accuracy for little capacitors,but when i check components higher than 1500 uF,my meter don't work.What can I do?I flashed 16f828 with LCFmet790_5.HEX,but this is for 16f628A.What's the latest code for 16f628?
    Thanks!!!
     
  20. ericgibbs

    ericgibbs Well-Known Member Most Helpful Member

    Joined:
    Jan 4, 2007
    Messages:
    21,185
    Likes:
    644
    Location:
    Ex Yorks' Hants UK
    Hi,
    The original authors code was written for the 16F628, you should be able to download from a post close to the start of this Thread.

    No changes were made in the performance of the LCF meter program, only changes to suit the 16F628A.
     
  21. lynx

    lynx Member

    Joined:
    Mar 19, 2009
    Messages:
    221
    Likes:
    2
    Location:
    10km perimetrically
    hi

    for very long time my LCF meter was useless because of an instability
    which i couldn't manage to resolve without Eric's help..

    to whoever tries to build this instrument i want to notify for two things,
    first thing although the author at his article states the following:

    "inductor L1 is mounted vertically on the board, with its other lead trimmed to
    serve as a terminal pin. In the prototype it was originally mounted flat on the
    board but it was found that this caused instability in the oscillation frequency
    due to the proximity of a signal-carrying p.c.b. track running in parallel with
    the inductor."


    in fact you may find that the vertically mounted inductor is subject for
    mechanical stress and damage which may not be obvious to the
    eye, but can cause problems, so watch out how you solder that inductor
    too much heat could damage it as well as mechanical stress, in my
    case it was placed horizontally and it works well.

    second thing, in case somebody modifies it to keep only one function
    of the meter, don't foget to include a switch in order to calibarate the
    instrument. :D
     

Share This Page