#config...#endconfig


Closed Thread
Results 1 to 17 of 17
  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
    2,597


    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
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Quote Originally Posted by Demon View Post
    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.
    A config bit is either on or off, but it is still a bit.
    Dave
    Always wear safety glasses while programming.

  9. #9
    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.

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Quote Originally Posted by mackrackit View Post
    A config bit is either on or off, but it is still a bit.
    I know, but don't features generate more code if they are active?

    PWM, USB, etc.

    Robert


    EDIT: An example of unnecessary overhead:

    ADON: ADC Enable bit
    1 = ADC is enabled
    0 = ADC is disabled and consumes no operating current
    I rarely use ADC, apparently having it on for nothing would consume current needlessly (probably very little, but still).
    Last edited by Demon; - 3rd September 2012 at 06:20.

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


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    The ADC is not in the configs as this thread was about.

    But you you are correct about some of the "features".
    Dave
    Always wear safety glasses while programming.

  12. #12
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Long time ago there was the idea of having an "auto" configurator maybe through graphic environment, for the chip that the user uses and some of the good folks here were trying to figure out how to do this.

    I suppose that it was a bit of a headache and the project quietly was abandoned.

    Maybe it is time to start it over again.

    Ioannis

  13. #13
    Join Date
    Nov 2008
    Posts
    60


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Is the IDE able to use plug-ins? maybe a external program that you can call from the IDE that will parse the device info file and list the available fuses?
    Regards
    CharlieM
    Using PBP3
    MCSPX

  14. #14
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,614


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    http://www.picbasic.co.uk/forum/showthread.php?t=13663

    no, no ... not on the head, please !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  15. #15
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Hmm, that was the thread I was refering to. It seems that it was to ambitious project...

    Ioannis

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


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    Maybe it is time to start it over again.

    Ioannis
    Does anyone have the time? I do not.
    Dave
    Always wear safety glasses while programming.

  17. #17
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,806


    Did you find this post helpful? Yes | No

    Default Re: #config...#endconfig

    I am willing but lack the knowledge of PC programing....

    Ioannis

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