How do I check my crystal's operation/configuration?


+ Reply to Thread
Results 1 to 6 of 6

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921

    Default How do I check my crystal's operation/configuration?

    Hi All,

    I'm starting a project where a 20MHz crystal is needed. But my circuit refused to work above 10MHz for hours.

    Finally, I found the catch: I mistaken the config settings; instead of _HS_OSC I had _XT_OSC and I couldn't see it...

    Now, I was wondering if there is a "simple" way to check the good operation of the crystal and how to adjust the load capacitors and serial resistor.

    I have found some DS and AN from MicroChip about oscillators but before I go for a sleepless night trying to understand them, I'm just asking for a "quick" check method, if there is any.

    Is there one?
    Roger

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,988


    Did you find this post helpful? Yes | No

    Default Re: How do I check my crystal's operation/configuration?

    Probing directly on the OSC pins may lead to a non working oscillator, due to loading of the circuit by the probe.

    You may check the proper operation with an oscilloscope on a pin for the right frequency of 1 or 10 Hz.

    Even if you do not have an Oscilloscope, you can approximately see a LED flashing, for example at a 1Hz rate.

    Ioannis

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,975


    Did you find this post helpful? Yes | No

    Default Re: How do I check my crystal's operation/configuration?

    I usually put a heartbeat LED on a PIC before I start doing intense coding; just to make sure my CONFIG is set up right.

    500mSec ON
    500mSec OFF

    That way it's relatively closer when you count along with it.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921


    Did you find this post helpful? Yes | No

    Default Re: How do I check my crystal's operation/configuration?

    Thanks,

    I actually meant to verify the chosen capacitors and resistor and so on.

    Guess I have to go back there: https://ww1.microchip.com/downloads/...tes/00949a.pdf
    Roger

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: How do I check my crystal's operation/configuration?

    I have been using 20MHZ xtal's on 18f's..... just straight crystal no r or c's. I make 10 hz interrupts and main program loops on that, toggle blinks a heart-beat led at 10x/sec and no pauses in in code, just use counts of 100ms to do 'tasks'. so to check the timing, I did a serout of simple counter (using longs) once each 10 loops which is 1 serout per second. Then when I start up the pic along with a clock on my pc, and check after 1 or 2 or 5 or 60 minutes, the seconds should sync with time elapsed in seconds, for example after 60 minutes count should be 3600. I found it amazingly accurate using timer 1 and preload. Then all the programming and work is done in the loops or in other interrupts. I also get a % reading of the pic's usage or idle amount using the main loop.
    Name:  18f.JPG
Views: 1722
Size:  73.0 KB

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    921


    Did you find this post helpful? Yes | No

    Thumbs up How do I check my crystal's operation/configuration?

    Thanks amgen, good idea

    That's the kind of thing I was looking for.
    Roger

Similar Threads

  1. FREQOUT command for continuous operation
    By Aussie Barry in forum PBP3
    Replies: 9
    Last Post: - 22nd September 2016, 07:27
  2. 18F67J60 circuit for ethernet operation
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th August 2014, 19:12
  3. Program Configuration check mark issue... maybe.
    By Szczepaniec in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 8th November 2012, 19:17
  4. Replies: 6
    Last Post: - 29th December 2011, 22:39
  5. How do you time an operation?
    By Hylan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th May 2010, 11:41

Members who have read this thread : 10

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts