Config Bits

+ Reply to Thread
Results 1 to 7 of 7

Thread: Config Bits

  1. #1
    Join Date
    May 2014

    Default Config Bits

    I know this has been discussed and rediscussed, but I find none of the posts here useful. Presumably I'm just an amateur idiot in the making. Anyway. I have used a number of different compiler/ide combos and find PBP to be just about the most cumbersome of them all when it comes to configuring trying to get the config bits set.

    Is there not a way to do this from within the program? Do I have to modify the include file? Which I did, by the way, and received a large number of errors for my efforts.

    how in the world do I get these things set? The include file only has 4 of the 11 config bytes that need to be set ( What gives? Why does this not put the config bits into the hex file? When I try to load it using pickit2 it has the wrong config bits set.

    This is really confusing and tedious. I've about decided to give up and go with arduino.

    Any help you guys can give will be greatly appreciated.

  2. #2
    Join Date
    Jan 2005
    Montreal, Quebec, Canada

  3. #3
    Join Date
    Sep 2010
    Las Vegas, NV

    Default Re: Config Bits

    You oughta try an easier chip first. Those bazillion pin behemoths are pesky to say the least. Spend the 39 cents American and buy a 12F683. Simple and you can make sure your hardware and software work before you graduate to the big boys.

  4. #4
    Join Date
    Oct 2005

    Default Re: Config Bits

    Since you're a new user to PBP I'm going to guess you've got PBP3. IF that's the case then neither of the posts Robert linked is valid and will only cause further confusion and problems. With PBP3 you should never need to edit the include files, it'll only cause you trouble. Instead you need to look up the #CONFIG / #ENDCONFIG directives in the manual. However, if you ARE on a version prior to PBP3 then obviously the threads referenced earlier are indeed valid.

    Either way, provided you do it correctly, the CONFIG bits will be included in the compiled/assembled hex file but depending on the device programmer they may or may not be programmed in (setting in the device programmers software).

    You may also be interested in the meCONFIG utillity.

    If you need further help please clarify which version of PBP you're using.


  5. #5
    Join Date
    May 2014

    Default Re: Config Bits

    OK. I have tried the various solutions presented. I have PBP2.60C. I have had it for a number of years and used it very little because of similar issues to the one I am having now. However, since I BOUGHT the thing, and since mplab really sucks, and because my sourceboost runs unimaginably slow on this laptop (no good reason for that and it really ticks me off), I decided to try this again. Mistake number 4 or five... I lost count.

    Anyway. I have tried the various solutions. The config bits are still left unset. I typically get the following an error saying that it is overwriting the previous address contents. My assumption (incorrect as it is) was that the program was actually changing the bits. pickit2 disagrees.

    Any other ideas?

    Does anyone have an actual program using the config bits that actually compiles and runs that they would be willing to post so that morons like me can actually SEE what REALLY works?

    just so you can see this ridiculous program I'm using it is below: BTW, just so you know, I used the meConfig to set the bits in the program as outlines. I made sure to uncheck the PBP3 checkbox as I am NOT using that.
    '************************************************* ***************
    '* Name : sound_test.BAS *
    '* Author : MityEltu *
    '* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
    '* : All Rights Reserved *
    '* Date : 5/6/2014 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************

    __config _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __config _CONFIG2L, _PWRT_OFF_2L & _BOREN_SBORDIS_2L & _BORV_3_2L
    __config _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
    __config _CONFIG4L, _STVREN_OFF_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
    __config _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
    __config _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    __config _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
    __config _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
    __config _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
    __config _CONFIG7H, _EBTRB_OFF_7H

    gosub setup
    goto main

    intcon = $00
    intcon2 = $80
    intcon3 = $00
    pie1 = $00
    pie2 = $00

    ccp1con = $00
    ccp2con = $00

    adcon0 = $00
    adcon1 = $0f

    cmcon = $03
    cvrcon = $00
    hlvdcon = $00

    trisa = $00
    porta = $00
    trisb = $ff
    trisc = $00
    portc = $00
    trisd = $ff
    trise = $00
    porte = $00
    Last edited by mityeltu; - 7th May 2014 at 23:17.

  6. #6
    Join Date
    Jul 2003
    Colorado Springs

    Default Re: Config Bits

    Quote Originally Posted by mityeltu View Post
    OK. I have tried the various solutions presented. I have PBP2.60C. ...
    I typically get the following an error saying that it is overwriting the previous address contents. ...
    Go back to demon's post #2, and revisit the 543 thread.
    In particular, go to post #5 from mister_e ... and like magic from 9 years ago ... your problem will be solved.

    Well except for the fact that you've set the HS oscillator mode and don't have a DEFINE OSC xx statement.

    And you should just delete that whole setup subroutine.
    Maybe keep the ADCON1 and CMCON values, but unless you are planning on using the comparators ... you'll probably want CMCON = 7.

    Then just do a ...
    LED   PORTB.0
        HIGH LED
        PAUSE 500
        LOW LED
        PAUSE 500
    GOTO Main

  7. #7
    Join Date
    May 2014

    Default Re: Config Bits

    You have fixed my problem. I sincerely appreciate your patience and gentleness when faced with my abruptness and rudeness. I apologize for my haste and arrogance and ask for your forgiveness. Thank you again.

Similar Threads

  1. Replies: 2
    Last Post: - 23rd April 2013, 16:34
  2. config bits
    By brianD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 9th February 2010, 14:45
  3. DT_INTS-14 /interrupts enable bits / flag bits
    By bogdan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th May 2009, 18:42
  4. Need clever way to convert 10 bits to 8 bits
    By MikeTamu in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 2nd September 2005, 15:13
  5. Trouble setting config. bits
    By jswayze in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th March 2004, 23:22

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts