I use MPLABX + XC8 with Proteus to simulate PIC designs.

It usually works fine...but I recently tried to use a 12F683 part and I get an MPLABX message "ERROR writing to CONFIG_MEM".

I think the problem is this: MPLABX creates a configuration word of 0xFF94 (for my desired operation) which it writes to the processor program memory at address 2007. But for some reason the Proteus 12F683 model won't allow any values above 0x3FFF for its configuration word.

I can't find any meaning for the high bits of the 12F683 configuration word in the Microchip docs, and 0x3F94 works with the Proteus model when not simulating through MPLABX.

So I'm asking one of two things:

  1. Has anybody figured out how to use MPLABX + Proteus to simulate a PIC 12F683 (or 12F675 or 12F1840, which have the same problem); OR...
  2. Does anybody know the correct pragma or instruction to have my program code write "0x3F94" to program memory location "2007" instead of the "0xFF94" that MPLABX writes using its #pragma config directives?

1 Answer 1


XC8 has a .cfgdata file for each MCU, which tells it how to format the config bits. Open the file 12f683.cfgdata in folder <xc8 path>\dat\cfgdata. You should find this:-


Change the third parameter ('default value') from FFFF to 3FFF, and save the file. Clean and recompile your program and you should find the config word is now no larger than 0x3FFF.

  • \$\begingroup\$ Thanks for the great info tidbit. I can't imagine how I'd ever figure that out on my own. Problem solved. \$\endgroup\$
    – ChicoDaMan
    Commented Sep 9, 2017 at 6:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.