• AVR Freaks

Hot!Configuration bits?

Author
ThomasTH
New Member
  • Total Posts : 9
  • Reward points : 0
  • Joined: 2019/05/21 05:02:14
  • Location: 0
  • Status: offline
2019/05/22 04:57:11 (permalink)
0

Configuration bits?

Good morning everyone, 
 
I am very new to all of this and have been tasked by my boss to complete a certain project for a test fixture. I am experiencing problems with the program functioning, however, the same source code works on his computer but not on mine. If I try to build I also get the note : Configuration Bits: address 0x2ABFC: PLL_96MHZ = 1 does not match any valid value in the device database.
So far, he is not positive where to direct me to correct this particular program. It is his belief there is a difference between our software setup/ hardware. I was hoping someone with more experience could give me a little more direction.
 
Win10
IDE v4.20
XC16 v1.36
 
These are also common on his setup.
#1

14 Replies Related Threads

    Aussie Susan
    Super Member
    • Total Posts : 3559
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: Configuration bits? 2019/05/22 19:07:23 (permalink)
    +2 (2)
    What is the full name of the device you are using?
    Have you set the IDE up to refer to the same device?
    Can you show us the config settings in your code (they probably are series of #pragma directives in one of the source files)?
    Just guessing here but it looks like you could be compiling the code for a device that tries to turn on an internal 96MHz PLL where the actual device does not have that capability.
    #2
    ThomasTH
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/05/21 05:02:14
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/05/23 06:51:23 (permalink)
    0
    // CONFIG3
    #pragma config WPFP = WPFP511 // Write Protection Flash Page Segment Boundary (Highest Page (same as page 170))
    #pragma config WPDIS = WPDIS // Segment Write Protection Disable bit (Segmented code protection disabled)
    #pragma config WPCFG = WPCFGDIS // Configuration Word Code Page Protection Select bit (Last page(at the top of program memory) and Flash configuration words are not protected)
    #pragma config WPEND = WPENDMEM // Segment Write Protection End Page Select bit (Write Protect from WPFP to the last page of memory)
    // CONFIG2
    #pragma config POSCMOD = XT // Primary Oscillator Select (XT oscillator mode selected)
    #pragma config DISUVREG = OFF // Internal USB 3.3V Regulator Disable bit (Regulator is disabled)
    #pragma config IOL1WAY = OFF // IOLOCK One-Way Set Enable bit (Unlimited Writes To RP Registers)
    #pragma config OSCIOFNC = OFF // Primary Oscillator Output Function (OSCO functions as CLKO (FOSC/2))
    #pragma config FCKSM = CSECMD // Clock Switching and Monitor (Clock switching is enabled, Fail-safe Clock Monitor is disabled)
    #pragma config FNOSC = PRIPLL // Oscillator Select (Primary oscillator (XT, HS, EC) with PLL module (XTPLL,HSPLL, ECPLL))
    // PLL_96MHZ = No Setting
    #pragma config PLLDIV = DIV4 // USB 96 MHz PLL Prescaler Select bits (Oscillator input divided by 4 (16MHz input))
    #pragma config IESO = OFF // Internal External Switch Over Mode (IESO mode (Two-speed start-up)disabled)
    // CONFIG1
    #pragma config WDTPS = PS32768 // Watchdog Timer Postscaler (1:32,768)
    #pragma config FWPSA = PR128 // WDT Prescaler (Prescaler ratio of 1:128)
    #pragma config WINDIS = OFF // Watchdog Timer Window (Standard Watchdog Timer enabled,(Windowed-mode is disabled))
    #pragma config FWDTEN = OFF // Watchdog Timer Enable (Watchdog Timer is disabled)
    #pragma config ICS = PGx2 // Comm Channel Select (Emulator functions are shared with PGEC2/PGED2)
    #pragma config GWRP = OFF // General Code Segment Write Protect (Writes to program memory are allowed)
    #pragma config GCP = OFF // General Code Segment Code Protect (Code protection is disabled)
    #pragma config JTAGEN = OFF // JTAG Port Enable (JTAG port is disabled)
    // #pragma config statements should precede project file includes.
    // Use project enums instead of #define for ON and OFF.
    #include <xc.h>
     
     
     PIC24FJ256GB106 Configuration Bit Settings - PICKIT 3
     
    I did not set anything up on this system.
    #3
    crennolet
    Super Member
    • Total Posts : 123
    • Reward points : 0
    • Joined: 2012/03/15 09:51:58
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/05/23 12:57:01 (permalink)
    0
    I'm using mplabx 5.15, and xc16 1.36. I created an empty project, generated the configuration bits, and used this:
     
    #pragma config PLL_96MHZ = ON // 96MHz PLL Disable (Enabled)
     
    --- and it compiles without a problem.
     
    #4
    ThomasTH
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/05/21 05:02:14
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/05/28 05:42:41 (permalink)
    0
    I suppose this is where my problem lies. Where/how do I add/edit this particular part?
    #5
    crennolet
    Super Member
    • Total Posts : 123
    • Reward points : 0
    • Joined: 2012/03/15 09:51:58
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/05/28 09:21:57 (permalink)
    +1 (1)
    If you open project properties you can change the part -- assuming that's your question. On the left, in the "project browser" pane, select the leftmost tab. Highlight the project. Then pull down the "file" menu and you'll see the "project properties." From there, look up and to the right in the dialog that pops up. It lists and allows you to edit the part.
     
    If, on the other hand, you are asking about setting configuration bits (???) then pull down the "window" menu and select "Target memory views", then "Configuration bits"
     
    Possibly spending some time with the datasheet and the "help" (button up and to the right) would be useful.
    #6
    ThomasTH
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/05/21 05:02:14
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/05/30 05:12:33 (permalink)
    0
    I did understand both of those in particular. I am not positive what I was hoping to gain from my last question. Was just confused how it works on your end but not on mine.
     
    Recently we have tried multiple projects created and transferred from my bosses computer to mine that worked on his but result in the same text as before on mine : Configuration Bits: address 0x2ABFC: PLL_96MHZ = 1 does not match any valid value in the device database
     
    We are using the same device. PIC24FJ256GB106
    #7
    Aussie Susan
    Super Member
    • Total Posts : 3559
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: Configuration bits? 2019/05/30 20:01:55 (permalink)
    0
    If you look in the data sheet for that MCU, in the "Special Features" section (26), it will list all of the configuration registers and their bits.
    Doing so, you will notice that there the option is called PLLDIS (as a general rule, the config names are the same as the bits in the config registers - but not always) so try that.
    Also make sure that the correct device is selected in the IDE. This is the device that the IDE will pass on to the compiler (you should be able to see the device name as an option being passed in the command line). If that is wrong then the compiler will be looking at the wrong information files and so not recognise the #pragma names and the some SFR names etc.
    Susan
    #8
    crennolet
    Super Member
    • Total Posts : 123
    • Reward points : 0
    • Joined: 2012/03/15 09:51:58
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/05/31 07:14:56 (permalink)
    +1 (1)
    So your various computers have exactly the same compilers?
     
    By the way, you'll notice that the configuration bits that mplabx generates have the form "PLL_96MH = ON", not "= 1". While that may be identical in most cases, since #pragma statements fall outside the scope of standard C, how do we know?
    #9
    ThomasTH
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/05/21 05:02:14
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/06/06 11:31:22 (permalink)
    0
    //Configuration Registers
    _CONFIG1( JTAGEN_OFF & GCP_OFF & GWRP_OFF & BKBUG_ON & ICS_PGx2 & FWDTEN_OFF & WINDIS_OFF & FWPSA_PR128 & WDTPS_PS32768)
    _CONFIG2( IESO_OFF & PLLDIV_DIV4 & FNOSC_PRIPLL & FCKSM_CSECMD & OSCIOFNC_OFF & IOL1WAY_OFF & DISUVREG_OFF & POSCMOD_XT)
    _CONFIG3( WPEND_WPENDMEM & WPCFG_WPCFGDIS & WPDIS_WPDIS & WPFP_WPFP511)
     
    Config bits are listing pll_96mhz as on also.
     
    I am not positive how when I click build, the message of "Configuration Bits: address 0x2ABFC: PLL_96MHZ = 1 does not match any valid value in the device database" is appearing. 
     
     
     
     
    Same compilers yes. both are 1.36 XC16
    #10
    crennolet
    Super Member
    • Total Posts : 123
    • Reward points : 0
    • Joined: 2012/03/15 09:51:58
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/06/06 14:26:35 (permalink)
    0
    Is this an ancient project? Because I haven't seen that form of "_CONFIGx" syntax in a long time.
    Where did those lines come from? They are quite different in form from the ones you posted above. Please note that, if you are using the form of configuration bits in that last comment, the form of these constants is like "0xff7f", not 0 or 1.
    #11
    ThomasTH
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/05/21 05:02:14
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/06/07 04:48:52 (permalink)
    0
    Sorry, the first comment posted with the registers of #pragma are due to generating the configuration bits. At the time I could not find where he had the registers. 
     
    The code itself is something he had created a year ago maybe? I merely changed a parameter to increase speed on the output device. The entire code works off his machine, just not mine. When compiled, that is where the "PLL_96MHZ = 1" shows up. I can not find any reason this is appearing. It does not show in the registers, nor in the config bits. At the moment it is my belief there is a setting difference between his machine and mine, or a problem with the install of my software somehow?
     
    The other program code I tested recently of his responds with the same "PLL_96MHZ = 1 " while it works on his machine also. I did not touch this particular program code other than importing into my projects.
    #12
    crennolet
    Super Member
    • Total Posts : 123
    • Reward points : 0
    • Joined: 2012/03/15 09:51:58
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/06/07 06:37:26 (permalink)
    0
    I've about run out of things to suggest. However, by the process of elimination, if the code in the project works on his machine but not yours, then obviously there must be something outside the project that is different. Problems like this can be caused by having header files included before the configuration lines, where things like "ON" and "OFF" are defined (although that presumably should generate at least a warning.)
     
    If I had the entire project on my machine and saw this problem I'd do as was suggested above: track down the header files that are included and try to see where the offending data is coming from. Best of luck. That's likely to be a bit of a snipe hunt.
    #13
    ThomasTH
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/05/21 05:02:14
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/06/07 08:38:58 (permalink)
    0
    I appreciate all of your help and suggestions. I shall continue to try and if I do find a solution, I can update this. Again, Thank you.
    #14
    ThomasTH
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2019/05/21 05:02:14
    • Location: 0
    • Status: offline
    Re: Configuration bits? 2019/06/10 04:51:07 (permalink)
    +1 (1)
    Turns out, IDE did not like the older syntax _Config1. Changed all of those over to #pragma and added in the 96mhz setting. Thanks again for the help.
     
    #15
    Jump to:
    © 2019 APG vNext Commercial Version 4.5