20 Mhz Crystal, simple blinking LED


Closed Thread
Results 1 to 6 of 6
  1. #1

    Default 20 Mhz Crystal, simple blinking LED

    Hey, I have been trying in vain to use a 20Mhz Crystal to do a small program with the FREQOUT command. This is the program I've been using to test the crystals

    Main:
    High portc.4
    Pause 500
    Low portc.4
    Pause 500
    Goto Main

    I've tried it with DEFINE OSC 20, ie like this:

    DEFINE OSC 20

    Main:
    High portc.4
    Pause 500
    Low portc.4
    Pause 500
    Goto Main

    And still to no avail. I have used 3 different PIC18f452's, 2 PIC18f442's and 1 PIC18f252...I have also tried three oscillating crystals, one powered crystal by abracon, and two passive ones by IQ. I've tried the passive ones with 22pf and 10pf capacitors and no capacitors, all to no avail. The same circuits work fine with a 4mhz crystal, I've tried one passive and one powered crystal in the 4mhz range. I've read that due to the breadboards impedance that this could be causing the passive crystals to work incorrectly, but I've even tried touching the crystals directly to the pins and nothing. I just got these crystals and a few of the pics have never been programmed before and once again, the circuits work fine with a slower 4mhz crystal. If someone could help I'm completely mystified as to what's going on.

    Let me know if I'm leaving anything dumb out or whatever. Thanks

  2. #2
    Join Date
    Jul 2005
    Location
    Midwest
    Posts
    81


    Did you find this post helpful? Yes | No

    Default

    Make sure you are programming your pic for HS (high speed) Sounds like it is set to XT.

  3. #3


    Did you find this post helpful? Yes | No

    Default how to

    How do you do this in PicBasic Pro, I can't seem to find it in the manual

  4. #4
    Join Date
    Feb 2006
    Location
    Australia, Gold Coast
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    Whether you use XT (4Mhz or below) or HS (Above 4Mhz) the Fuse settings can be programmmed as part of your hex file...or alternatively you should be able to set this with your programming software at the time chip is being programmed...look for HS or XT options.
    The thread below will give you a good guide how to set it as part of your hex file.

    http://www.picbasic.co.uk/forum/showthread.php?t=543

    I tend to leave it on HS option on no matter what crystal I am using, works perfectly fine with any speed...

    Cheers
    "Never under estimate the powers of an idiot"

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by exelanoz View Post
    I tend to leave it on HS option on no matter what crystal I am using, works perfectly fine with any speed...

    Cheers
    What HS does is to make the osc. use more power, apparantly the faster it runs the more power it requires. As per one of them thar datar sheets.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    you can set those PIC configurations switches in the program that writes your HEX code to the chips (usually IC-Prog or WinPIC800). Those are Oscillator settings. Set to HS (High Speed)

Similar Threads

  1. Conway's Game Of Life
    By wellyboot in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 28th May 2020, 06:14
  2. Simple Blinking LED - WTF!!
    By johnnylynx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st February 2010, 06:19
  3. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 04:59
  4. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  5. simple LED Blinking project
    By koossa in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th December 2004, 01:25

Members who have read this thread : 1

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