#config...#endconfig


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    May 2005
    Location
    Ne ohio
    Posts
    21

    Default #config...#endconfig

    Hi,

    I'm just starting up with pbp3 after using pbp 2.xx for a long time now.
    I'm trying the configuration settings in my code so I don't have to set or correct them in the melabs usb programmer form.

    I keep getting errors using this as a test:

    Define OSC 20 ' when using HS Oscillator

    #CONFIG
    __config _XT_OSC & _WDT_OFF ' & _LVP_OFF & _CP_OFF
    #ENDCONFIG

    the errors I get are:

    illegal argument (expected single character)
    Missing operator
    Argument out of range (not a valid config register address)
    Symbol not previously defined (_XT_OSC)
    symbol not previously defined (_WDT_OFF)


    do I have to define the processor in my code or something?



    thanks,

    Brian

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


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Got to
    C:\PBP3\DEVICE_REFERENCE
    and find the file for you chip.

    But the (') in your config statement might be causing some of you trouble.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    May 2005
    Location
    Ne ohio
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    thanks,
    that helps a lot seeing where they are located as a reference
    but...
    CONFIG WDTE = OFF
    still gives "CONFIG directive Error: (setting "WDTE in the supplied MicroCode IDE.

    both ON and OFF give the same error for my 18f6722 chip.

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


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Try this
    #CONFIG
    __CONFIG _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _BBSIZ_BB2K_4L & _XINST_OFF_4L

    #ENDCONFIG
    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    May 2005
    Location
    Ne ohio
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    thanks,

    Yes that compiles OK
    I turned the WDT off though. don't know what the other options are....

    where can I get the reference on these options? they don't look like the ones in the INFO file.
    what is the CONFIG1H through CONFIG4L about. Is that something in the microchip files?

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


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    To get the complete or correct configuration information you need to look at the, for this chip, P18F6722.INC file. This is in
    C:\Program Files\Microchip\MPASM Suite
    Do not modify this file, the info is near the end.
    The CONFIG1H through CONFIG4L is just different places the various bit are stored.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Quote Originally Posted by ptig185 View Post
    ...I turned the WDT off though. don't know what the other options are....

    I usually try to turn off as much stuff as possible. I figure they cost overhead that I could use for my own program instead.

    Then I turn features on as I need them 'cause I often turn off too much stuff.

    Robert


    EDIT: Maybe this might shed some light on features:

    http://www.picbasic.co.uk/forum/cont...-for-Beginners
    Last edited by Demon; - 1st September 2012 at 23:21.

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


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Quote Originally Posted by ptig185 View Post
    thanks,

    Yes that compiles OK
    I turned the WDT off though. don't know what the other options are....

    where can I get the reference on these options? they don't look like the ones in the INFO file.
    what is the CONFIG1H through CONFIG4L about. Is that something in the microchip files?
    http://ww1.microchip.com/downloads/e...Doc/39646c.pdf
    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.

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