keep grtting Error[118]


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2012
    Location
    Georgia, USA
    Posts
    20

    Default keep grtting Error[118]

    Has anyone had trouble compiling this project in PBP 2.60C

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

    I keep grtting Error[118]. I can remove the config line,

    @ __CONFIG _INTRC_IO & _WDT_OFF & _PWRTE_ON & _LVP_OFF & _CP_OFF & _MCLR_OFF 'FOR 819

    and it will compile but will not run on my PIC16F819.

    I have looked up the codes on this site but do no understand exctally what they do.


    Thanks in advance for any help to get me pointed in the right direction.

    Thanks
    Larry

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,516


    Did you find this post helpful? Yes | No

    Default Re: keep grtting Error[118]

    Hi,
    With versions prior to PBP3 you need to have the CONFIG directive either in your program OR in the default inc file. You get the error when you're trying to have it both ways at the same time.

    All devices have their default CONFIG in their respective .inc file so if you need to change it you have two options:

    A) Open the .inc file and comment out the CONFIG directive there, then add it to you your source file containing the needed changes.
    B) Open the .inc file and EDIT the CONFIG directive there so that it matches what you need - don't add it to your source.

    I don't have 2.6 on this machine but with PBP3 the 16F819 defaults to HS_OSC which is probably why it doesn't work with the defualt CONFIG.

    /Henrik.

  3. #3
    Join Date
    Dec 2012
    Location
    Georgia, USA
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: keep grtting Error[118]

    Thank you Henrik !


    Ok,
    I found the file M16F81X.INC
    , but do not understand what is active.

    Example the include file has both ,

    WDT_ON equ 3FFB0004h ; XX XXXX XXXX X1XX
    WDT_OFF equ 3FFB0000h ; XX XXXX XXXX X0XX

    How do you tell what is on or off?


    Is their a Document that tells how to read .inc files ?



    @ __CONFIG _INTRC_IO & _WDT_OFF & _PWRTE_ON & _LVP_OFF & _CP_OFF & _MCLR_OFF 'FOR 819


    @ __CONFIG
    _INTRC_IO
    ----------------------

    & _WDT_OFF

    WDT_ON equ 3FFB0004h ; XX XXXX XXXX X1XX
    WDT_OFF equ 3FFB0000h ; XX XXXX XXXX X0XX
    ----------------------

    PWRTE_ON
    Not in File
    ----------------------

    & _LVP_OFF
    LVP_ON equ 3F7F0080h ; XX XXXX 1XXX XXXX
    LVP_OFF equ 3F7F0000h ; XX XXXX 0XXX XXXX
    ----------------------

    & _CP_OFF
    Not in File
    ----------------------

    & _MCLR_OFF
    MCLR_ON equ 3FDF0020h ; XX XXXX XX1X XXXX


    MCLR_OFF equ 3FDF0000h ; XX XXXX XX0X XXXX
    ----------------------


    What does _INTRC_IO mean? I cant fing it in the .INC file





    Thanks again for your help.

    LarryD

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: keep grtting Error[118]

    LaryD, The statements with "equ" are mearly equate statements used for the compiler and assembler. The tell the appropriate program where the actual bit is located. They do not actually set the bit to true or false. That is what the directive "&_MCLR_OFF" or "&_MCLR_ON" do.
    Dave Purola,
    N8NTA
    EN82fn

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


    Did you find this post helpful? Yes | No

    Default Re: keep grtting Error[118]

    You need to be in the *.inc file that is in the PBP directory.

    Read this
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Post #5 has a good explanation.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Dec 2012
    Location
    Georgia, USA
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: keep grtting Error[118]

    Dave, and
    Mackrackit,

    Thank you both Very much, This was just what I needed.

    after reading http://www.picbasic.co.uk/forum/showthread.php?t=543
    I now have a handle on how it all works. I pounded out the 16F819.INC
    config for the MPASM and all worked fine.

    Thank you so much for All your Help.

    Larryd

Similar Threads

  1. ERROR line 90: Sintax error----> [TabIndex]
    By martintorres in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 9th September 2012, 05:29
  2. Replies: 1
    Last Post: - 30th March 2012, 05:13
  3. Compile error & syntax error on the word "loop:" as a label?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 7th March 2010, 05:14
  4. Error[118]
    By Lionheart in forum General
    Replies: 4
    Last Post: - 22nd October 2009, 10:17
  5. Error 118 over writing address 2007
    By Scampy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 18th October 2009, 17:35

Members who have read this thread : 2

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