20Mhz crystal cause led to blink irreguarly


Closed Thread
Results 1 to 4 of 4
  1. #1
    niknaksbarbeque's Avatar
    niknaksbarbeque Guest

    Default 20Mhz crystal cause led to blink irreguarly

    Hi,

    Has anyone had trouble getting a 20 mhz crytal with a breadboard and Pic18f452 working reliably.

    All I want to do is just make a light blink on and off (reguarly). Everything works fine with a 4MHz crystal (the light blinks reguarly). But when I switch the Crystal to 20 Mhz, update the Configuration Oscilator setting to HS and put DEFINE OSC 20 at the top of my code the light blinks but, its really irregular. (I also made sure that the "update configuration from file setting is switched off"). I have the correct value of capicators for the crystal also.

    I'm about to tear my hair out.
    Here's my code

    DEFINE OSC 20

    MAIN:
    high portd.1
    pause 4000
    low portd.1
    pause 4000
    GOTO main

    It's not a powered oscillator (could this be the problem)?
    Apologies if this is a really think question, just starting out and have very very basic electronics knowledge.

    Thanks
    Mark
    p.s. Massive Karma is going out to anyone who answers 'cause I'm about to chuck the bloody thing out the window

  2. #2
    Join Date
    Feb 2004
    Location
    Germany
    Posts
    762


    Did you find this post helpful? Yes | No

    Default

    Mark,

    it is most likely your breadboard causing the problem.

    This has already been discussed here
    regards

    Ralph

    _______________________________________________
    There are only 10 types of people:
    Those who understand binary, and those who don't ...
    _______________________________________________



  3. #3
    niknaksbarbeque's Avatar
    niknaksbarbeque Guest


    Did you find this post helpful? Yes | No

    Default You'll get your place in heaven

    Thanks very much for replying, it's a wee bit lonely doing all this stuff myself, really appreciate it.

    Mark

  4. #4
    niknaksbarbeque's Avatar
    niknaksbarbeque Guest


    Did you find this post helpful? Yes | No

    Talking Just incase anyone else has the same problem

    I got a 20 mhz powered crystal oscilator today and it's sorted all the problems. Didn't try the other solution 'cause I took a few days off (really was having a **** time of it and needed a wee break) and waited for the crystal from "RS Components" to come. Been reading on the web that apparently it provides a much stronger timing signal and so far that seems correct (well I've got that f*cking light blinking anyway!)

    Cheers
    Mark

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. Free Project - 245 LED Display
    By T.Jackson in forum Code Examples
    Replies: 221
    Last Post: - 16th August 2009, 04:59
  3. 20 Mhz Crystal, simple blinking LED
    By BenjaminsShinob in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th October 2007, 05:06
  4. Novice 16F83A BLINK LED program help
    By owali in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 25th July 2007, 05:02
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30

Members who have read this thread : 0

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