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

Xtal value finder

Discussion in 'Microcontrollers' started by sahu, Jan 1, 2010.

  1. sahu

    sahu Member

    Oct 18, 2009
    ..........HAPPY NEW YEAR..........
    ..........HAPPY NEW YEAR 2010..........
    can any body help me .i want to make a XTAL VALUE FINDER.. means a hordware disen ,we fed xatl thas i\p .thas hordware o\p on LCD xtal value.
    pl pl pl help me
  2. Alpharsp

    Alpharsp New Member

    Dec 30, 2009
    curious proyect xD may be its not the best idea but i could be a good way xD

    for this you need 2 pics use de cheapest

    the first one will work with a refference xtal value (like 4Mhz)

    the first pic will wait until the second one sends a signal like 1 or 0 from porta,4
    when u introduce the xtal on the second pic (the one u want to know the value) it will send the signal to the first one and both will start a counting subroutin. at some point just compare those numbers.
    for example:
    pic 1 = 200
    pic 2 = 400

    (pic2/pic1)*osc reference = (400/200)*4mhz = 8mhz

    you also can use a 555 istead the first pic, (i dont know how to say this in english)use configuracion astable with a low pulse width of 1 second, make a 1 second subroutin for the pic too (supposing its a 4mhz xtal), the a counter ic for each one, at some point, move counting value for each one to the pic, compare them and then show the result (something like in the first option xD)
    Last edited: Jan 1, 2010
  3. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Mar 17, 2009
    AZ 86334
    Having some trouble understanding what you want to do.

    If I had an unknown crystal, and wanted to figure out what it was good for, I would put it into an untuned Colpitts transistor oscillator test circuit designed to make a crystal oscillate on its fundamental frequency, connect it first to my oscilloscope to check that it is oscillating and see the quality of the waveform, and then I would connect the oscillator to my frequency counter to check the frequency. Next, I would use my heat-shrink gun to heat the crystal to get a rough idea of its temperature stability. If you think you are going to do all this using a PIC, good luck!
  4. dave

    Dave New Member

    Jan 12, 1997

  5. Mr RB

    Mr RB Well-Known Member

    Jul 22, 2008
    Out there

    Actually I've seen this done easily with one PIC to display it's owm xtal speed.

    You use the xtal under test as the PIC's main oscillator, then have a watch xtal 32768Hz connected on TMR1.

    Then the PIC runs TMR0 at 1:1 prescale, and counts TMR0 ticks over an exact second which is produced with TMR1 (from the watch xtal). TMR0 ticks will be xtal_freq/4.

    It's harder to explain than it is to do. The only problem I can think of is that the code to write to the LCD must use longish delays so that the LCD will still work even with a fast xtal.

    20MHz PICs will still run fine from 30MHz xtal (some people will say 50MHz) even though it is out of spec it's fine for a few seconds of xtal testing.
  6. Sceadwian

    Sceadwian Banned

    Oct 27, 2006
    Rochester, US
    Mr RB that may not work, a 10MHZ crystal may possibley work if the pic is set to run at 20mhz because it's a harmonic. The same with any lower crystal. Depending on the manufacturing variables in the oscillator section you could get it to work on any number of harmonics. Mike's idea of using a simple Colpits oscilator seems like a good idea, less likely for it to start oscillating at a harmonic.

    I'm a little curious as to why you would want to do this though, crystals almost always have their value printed right on the casing, and those that don't can typically be determined by the type of device they're in.

Share This Page