How to read / understand the config file P16fxxx.inc


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2010
    Posts
    4

    Default How to read / understand the config file P16fxxx.inc

    After using a time PM as the assembler of PBP I switched over to mpasmwin, but now I get errors direct in the first line of my programm.
    I use the pic 16F882.
    I looked in the P16F88x.inc file to see how to setup the configword(s) in my programm.
    @ __CONFIG _HS_OSC
    was the first I tried and te result was an error [126].
    The question is what do I forget when using this processor??
    Thanks in advance.

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


    Did you find this post helpful? Yes | No

    Default

    Welcome to the forum.

    If you have not read this it will be good that you do.
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    Now, make sure that the correct lines are commented in the PICs *.inc file, then the fuse line in your code using MPASM should look something like this.
    Code:
    @ __config _CONFIG1, _HS_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
    Use the line you commented for a template.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2010
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Thank you very much.
    I will try is this evening.
    And I will read the whole topic about this.
    Regards,
    JMJ882

  4. #4
    Join Date
    Jan 2010
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Hallo I am back again.
    I have read the article for many times. I read the content of P16F882.inc. I tried almost every posibility I can guess, but still I got the error message.
    Is there somebody here who got the part of
    @ __config etc.
    working for the 16F882, 16F883, 16F884, 16F886 or 16F887 working without the error message?
    When I take this for an 18F452 then it's working, but for this part it is'nt.
    Could there be a problem in the P16F88x.inc file or may be in the mpasm program, or maybe in me??

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by jmj882 View Post
    Hallo I am back again.
    I have read the article for many times. I read the content of P16F882.inc. I tried almost every posibility I can guess, but still I got the error message.
    Is there somebody here who got the part of
    @ __config etc.
    working for the 16F882, 16F883, 16F884, 16F886 or 16F887 working without the error message?
    When I take this for an 18F452 then it's working, but for this part it is'nt.
    Could there be a problem in the P16F88x.inc file or may be in the mpasm program, or maybe in me??
    Hello jmj882,
    The files you are referring to are MPASM files, where you can go and look to see which registers you have available. <b>This is not the place to change the configs.</b> look in your PBP root directory, and find the 16F882.inc, 16F883.inc . . . it is in these files where you add a semicolon ahead of the config, so the compiler will skip it.
    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.

  6. #6
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default CONFIG settings for 16F690

    jmj882, I don't have the settings for the 16Fxxx MCUs you mention, but here is what I use for the 16F690. These should be very close to the CONFIGs for your listed chips. Notice the IF..ELSE structure of this assembly code that you can paste into a .pbp program will work with either the PM or MPASM assemblers.
    Code:
    ' -----[ Device Declaration ]---------------------------------------------
    ASM  ; 16F690
      ifdef PM_USED                  ; For PM assembler
        device  INTRC_OSC_NOCLKOUT   ;   Oscillator Selection
        device  FCMEN_OFF            ;   Fail-Safe Clock Monitor
        device  IESO_OFF             ;   Internal External Switchover
        device  BOD_OFF              ;   Brown-out Detect
        ; device BOR_SBODEN           ;   SBODEN Brown-out setting
        device  CPD_OFF              ;   Data Code Protection
        device  PROTECT_OFF          ;   Code Protection
        device  MCLR_OFF             ;   Master Clear Reset
        device  PWRT_OFF             ;   Power-up Timer
        device  WDT_OFF              ;   Watchdog Timer
    
      else                            ; For MPASM assembler
    cfg=      _INTRC_OSC_NOCLKOUT     ;   Oscillator Selection
    cfg=cfg&  _FCMEN_OFF              ;   Fail-Safe Clock Monitor
    cfg=cfg&  _IESO_OFF               ;   Internal External Switchover
    cfg=cfg&  _BOR_OFF                ;   Brown-out Reset
    cfg=cfg&  _CPD_OFF                ;   Data Code Protection
    cfg=cfg&  _CP_OFF                 ;   Code Protection
    cfg=cfg&  _MCLRE_OFF              ;   Master Clear Reset
    cfg=cfg&  _PWRTE_OFF              ;   Power-up Timer
    cfg=cfg&  _WDT_OFF                ;   Watchdog Timer
      __CONFIG  cfg
      endif
    ENDASM

  7. #7
    Join Date
    Jan 2010
    Posts
    4


    Did you find this post helpful? Yes | No

    Default

    Thank you Joe S. , jellis00 and mackrackit
    That was the problem. Now I also understood what I missed and didn't understood.
    Regards,
    jmj882

Similar Threads

  1. Cleaning up code
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd December 2009, 07:14
  2. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  3. Error 0X0000008E when connecting a 18F2550 USB HID
    By FranciscoMartin in forum USB
    Replies: 8
    Last Post: - 16th October 2008, 17:20
  4. PortE problems (PIC18F4455)
    By RubenR in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 12th July 2006, 15:26
  5. Installation sequence
    By Demon in forum General
    Replies: 23
    Last Post: - 11th July 2006, 03:56

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