20MHz crystal


Closed Thread
Results 1 to 9 of 9

Thread: 20MHz crystal

  1. #1
    markdem's Avatar
    markdem Guest

    Default 20MHz crystal

    Hi All. I am trying to build a very simple device with a PIC16F877A, but i can make the 20MHz crystal start. After about 2 hours of playing with it, i can make it work by touching the OCS2 pin with my hand. It will not work if i ground it. I can touch it before or after the crystal. It is almost like i am adding to the storage of the caps. I have tried all cap values from 10pf to 33pf, but it does not help. I have surched this forum and the web, but can not work this one out.
    I have set the HS fuse, have tried new crystals, caps etc and have put a 1M risistor across the osc1 and osc2 pins. What else can i try??
    Thank you for your help

    Mark

  2. #2
    markdem's Avatar
    markdem Guest


    Did you find this post helpful? Yes | No

    Default

    Just to add to the problem, i have now tried a 4MHz resonator, and changed my code to reflect (XT and speed) but i still have the same problem. Any ideas??

    Thanks, Mark

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Hmmm... you got your MCLR pin floating?

    ensure... You have pin 1 (MCLR) connected to +5v
    ensure you have +5v on the Vdd pin
    ensure you have BOTH Vss pins connected to 0v

    Burn-in a blink LED program (with the LED on a PortB pin so as not to worry about internal ADC's and comparators) to test your PIC is alive.

    Last of all, try another PIC.

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    I think Mel's hit it right on the head....

    The MClR pin.....


    Make sure you are not programming your chip with the MCLR pin as a reset. Make it a "input"... and/or tie it to 5 volts.

    Dwayne


    PS: One other thing... If you don't use switches to toggle the flags on your programmer, the MCLR seems to default to "reset"... Thus you changing it to "input pin" will be nullified when you attempt to program your chip a second time. I have been caught with my pants down a few times on this <g>... This I use Switches in my program now, for setting the Melabs programmer to the proper configuration.
    Last edited by Dwayne; - 23rd June 2005 at 17:42.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Can also be a damn breadboard loose or faulty contact.

    What about if you remove both capacitor around the crystal???
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    markdem's Avatar
    markdem Guest


    Did you find this post helpful? Yes | No

    Default

    Hi all, thank you so much for helping me. I dont know what i am doing wrong. I have now got a new PIC (PIC16F84A) and it will stilll do the same thing. I have checked the connections, and all are OK. I have tried to remove the charge caps, but it does not help. I have checked the MCLR, and it does have +5 on it. The only way i can make anything work here is by touching OSC1 with my bare hand, like i am giving it ground or somting. Sorry, i am not too good at this, and still only learning. What else can i try?

    Thank you

    Mark

  7. #7
    badrad's Avatar
    badrad Guest


    Did you find this post helpful? Yes | No

    Default

    can you take a picture of your circuit. that might help us see what you have wired up.

  8. #8
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    - Post the model number of the crystal and URL to its PDF datasheet.
    - Post the schematic of your board.
    - Post the PicBasic code.
    - Post JPG pictures of both sides of the board. (Close-up near the crystal).

    If you don't have a digital camera use a CCD flatbed scanner.
    (Small files < 100K).

    Best regards,

    Luciano

  9. #9
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Mark,

    Mark>>I have set the HS fuse<<

    Mark, I know I sound like a broken Record, but I think Melanie has hit it on the head. Your ability to "turn on" the circuit by touching, is a extremely good sign of a floating MCLR pin. Also improper grounding and sourcing.

    Have you set the MCLR fuse to "input", every time you programmed your chip? I have not checked the DataSheet, but if your chip as a internal Clock, try it with the internal clock.

    And like Melanie said... Make SURE your grounds are grounded and your sources are to 5 volts!.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Sharing Crystal with 2 IC's
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th January 2013, 13:33
  2. 20 Mhz Crystal, simple blinking LED
    By BenjaminsShinob in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th October 2007, 05:06
  3. 20MHz improve RF over 16F628A?
    By mbw123 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 28th November 2006, 16:04
  4. 20Mhz crystal cause led to blink irreguarly
    By niknaksbarbeque in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th April 2005, 11:35
  5. 20Mhz Crystal /Resonators
    By mslaney in forum Schematics
    Replies: 2
    Last Post: - 5th January 2005, 14:49

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