12F683 EXTERNAL CRYSTAL CONFIG for DTMFOUT statement


+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2022
    Posts
    4

    Default 12F683 EXTERNAL CRYSTAL CONFIG for DTMFOUT statement

    Hello,
    I currently using a 12F683 at 8mhz internal osc, with this code below and it's working fine no problem at all.

    #CONFIG
    ; __config _INTRC_OSC_NOCLKOUT & _WDTE_ON & _PWRTE_ON & _MCLRE_OFF & _BOD_OFF & _CP_ON & _CPD_OFF
    #ENDCONFIG

    OSCCON = $70 ; 8mhz

    This is the config set from meConfig setup program:

    #CONFIG
    __config _INTOSC & _WDT_ON & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOD_ON & _IESO_ON & _FCMEN_ON
    #ENDCONFIG


    Now I need to use the same 12F683 chip with an 16mhz and/or 20mhz external crystal,

    What do I need to change to make it work at 16 or 20mhz external crystal, please provide both config 16 and 20mhz crystal.

    Thank's to reply.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: 12F683 EXTERNAL CRYSTAL CONFIG for DTMFOUT statement

    At the top Define 16mhz or 20mhz

    OSCCON = 0

    In the config replace

    _INTOSC or _INTRC_OSC_NOCLKOUT with _HS_OSC
    Last edited by mark_s; - 17th March 2022 at 22:25.

  3. #3
    Join Date
    Jan 2022
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: 12F683 EXTERNAL CRYSTAL CONFIG for DTMFOUT statement

    Thank's Mark_s for the quick reply,

    I did changed theses lines, but there's one thing is odd, I have to turn MCLRE_ON to "on" if it's "OFF" nothing is working properly
    look at my listing, I did this to test if the Pic is running at 16mhz,

    Cheer,


    #CONFIG
    __config _HS_OSC & _WDT_ON & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOD_ON & _IESO_ON & _FCMEN_ON
    #ENDCONFIG

    OSCCON = 0
    DEFINE OSC 4 ;RUN 4X 16MHZ CRYSTAL
    ;DEFINE OSC 16 ;RUN 1X 16MHZ CRYSTAL PAUSE 1000 = 1 SEC

    ANSEL = 0 ; Set all digital PULLUP Resistor page:10
    CMCON0 = 7 ; Analog comparators off

    LED Con 0

    DO ; main loop
    TOGGLE LED
    PAUSE 1000
    LOOP
    END

  4. #4
    Join Date
    Jan 2022
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: 12F683 EXTERNAL CRYSTAL CONFIG for DTMFOUT statement

    Quote Originally Posted by jackberg1 View Post
    Thank's Mark_s for the quick reply,

    I did changed theses lines, but there's one thing is odd, I have to turn MCLRE_ON to "on" if it's "OFF" nothing is working properly
    look at my listing, I did this to test if the Pic is running at 16mhz,

    Cheer,


    #CONFIG
    __config _HS_OSC & _WDT_ON & _PWRTE_OFF & _MCLRE_ON & _CP_OFF & _CPD_OFF & _BOD_ON & _IESO_ON & _FCMEN_ON
    #ENDCONFIG

    OSCCON = 0
    DEFINE OSC 4 ;RUN 4X 16MHZ CRYSTAL
    ;DEFINE OSC 16 ;RUN 1X 16MHZ CRYSTAL PAUSE 1000 = 1 SEC

    ANSEL = 0 ; Set all digital PULLUP Resistor page:10
    CMCON0 = 7 ; Analog comparators off

    LED Con 0

    DO ; main loop
    TOGGLE LED
    PAUSE 1000
    LOOP
    END



    ----------------------------------------------- NEW CONFIG SEEM TO WORK ----------------------------------------------

    IF DEFINE OSC 4 LED BLINK 2 times on-off / 1 sec FOR 16MHZ CRYSTAL
    IF DEFINE OSC 8 LED BLINK 1 times on-off / 1 sec FOR 16MHZ CRYSTAL
    IF DEFINE OSC 16 LED BLINK ON 1 SEC, BLINK OFF 1 SEC, FOR 16MHZ CRYSTAL

    Let me know if this new config is correct.

    Thank's again for comments.


    ; config setup from meConfig program
    #CONFIG
    __config _HS_OSC & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_ON & _CPD_OFF & _BOD_OFF & _IESO_OFF & _FCMEN_OFF
    #ENDCONFIG


    ;OSCCON = 0
    ;DEFINE OSC 4 ;RUN 4X 16MHZ CRYSTAL
    ;DEFINE OSC 8 ;RUN 2X 16MHZ CRYSTAL
    DEFINE OSC 16 ;RUN 1X 16MHZ CRYSTAL PAUSE 1000 = 1 SEC


    ANSEL = 0 ; Set all digital PULLUP Resistor page:10
    CMCON0 = 7 ; Analog comparators off


    LED Con 0


    DO ; main loop
    TOGGLE LED
    PAUSE 1000
    LOOP
    END

Similar Threads

  1. Replies: 8
    Last Post: - 20th March 2017, 09:34
  2. how to use external crystal?
    By tbarania in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 22nd March 2015, 15:43
  3. 1 x external crystal oscillator for multiple PICs
    By harryweb in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th November 2013, 14:05
  4. 12F683 - how to set it to use external 4 MHz clock?
    By jimbostlawrence in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 29th September 2009, 09:16
  5. 16f877A and tmr1 external crystal question
    By comwarrior in forum General
    Replies: 3
    Last Post: - 13th July 2009, 00:40

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