Setting up a 12F683 to run at 20 Mhz


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    34


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    It does not look like you are setting the config correctly.
    The thread that Joe and I pointed you to should have helped.

    For now try going to the inc file for this chip in the PBP directory. Below is part of it.
    If you are using PM for the assembler change
    device pic12F683, intrc_osc_noclkout, wdt_on, mclr_on, protect_off
    to
    device pic12F683, hs_osc, wdt_on, mclr_on, protect_off

    If you are using MPASM then change
    __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
    to
    __config _HS_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF

    Dave, thanks for your help, really appreciate it. I've been spending too many hours (very unproductive ones at that) trying to learn this thing called picbasic, and, as I'm sure you know, after you hit that frustration level...YOU JUST CAN'T GIVE UP! And, of course its down hill from there...Sleep is good, if you can get your mind off the problem.

    Anyway,

    Here's my Code:

    [HTML]@__config _HS_OSC & _WDT_ON & _MCLRE_ON & _CP_OFF

    DEFINE OSC 20


    CMCON0 = 7 ' Analog comparators off
    ANSEL = 0 ' Analog select set to digital, pg 69 data
    ADCON0 = 0 ' A/D turned OFF, pg 68 of data


    '***************************************
    'Define Variables


    '***************************************
    'Set Variables


    low 0


    start:
    toggle 0

    pause 1000

    goto start

    end[/HTML]

    When I change the DEFINE OSC between 4, 8, 20 it seems to work fine now...but I get compilation errors as follows:

    [HTML]Executing: "C:\PBP\PBPW.EXE" -ampasmwin -oq -z -p12F683 "Blink 12f683 simple.bas"
    PICBASIC PRO(TM) Compiler 2.50b, (c) 1998, 2008 microEngineering Labs, Inc.
    All Rights Reserved.
    Warning[205] E:\USERS\JDROOG\DOCUMENTS\MCS\BLINK 12F683 SIMPLE.ASM 82 : Found directive in column 1. (__config)
    Error[118] E:\USERS\JDROOG\DOCUMENTS\MCS\BLINK 12F683 SIMPLE.ASM 82 : Overwriting previous address contents (2007)
    Error[118] E:\USERS\JDROOG\DOCUMENTS\MCS\BLINK 12F683 SIMPLE.ASM 82 : Overwriting previous address contents (2007)
    Loaded E:\Users\jdroog\Documents\MCS\Blink 12f683 simple.COD.
    BUILD SUCCEEDED: Mon Mar 02 19:14:43 2009[/HTML]

    What exactly does this mean??

    John.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    For the error go to the *.inc file in the PBP directory for your chip and comment out this line

    __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF

    with a ;

    The warning is just a warning, you can add this near the top of you code
    Code:
    Asm
        ERRORLEVEL -205
    Endasm
    or put a space between
    @ and _
    in the config statement in you code.

    This stuff is addictive
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2009
    Posts
    34


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    For the error go to the *.inc file in the PBP directory for your chip and comment out this line

    __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF

    with a ;

    The warning is just a warning, you can add this near the top of you code
    Code:
    Asm
        ERRORLEVEL -205
    Endasm
    or put a space between
    @ and _
    in the config statement in you code.

    This stuff is addictive

    It worked. Thanks again. I think I'll read some Tom Clancey now...

Similar Threads

  1. PICKit2 - warning about configuration words
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 4th August 2009, 14:01
  2. Char. LCD and 18F452 on 20 MHz not work
    By samettin in forum General
    Replies: 11
    Last Post: - 28th July 2008, 09:59
  3. PIC18F2685 config settings for 20 MHz
    By wwilson17 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st March 2008, 23:13
  4. 20 MHz + PLL vs 48MHz
    By Demon in forum General
    Replies: 14
    Last Post: - 31st July 2006, 12:02
  5. How to use a 20 MHz resonator on a 16F688
    By Thomas Williams in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 21st December 2005, 09:18

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