Internal OSC, how to?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Sorry, I should have been more specific.

    This post is in the thread I mentioned before.

    What to do if i get "overwriting previous address content" error message?
    http://www.picbasic.co.uk/forum/showthread.php?p=6775
    <br>
    DT

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Yes this error is generated by MPASM. A list of MPASM assembler error codes can be found
    in the MPASM help file.

    You can't stop PBP from including device specific .INC files. You just need to learn how to
    use/modify them for your own needs.

    The error is due to the __config directive being seen in two places. 1 in the 16F628A.INC file,
    and 1 in your code.

    If you prefer to insert config options in your code, and use the MPASM assembler, then just
    comment out the __config line in the include file.

    If you insert config options in your code, and you're using the PM assembler, you don't need
    to comment out config options. The PM assembler will use whatever config options you have
    in your code & ignore the default config options in the 16F628A.INC file. MPASM will throw
    the error.

    From the 16F628A.INC file in your PBP install directory:
    Code:
            NOLIST
        ifdef PM_USED
            LIST
            include 'M16F62xA.INC'  ; PM header
            device  pic16F628A, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
            XALL
            NOLIST
        else
            LIST
            LIST p = 16F628A, r = dec, w = -302
            INCLUDE "P16F628A.INC"  ; MPASM  Header
            ; __config _XT_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
            NOLIST
        endif
            LIST
    PBP automatically includes 16F628A.INC when you compile for this target.

    If the PM assembler is used ifdef PM_USED = true, and the M16F62xA.INC file is also
    included.

    If MPASM is used, then the P16F628A.INC file located in your MPLAB install directory is used.

    A list of all config options available for this PIC can be found in these secondary include files
    that 16F628A.INC points to.

    M16F62xA.INC if PM is used or P16F628A.INC if MPASM is used.

    _INTOSC_OSC_NOCLKOUT is the correct option for using the internal osc, but MPASM will
    complain if it sees the __config directive twice.

    So;
    1. Modify the config options in the PBP 16F628A.INC file.

    or;
    2. Comment the __config line out in this file, and drop them in your code.

    If you read through both threads Darrel linked to above, it should be easy to understand.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

Similar Threads

  1. Internal vs. external osc for comms
    By mtripoli in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 29th January 2010, 14:58
  2. 16F88 bootlader with Internal OSC
    By HenrikOlsson in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 2nd August 2009, 10:15
  3. 18F4520 and internal osc & PLL
    By pwhitt in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 15th September 2008, 06:38
  4. Internal Osc help
    By BobK in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 12th January 2007, 20:50
  5. 12f675 internal osc question.....
    By Gabe@SPdFtsh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th January 2004, 06:33

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