External Ocilator PIC16f690 Help


Closed Thread
Results 1 to 6 of 6
  1. #1
    jzprice's Avatar
    jzprice Guest

    Exclamation External Ocilator PIC16f690 Help

    I have been tring to use an external oscillator for PIC16F690 for 6 hours and have not had much luck.

    I connected a 20mhz cystal to OSCL1 and OSCL2 with 22uF ceramic caps but that did not drop the frequency of a HPWM signal.

    I know that I have to use the OSCCON = %01100000. But I'm not sure of the values, and I think I have to write to the CONFIG reg which is 16bits. i don't know how to write to that. could someone give instructions for a person new to PBP and microcontrollers?


    -thanks

    Datasheet: http://ww1.microchip.com/downloads/e...Doc/41262E.pdf PG(50 & 197)

  2. #2
    Join Date
    Feb 2009
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Please post some code. Your configuration fuses need to be set use an external osc. Did you define the osc speed? If you do not it is assumed you are using 4 Mhz.

    Code:
    DEFINE OSC 20
    The lowest HPWM Frequency as per the manual states for 20 Mhz:

    1221Hz for 14-bit core and 18CXXX
    or
    19531Hz for 17CXXX

    Here is a great thread on Configuration Fuses.

    Hope this helps. With some code to see more people can help out.

    Nemesis

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


    Did you find this post helpful? Yes | No

    Default

    Hello jzprice,
    in your MPASM Suite directory, you will find a file named P16F690.inc file, near the bottom of that file is a list of every Config option available.
    In your PBP directory you will find a file Called 16F690.inc. This file has the <b>default</b> config statement. You may alter that statement or simply add a semicolon to make it into a comment. You may then insert the config statement into your code, every time (recommended). In your example you would change __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF <br>to<br>__config _HS_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF
    and as nemisis stated use the DEFINE as shown in his post.
    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.

  4. #4
    Join Date
    Dec 2007
    Location
    Finland
    Posts
    191


    Did you find this post helpful? Yes | No

    Post

    Quote Originally Posted by jzprice View Post
    I connected a 20mhz cystal to OSCL1 and OSCL2 with 22uF ceramic caps but that did not drop the frequency of a HPWM signal.
    I hope this is just a typo, right capacitor range is in pF.

    BR,
    -Gusse-

  5. #5
    Join Date
    Feb 2009
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Gusse is right. I thought it is something like 12pf needed for 20 Mhz crystal. Why not just slap in a 20 Mhz resonator with the capacitor built in.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Gusse View Post
    I hope this is just a typo, right capacitor range is in pF.

    BR,
    -Gusse-
    Nice catch !
    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.

Similar Threads

  1. Replies: 1
    Last Post: - 28th January 2010, 22:15
  2. TMR1 external LP xtal setup check
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 13th October 2009, 18:11
  3. How to use an external oscillator
    By Mugelpower in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 5th February 2008, 14:19
  4. External Control Lines
    By weirdjim in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd August 2007, 19:29
  5. switching external vref+ and vdd vref
    By alejandro_halon in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 16th February 2005, 20:13

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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