config bits


Closed Thread
Results 1 to 6 of 6

Thread: config bits

Hybrid View

  1. #1
    Join Date
    Feb 2010
    Posts
    11


    Did you find this post helpful? Yes | No

    Default

    thanks
    but please explaine the following.

    comment out.

    if i understand correctly!
    the inc file within the pbp, i copy and paste it in pbp program

    or do i have to change it within the inc file?

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


    Did you find this post helpful? Yes | No

    Default

    Hi,
    If you want to set the CONFIG fuses in YOUR program they can't be set in the .inc file TOO, which they are by default. In order to be able to set them in YOUR you need to take them out of the .inc file.

    Commenting out means convert the lines to comments so that they don't get compiled/assembled. You do that with a semicolon, like this:
    Code:
            LIST
            LIST p = 18F4220, r = dec, w = -302, f = inhx32
            INCLUDE "P18F4220.INC"  ; MPASM  Header
    ;        __CONFIG    _CONFIG1H, _XT_OSC_1H
    ;        __CONFIG    _CONFIG2L, _BOR_ON_2L & _BORV_20_2L & _PWRT_ON_2L
    ;        __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
    ;        __CONFIG    _CONFIG3H, _MCLRE_ON_3H & _CCP2MX_ON_3H
    ;        __CONFIG    _CONFIG4L, _STVR_ON_4L & _LVP_OFF_4L & _DEBUG_OFF_4L
    See the semicolon at the beginning of the lines - this is effectively the same as deleting those lines from the file but "commenting them out" instead allows you to easily revert back if need be.

    Here's what happens. When you compile a program the compiler automatically adds the .inc file that is located in the PBP folder. The code in this file automatically adds the .inc file located in the MPASM folder.

Similar Threads

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

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