Config Error message


Closed Thread
Results 1 to 5 of 5
  1. #1
    sinoteq's Avatar
    sinoteq Guest

    Default Config Error message

    I started to use a new MCU today 18F46J11 and of course I expect new problems. But I did not expect the DEFINE OSC 4 standard line to kill me. It did! I can not compile with any OSC setting IF I also set the configuration bits in the code. I do not understand why this does not work. I am on MPLAB v8.50 using PBP2.60a (yes I patched yesterday)

    This works except I do not the config settings right
    Code:
    ASM
    	CONFIG WDTEN = OFF         ; Watchdog Disabled - Controlled by SWDTEN bit
    	CONFIG STVREN = OFF        ; Stack Overflow/Underflow Reset Disabled
    	CONFIG XINST = OFF         ; Extended Instruction Set Disabled
    	CONFIG CP0 = ON            ; Program memory is code-protected
    ;	CONFIG OSC = INTOSCPLL     ; Oscillator INTOSCPLL
    	CONFIG T1DIG = OFF         ; Secondary Oscillator clock source may not be selected T1OSCEN Enforcement
    	CONFIG LPT1OSC = ON        ; Low-power operation Low-Power Timer1 Oscillator 
    	CONFIG FCMEN = OFF         ; Disabled Fail-Safe Clock Monitor
    	CONFIG IESO = OFF          ; Disabled Internal External Oscillator Switch Over Mode 
    	CONFIG WDTPS = 1           ; 1:1 Watchdog Postscaler  
    	CONFIG DSWDTOSC = T1OSCREF ; DSWDT uses T1OSC/T1CKIDSWDT Clock Select
    	CONFIG RTCOSC = INTOSCREF  ; RTCC uses INTRCRTCC Clock Select
    	CONFIG DSBOREN = OFF       ; DisabledDeep Sleep BOR
    	CONFIG DSWDTEN = OFF       ; DisabledDeep Sleep Watchdog Timer
    	CONFIG DSWDTPS = 2         ; 1:2 (2.1 ms) Deep Sleep Watchdog Postscaler
    	CONFIG IOL1WAY = OFF       ; The IOLOCK bit (PPSCON<0>) can be set and cleared as needed IOLOCK One-Way Set Enable bit
    	CONFIG MSSP7B_EN = MSK5    ; 5 Bit address masking modeMSSP address masking
    	CONFIG WPFP = PAGE_0       ; Write Protect Program Flash Page 0Write/Erase Protect Page Start/End Location
    	CONFIG WPEND = PAGE_WPFP   ; Pages WPFP<5:0> to (Configuration Words page) write/erase protected   Write/Erase Protect Region Select bit (valid when WPDIS = 0)
    	CONFIG WPCFG = ON          ; Configuration Words page erase/write-protected Write/Erase Protect Configuration Region
    	CONFIG WPDIS = OFF         ; WPFP[5:0], WPEND, and WPCFG bits ignoredWrite Protect Disable bit
    	ENDASM
    
    
    
    
    				OSCCON=%11101000
    				OSCTUNE.6=1
    				DEFINE OSC 4
    This does not work
    Code:
    ASM
    	CONFIG WDTEN = OFF         ; Watchdog Disabled - Controlled by SWDTEN bit
    	CONFIG STVREN = OFF        ; Stack Overflow/Underflow Reset Disabled
    	CONFIG XINST = OFF         ; Extended Instruction Set Disabled
    	CONFIG CP0 = ON            ; Program memory is code-protected
    	CONFIG OSC = INTOSCPLL     ; Oscillator INTOSCPLL
    	CONFIG T1DIG = OFF         ; Secondary Oscillator clock source may not be selected T1OSCEN Enforcement
    	CONFIG LPT1OSC = ON        ; Low-power operation Low-Power Timer1 Oscillator 
    	CONFIG FCMEN = OFF         ; Disabled Fail-Safe Clock Monitor
    	CONFIG IESO = OFF          ; Disabled Internal External Oscillator Switch Over Mode 
    	CONFIG WDTPS = 1           ; 1:1 Watchdog Postscaler  
    	CONFIG DSWDTOSC = T1OSCREF ; DSWDT uses T1OSC/T1CKIDSWDT Clock Select
    	CONFIG RTCOSC = INTOSCREF  ; RTCC uses INTRCRTCC Clock Select
    	CONFIG DSBOREN = OFF       ; DisabledDeep Sleep BOR
    	CONFIG DSWDTEN = OFF       ; DisabledDeep Sleep Watchdog Timer
    	CONFIG DSWDTPS = 2         ; 1:2 (2.1 ms) Deep Sleep Watchdog Postscaler
    	CONFIG IOL1WAY = OFF       ; The IOLOCK bit (PPSCON<0>) can be set and cleared as needed IOLOCK One-Way Set Enable bit
    	CONFIG MSSP7B_EN = MSK5    ; 5 Bit address masking modeMSSP address masking
    	CONFIG WPFP = PAGE_0       ; Write Protect Program Flash Page 0Write/Erase Protect Page Start/End Location
    	CONFIG WPEND = PAGE_WPFP   ; Pages WPFP<5:0> to (Configuration Words page) write/erase protected   Write/Erase Protect Region Select bit (valid when WPDIS = 0)
    	CONFIG WPCFG = ON          ; Configuration Words page erase/write-protected Write/Erase Protect Configuration Region
    	CONFIG WPDIS = OFF         ; WPFP[5:0], WPEND, and WPCFG bits ignoredWrite Protect Disable bit
    	ENDASM
    
    
    
    
    				OSCCON=%11101000
    				OSCTUNE.6=1
    				DEFINE OSC 4
    Attached Images Attached Images  

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    There is a long explanation about it in general here: http://www.picbasic.co.uk/forum/showthread.php?t=543

    But if you look at the last couple posts, you will see some talk about what you describe.

    The newer chips use OSC in their .inc file, so when you say OSC = 4, it sort of breaks things. (If you really want OSC = 4, just leave that out, and it will default to 4mhz).

    Take a look at the PIC18F46j11.inc file, and you will see:
    Code:
    ;   Oscillator:
    ;     OSC = INTOSC         INTOSC
    ;     OSC = INTOSCO        INTOSCO (CLKO-RA6)
    ;     OSC = INTOSCPLL      INTOSCPLL
    ;     OSC = INTOSCPLLO     INTOSCPLLO (CLKO-RA6)
    ;     OSC = HS             HS
    ;     OSC = HSPLL          HS+PLL
    ;     OSC = EC             EC (CLKO-RA6)
    ;     OSC = ECPLL          EC+PLL (CLKO-RA6)
    One way around it is Bruce's suggestion. I have tried it, and it works. However, it will break other include files that use the OSC setting to set timer speeds, etc. But if you rename your modified code, you can always change it back.

    I see this as Microchips problem of changing things on the fly. They seem to make it hard for their 3rd party vendors to try to keep up. In this case, it seems difficult for MeLabs to come up with a perfect solution, but we will see.
    Last edited by ScaleRobotics; - 12th July 2010 at 05:58.

  3. #3
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default

    I see this as Microchips problem of changing things on the fly. They seem to make it hard for their 3rd party vendors to try to keep up. In this case, it seems difficult for MeLabs to come up with a perfect solution, but we will see.
    So OSC is now a Microchip reserved word as well as a PBP reserved word? And how smart is that on a scale from 1 to minus something really big? I can not use the default setting of 4MHz I want faster.... and I want a standard installation of both MPLAB and PBP because of future upgrades... and I want config fuses set in the code.

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default "You can't always get what you want" - Rolling Stones

    Quote Originally Posted by sinoteq View Post
    I can not use the default setting of 4MHz I want faster.... and I want a standard installation of both MPLAB and PBP because of future upgrades... and I want config fuses set in the code.
    Me too! But it looks like we can't have it all.

    Just give up one must-have, and you will be good , or you might have to wait for PBP 2.70.

    =4 mhz = good
    configs in PBP inc file = good
    edit pbp PBPPIC18.LIB file = good
    Last edited by ScaleRobotics; - 12th July 2010 at 06:59.

  5. #5
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Me too! But it looks like we can't have it all.
    Maybe but these are things that makes PBP less fun to work with, already I can not use a standard combination with PBP and MPLAB just because the default directories are different in Windows with different regional settings. To pach from 2.60 to 2.60a I must re-install PBP because the .BAT file is different from the CD's. This of course also removes all other "specials" that I have made to make PBP work as I like it. I do understand the compexity in making PBP and the hard work put into it but if things like this exists what else is "broken"?

    What is the difference between Jurasic Park and PBP?
    One is a movie, the other is an adventure park

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