Announcement

Collapse
No announcement yet.

Limit to #config / #endconfig length?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Limit to #config / #endconfig length?

    Getting my first real use of PBP3--new project, new microcontroller (18F2520).

    Not knowing any better I put every configuration directive in. I received back "[ERROR] myproj.pbp fatal (82) : Block overflow for #ENDCONFIG".

    Error remained even after remming several of the lines, as shown below

    Code:
    #config
        CONFIG OSC = HS		;HS oscillator
        CONFIG FCMEN = OFF		;Fail-Safe Clock Monitor disabled
        CONFIG IESO = OFF		;Oscillator Switchover mode disabled
        CONFIG PWRT = ON		;PWRT enabled
        CONFIG BOREN = ON		;Brown-out Reset enabled and controlled by software
        CONFIG BORV = 2		;BORV = ~2.79V
        CONFIG WDT = OFF		;WDT disabled (control is placed on the SWDTEN bit)
        CONFIG WDTPS = 32768	;WDT Post-scaler 1:32768
        CONFIG CCP2MX = PORTBE	;CCP2 input/output is multiplexed with RB3
        CONFIG PBADEN = OFF		;PORTB<4:0> pins are configured as dig I/O on Reset
        CONFIG LPT1OSC = OFF	;Timer1 configured for higher power operation
        CONFIG MCLRE = ON		;MCLR pin enabled; RE3 input pin disabled
        CONFIG STVREN = OFF		;Stack full/underflow will not cause Reset
        CONFIG LVP = OFF		;Single-Supply ICSP disabled
        CONFIG XINST = ON		;Instruction set extension and Indexed Addressing mode enabled
        CONFIG DEBUG = OFF		;Bkgd debugger disabled, RB6 & RB7 configured as GP I/O pins
        CONFIG CP0 = OFF		;Block 0 (000800-001FFFh) not code-protected
        CONFIG CP1 = OFF		;Block 1 (002000-003FFFh) not code-protected
        CONFIG CP2 = OFF		;Block 1 (002000-003FFFh) not code-protected
        CONFIG CP3 = OFF		;Block 1 (002000-003FFFh) not code-protected
        CONFIG CPB = OFF		;Boot block (000000-0007FFh) not code-protected
        CONFIG CPD = OFF		;Data EEPROM not code-protected
        CONFIG WRT0 = OFF		;Block 0 (000800-001FFFh) not write-protected
        CONFIG WRT1 = OFF		;Block 1 (002000-003FFFh) not write-protected
        CONFIG WRT2 = OFF		;Block 2 (004000-005FFFh) not write-protected
        CONFIG WRT3 = OFF		;Block 3 (006000-007FFFh) not write-protected
        CONFIG WRTC = OFF		;Configuration registers (300000-3000FFh) not write-protected
        CONFIG WRTB = OFF		;Boot block (000000-0007FFh) not write-protected
        CONFIG WRTD = OFF		;Data EEPROM not write-protected
    ;    CONFIG EBTR0 = OFF	;Block 0 not protected from table reads executed in other blocks
    ;    CONFIG EBTR1 = OFF	;Block 1 not protected from table reads executed in other blocks
    ;    CONFIG EBTR2 = OFF	;Block 2 not protected from table reads executed in other blocks
    ;    CONFIG EBTR3 = OFF	;Block 3 not protected from table reads executed in other blocks
    ;    CONFIG EBTRB = OFF	;Boot block not protected from table reads executed in other blocks
    #ENDCONFIG
    I discovered that actually reducing the number of lines would compile, as below:

    Code:
    #config
        CONFIG OSC = HS		;HS oscillator
        CONFIG FCMEN = OFF		;Fail-Safe Clock Monitor disabled
        CONFIG IESO = OFF		;Oscillator Switchover mode disabled
        CONFIG PWRT = ON		;PWRT enabled
        CONFIG BOREN = ON		;Brown-out Reset enabled and controlled by software
        CONFIG BORV = 2		;BORV = ~2.79V
        CONFIG WDT = OFF		;WDT disabled (control is placed on the SWDTEN bit)
        CONFIG WDTPS = 32768	;WDT Post-scaler 1:32768
        CONFIG CCP2MX = PORTBE	;CCP2 input/output is multiplexed with RB3
        CONFIG PBADEN = OFF		;PORTB<4:0> pins are configured as dig I/O on Reset
        CONFIG LPT1OSC = OFF	;Timer1 configured for higher power operation
        CONFIG MCLRE = ON		;MCLR pin enabled; RE3 input pin disabled
        CONFIG STVREN = OFF		;Stack full/underflow will not cause Reset
        CONFIG LVP = OFF		;Single-Supply ICSP disabled
        CONFIG XINST = ON		;Instruction set extension and Indexed Addressing mode enabled
        CONFIG DEBUG = OFF		;Bkgd debugger disabled, RB6 & RB7 configured as GP I/O pins
        CONFIG CP0 = OFF		;Block 0 (000800-001FFFh) not code-protected
        CONFIG CP1 = OFF		;Block 1 (002000-003FFFh) not code-protected
        CONFIG CP2 = OFF		;Block 1 (002000-003FFFh) not code-protected
        CONFIG CP3 = OFF		;Block 1 (002000-003FFFh) not code-protected
        CONFIG CPB = OFF		;Boot block (000000-0007FFh) not code-protected
        CONFIG CPD = OFF		;Data EEPROM not code-protected
        CONFIG WRT0 = OFF		;Block 0 (000800-001FFFh) not write-protected
        CONFIG WRT1 = OFF		;Block 1 (002000-003FFFh) not write-protected
        CONFIG WRT2 = OFF		;Block 2 (004000-005FFFh) not write-protected
        CONFIG WRT3 = OFF		;Block 3 (006000-007FFFh) not write-protected
        CONFIG WRTC = OFF		;Configuration registers (300000-3000FFh) not write-protected
        CONFIG WRTB = OFF		;Boot block (000000-0007FFh) not write-protected
        CONFIG WRTD = OFF		;Data EEPROM not write-protected
    #ENDCONFIG
    ;    CONFIG EBTR0 = OFF	;Block 0 not protected from table reads executed in other blocks
    ;    CONFIG EBTR1 = OFF	;Block 1 not protected from table reads executed in other blocks
    ;    CONFIG EBTR2 = OFF	;Block 2 not protected from table reads executed in other blocks
    ;    CONFIG EBTR3 = OFF	;Block 3 not protected from table reads executed in other blocks
    ;    CONFIG EBTRB = OFF	;Boot block not protected from table reads executed in other blocks
    So is there a limit to the number of lines that can appear in a #config/#endconfig block? Or put another way, is this a bug or a feature?

    Best Regards,
    Paul

  • #2
    Hi Paul,

    It's not so much the number of lines as it is the number of characters.
    This includes comments, spaces and tabs.
    The current limit appears to be 2K.

    I'm a big fan of commenting everything as much as possible, so I'll ask if anything can be done to increase the limit.
    I'll get back to you.

    In the mean time, if you reduce the length of the comments it should compile.
    PBP3 Manual : Microchip Datasheets - 10F, 12F, 16F, 18F
    Never download a PIC datasheet from anywhere but microchip.com

    Comment


    • #3
      Hello Darrel,

      Thanks for the reply. Makes sense.

      This is by no stretch of the imagination a big deal, but if I figured that if I run into it others will as well. It did stop my heart for just a second...

      Best Regards,
      Paul

      Comment


      • #4
        How do I obtain the complete list of configs to enter in the #CONFIG/#ENDCONFIG?

        If I want the MCLR pin to be an input, is this simple command correct?

        CONFIG MCLRE = OFF

        Thank you so far.

        Al.

        Comment


        • #5
          Hi Al,

          When you use the #config block, it overrides ALL default configuration settings.
          You then need to include ALL critical configuration bits in your #config block.

          In your PBP3 folder, there is a DEVICE_REFERENCE sub-folder.
          There is a .info file for each chip in that folder that shows all of the possible configuration settings.

          Any configuration bits that are not included in the #config block will assume the "Erased State" as shown in the datasheet. So if you don't know what the Erased State is, add the CONFIG line that applies to your project for each option.
          PBP3 Manual : Microchip Datasheets - 10F, 12F, 16F, 18F
          Never download a PIC datasheet from anywhere but microchip.com

          Comment

          Working...
          X