Configuration bits


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    May 2008
    Posts
    21

    Post Configuration bits

    Ninja Edit here: I solved the problem so dont waste your time unless you're just curious.

    I've been using the internal oscillator a bit on a PIC18F2520. I just defined OSCCON and away I went. It is defaulting to INTIO with port function on pins OSC1/RA7 and OSC2/RA6. I now want to specify the bits in CONFIG1H to have clockout on RA6. So I've been looking around and I found 2 threads(linked below). At the very minimum i've cut down to this(and of course... not understanding why its not working):
    Code:
    asm
         CONFIG OSCS=OFF,OSC=INTIO7
    endasm
    So when I try this I get this error:
    Error[177] __CONFIG directives cannot be used with CONFIG directives


    So I tried adding __(which of course was wrong). I then tried defining the old way.

    Code:
    asm
    	__CONFIG _CONFIG1H, _OSC_INTIO7_1H
    endasm
    Which of course gave me:
    Error[118] C:\IDE PROGRAMS\SERIAL\SERIAL.ASM 339 : Overwriting previous address contents (0000)
    Error[118] C:\IDE PROGRAMS\SERIAL\SERIAL.ASM 339 : Overwriting previous address contents (0001)

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

    http://www.picbasic.co.uk/forum/showthread.php?p=13087

    This is taken from my .inc file in the MPASM directory.
    Code:
    ;
    ;   IMPORTANT: For the PIC18 devices, the __CONFIG directive has been
    ;              superseded by the CONFIG directive.  The following settings
    ;              are available for this device.
    ;
    ;   Oscillator Selection bits:
    ;     OSC = LP             LP oscillator
    ;     OSC = XT             XT oscillator
    ;     OSC = HS             HS oscillator
    ;     OSC = RC             External RC oscillator, CLKO function on RA6
    ;     OSC = EC             EC oscillator, CLKO function on RA6
    ;     OSC = ECIO6          EC oscillator, port function on RA6
    ;     OSC = HSPLL          HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1)
    ;     OSC = RCIO6          External RC oscillator, port function on RA6
    ;     OSC = INTIO67        Internal oscillator block, port function on RA6 and RA7
    ;     OSC = INTIO7         Internal oscillator block, CLKO function on RA6, port function on RA7
    Whats wrong?

    -- I needed to comment out the lines(as seen below) in the .INC file in the PBP directory.
    Code:
            ;__CONFIG    _CONFIG1H, _OSC_INTIO7_1H
            ;__CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            ;__CONFIG    _CONFIG3H, _PBADEN_OFF_3H
            ;__CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    Last edited by Perrin`; - 26th June 2008 at 17:41.

  2. #2
    Join Date
    May 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Angry

    Somehow I knew... as soon as I posted... I'd figure it out, problem solved

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Thumbs up

    Don't get on yourself too hard...
    Quote Originally Posted by Perrin` View Post
    Somehow I knew... as soon as I posted... I'd figure it out, problem solved
    That's exactly the sort of thing some of us around here like to see

  4. #4
    Join Date
    Jun 2008
    Location
    Varese , Italy
    Posts
    326


    Did you find this post helpful? Yes | No

    Default mp vs mpasm

    Hi, I have the same problem using Mpasm: how did you solve them ?
    Thanks
    Ambro
    Iw2fvo


    Quote Originally Posted by Perrin` View Post
    Somehow I knew... as soon as I posted... I'd figure it out, problem solved

  5. #5
    Join Date
    May 2008
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Perrin` View Post
    Whats wrong?

    -- I needed to comment out the lines(as seen below) in the .INC file in the PBP directory.
    Code:
            ;__CONFIG    _CONFIG1H, _OSC_INTIO7_1H
            ;__CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            ;__CONFIG    _CONFIG3H, _PBADEN_OFF_3H
            ;__CONFIG    _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
    Sorry this is kinda late I was on vacation XD

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 08:55
  2. Configuration bits in a HEX file gone missing?
    By grzes.r in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 2nd February 2010, 02:10
  3. Configuration bits setting problem
    By financecatalyst in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th August 2009, 18:25
  4. Configuration bits
    By Armando Herjim in forum General
    Replies: 0
    Last Post: - 5th December 2006, 17:51
  5. error on compiling
    By parker in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th June 2005, 15:31

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