• AVR Freaks

Hot!Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO)

Author
Pandem
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2015/04/11 02:33:35
  • Location: 0
  • Status: offline
2020/10/20 21:35:31 (permalink)
0

Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO)

Hello All,
IDE version = 5.40 XC8 version = 2.40
I seem to be unable to change the FOSC setting to any internal oscillator setting using a PRAGMA setting. This occurs on PIC12F683, PIC16F88 and PIC16F628A PICs.
All the PICs do function when set to FOSC = HS or XT. I have recovered some previously some years back PIC12F683 and PIC16F628A and they were programmed for to FOSC = INTOSCIO and they were functioning just fine however as a test I switched them to XT and now I cannot get them back to INTOSCIO.
The test code is  from another case in the forum and does function when switched to XT or HS but not INTOSCIO
 
 
void main(void)
{
  OSCCON = 0x71; // switch to 8MHz system clock
  GPIO = 0x00;
  ANSEL = 0x00;
  TRISIO = 0x00;
  ADCON0 = 0x00;
  CMCON0 = 0x0;
while(1)
    {
        GP0 = 0b0;
__delay_ms(100); // wait 500 milliseconds GP0 = 0b1;
        GP1 = 0b1;
       __delay_ms(100); // wait 500 milliseconds
    }
}
 
 
#1

8 Replies Related Threads

    ric
    Super Member
    • Total Posts : 28993
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/20 21:59:52 (permalink)
    0
    It's not clear how you are trying to control the clock, as you don't show any #pragma lines in your source.
    What exactly are you doing to test this?
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #2
    Pandem
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2015/04/11 02:33:35
    • Location: 0
    • Status: offline
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/21 00:23:00 (permalink)
    0
    Hi Ric, I trying to configure the PIC for the internal 8Hhz oscillator

    // PIC12F683 Configuration Bit Settings
    // 'C' source line config statements
    // CONFIG
    #pragma config FOSC = INTOSCIO  // Oscillator Selection bits (INTOSCIO oscillator: I/O function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN)
    #pragma config WDTE = OFF       // Watchdog Timer Enable bit (WDT disabled)
    #pragma config PWRTE = OFF      // Power-up Timer Enable bit (PWRT disabled)
    #pragma config MCLRE = ON       // MCLR Pin Function Select bit (MCLR pin function is MCLR)
    #pragma config CP = OFF         // Code Protection bit (Program memory code protection is disabled)
    #pragma config CPD = OFF        // Data Code Protection bit (Data memory code protection is disabled)
    #pragma config BOREN = ON       // Brown Out Detect (BOR enabled)
    #pragma config IESO = ON        // Internal External Switchover bit (Internal External Switchover mode is enabled)
    #pragma config FCMEN = ON       // Fail-Safe Clock Monitor Enabled bit (Fail-Safe Clock Monitor is enabled)
    // #pragma config statements should precede project file includes.
    // Use project enums instead of #define for ON and OFF.
    #include <xc.h>

    When I attempt to program the PIC I get this error message:
    system.c:26:: error: (1389) attempt to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO)
    (908) exit status = 1
    system.c Line 26 ----> #pragma config FOSC = INTOSCCLK // Oscillator Selection bits (INTOSC oscillator: CLKOUT function on RA4/OSC2/CLKOUT pin, I/O function on RA5/OSC1/CLKIN)
     
    If you notice the compiler reports that it is configured for INTOSCIO already. For testing I don't care if it is INTOSCCLK or INTOSCIO just as long as it programs and functions. BTW I want to be INTOSCIO.
    #3
    ric
    Super Member
    • Total Posts : 28993
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/21 00:59:06 (permalink)
    -1 (1)
    How are you programming the PIC?

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #4
    Pandem
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2015/04/11 02:33:35
    • Location: 0
    • Status: offline
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/21 01:02:10 (permalink)
    0
    PICKIT4 (and I have used PICKIT3 in case)
    #5
    ric
    Super Member
    • Total Posts : 28993
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/21 01:06:16 (permalink)
    +1 (1)
    Ok. My next guess is you have the config setting in two different places, and only get an error when they differ. The error says this one is in system.c. could there be another in a separate c file?

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #6
    Pandem
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2015/04/11 02:33:35
    • Location: 0
    • Status: offline
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/21 02:49:18 (permalink)
    0
    Hi Ric,
    Good suggestion and that was the problem. Seems in my haste I copied a previous test  program in to my existing working directory and I then had two configurations. I then used the same files and tested it with two other PICs.
    When you asked your last question I knew what the problem was......
    Thanks again.
    #7
    Pandem
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2015/04/11 02:33:35
    • Location: 0
    • Status: offline
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/22 20:21:09 (permalink)
    0
    Hi Ric, I have found another issue that may have and very likely compounded my problem. There is a note on the PICKIT4 - https://www.microchip.com/forums/m1134289.aspx. It suggests that on older PICs insert a 100ohm resister into the nMCLR line. I have only had the PICKIT4 for a few months and manly been using it on PIC18K2520 and PIC18F46K22 without a problem. Now I was using older PICs for testing and now looks like I have several LBTs that don't work anymore.
    Thanks for your help.
    #8
    Pandem
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2015/04/11 02:33:35
    • Location: 0
    • Status: offline
    Re: Unable to reprogram configuration setting "FOSC" with INTOSCCLK (is INTOSCIO) 2020/10/22 20:49:50 (permalink)
    +1 (1)

    14.4.2  PIC10F and PIC16XXX Devices

    Possible damage may occur when attempting to program the PIC16xxx devices with the MPLAB ICD 4 or MPLAB PICkit 4. Add a 100-ohm resistor in series on VPP before attempting to program the part with this tool. This part is not recommended for new designs. Devices include:
    PIC10F family
    PIC16(L)F628
    PIC16(L)F627
    PIC16(L)F84A
    PIC16(L)F870/871/872/873/874/876/877
    PIC16F7x/PIC16LF7x
    Refer to the Silicon Errata Links:
    http://ww1.microchip.com/downloads/en/DeviceDoc/40300C.pdf under Electrical Specifications section
    Timer1 Module Data Sheet Errata.pdf
    PIC16F627A/628A/648A Rev. A Silicon/Data Sheet Errata.pdf
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5