How to use MPASM 'INC' files?


Closed Thread
Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156

    Default How to use MPASM 'INC' files?

    Hi,

    I am trying to compile a program for a PIC18F67J60, and need to set the
    FOSC0 and FOSC1 bits. These are located in a CONFIG2L register. I was told that these could be set in the 'P18F67J60.INC' file that came with the MPASM compiler, but I don't have the slightest idea how to do it.

    Can somebody please tell me how to use these INC files?

    Thanks very much!

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


    Did you find this post helpful? Yes | No

    Default

    The file you need to modify is in the PBP directory. 18F67J60.inc

    The P18F67J60.INC is in the MPASM directory. Near the end of this file is all of the options for the configs.

    Have you seen this thread? Might find it handy.
    http://www.picbasic.co.uk/forum/showthread.php?t=543
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

  4. #4
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Thumbs up

    PERFECT! Thanks for your kind help.

  5. #5
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    When in include this line:

    @ INCLUDE "P18F67J60.INC"

    I get

    "Message[310] c:\path...\p18f67j60.inc 3210: Superseding current RAM and RAM map"

    What does this mean? (MPASM did report that the assembly was successful, however)

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


    Did you find this post helpful? Yes | No

    Default

    Do not include that line. The compiler has already taken care of all that.
    Dave
    Always wear safety glasses while programming.

  7. #7
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Yeah, that was slowly dawning on me. All I'm trying to do is set the oscillator to EC (external oscillator). So, after looking at the .inc file, it says at the bottom that there's a bunch of settings that are valid, including FOSC=EC. (They all have ; in front

    so I include this line in my PBP program...

    @ CONFIG FOSC=EC

    and I get the following:

    Error[176] c:\path...\test.asm 75: CONFIG Directive Error: (multiple definitions found for setting "FOSC")

    I have NOT removed any ; from in front of the settings (actually, I tried it both ways), so don't know what's wrong.

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


    Did you find this post helpful? Yes | No

    Default

    This thread will help
    http://www.picbasic.co.uk/forum/showthread.php?t=543

    In the PBP *.inc file you will need to comment out the config lines to set the configs in code space.

    The default setting in the PBP *.inc file is for HS. An external OSC. So you really do not have to do anything.

    The file you are looking at with ";" in front of each line is the MPASM inc file. You DO NOT want to change anything here. Just look at it to see the options.

    I will bet HS is the setting you want. That is for an external resonator.
    EC will give a clock out function.
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    Oh my gosh, you're right!!

    I really AM confused! I see that the settings are actually set in the c:\pbp\18F67J60.INC file. When I want to change settings, should I just edit this c:\pbp\18F67J60.INC file manually, or put @ CONFIG lines in my source file??

    Then what is the purpose of the c:\mpasm\mpasm suite\P18f67J60.INC file? Just to show what options are available?

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


    Did you find this post helpful? Yes | No

    Default

    CONFUSED! Hey , that means thing are going well

    It is kind of a personal preference as to where you set the configs.

    If you do not plan on changing them often then the inc file might be the way to go. If you like playing with things or have different applications using the same chip then setting the confis in your code might be better.

    If you do set them in the code you will not have to remember how you have things setup when you do an upgrade or something like that.

    The MPASM *.inc is also used by the compiler...or is it the assembler?
    If you read through it you will see all of the lines that are not commented. Those are used for something somewhere.
    Dave
    Always wear safety glasses while programming.

Similar Threads

  1. 12F675 MCLR directive MPASM
    By OLDSCHOOL in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th May 2008, 01:29
  2. MPASM 18F4550 getting started
    By BrianT in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th September 2007, 23:59
  3. 18F8722 and MPASM confusion!
    By Jackson in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd April 2006, 01:24
  4. Replies: 2
    Last Post: - 13th December 2005, 00:11
  5. Converting to MPASM
    By btaylor in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 4th November 2005, 01:35

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