PDA

View Full Version : _config set change for pic12f683



nbrucew
- 18th March 2010, 17:15
Admit I am novice. Using MpLab IDE, PicBasic Pro, Pic12f683, pickit2 programmer. Need 5 I/O pins for project and trying to use GPIO.3 as input but need to set MCLRE off. So using __config directive as stated in www.melabs.com/support/config_defaults.htm

@__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF

Placed directive at start of Source program and my understanding is this would override any .inc header default cmds. Doesn't. Won't compile and recieve error massage

Error Unable to execute mpasmwin. Warning [205] c:\PBP|Buttoncmd.asm 94: Found directive in column 1. (__config)
Error [118] c:\PBP|Buttoncmd.asm 94: Overwriting previous address contects (2007)

Understand error 108 that my program is trying to write into address with default bit already set ... but I thougt assembly line _config directive should override. Not sure what warning [205] is saying.

Did homework in your FAQ and commented out _config in .inc header for the Pic12f683 MPASM assembler as suggested but made no difference.

Can overcome by switching to pic chip with more I/O ports so avoid pin with MCLRE and use general I/O pin set for input to allow for button. BUT really trying to understand what is going on. So any input or direction to iinput that could help would be appreciated.

mackrackit
- 18th March 2010, 17:52
Try adding a space
Not this...
@__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF

This...
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_OFF & _CP_OFF

nbrucew
- 19th March 2010, 23:30
Thanks, I place space between @ _config and that cleared up the warning [205] but the critical error [118] remains.

Error [118] c:\PBP\Buttoncmd.asm 94: overwriting prvious address contects (2007)

Apparently writing via _config directive doesn't override existing code at 2007h address. I have tried in vain to comment out existing config settings in .inc file but that also seems to not to help.

Any further help appreciated ... any other way to change configuration bit settings via MPLAB IDE v8.46 ...

Thanks for any help

Heckler
- 20th March 2010, 00:55
I too, am fairly new at this.

I also use the PICKIT2... You can change the configuration bits manually just before programming.

(now, this may not work with your existing work flow. If you are set up to compile and burn the chip you will need to figure out how to just compile and then manually load the .hex file in the pickit2 program window)

Then after you load the hex file BUT before you click the "write" button... look up and find the link labeled "Configuration". (just under the HELP dropdown) By clicking this link you can then change bit 5 from 1 to a 0 and then burn you chip. (you must do this each and every time you burn the chip. This way you have manual control of all the configuration bits (fuses) until you figure out how to include the correct statement in your program. (see page 84 of the 12F683 .pdf)

Hope this helps
Dwight

mackrackit
- 20th March 2010, 01:03
When setting the configs in program space you will need to open the PICs *.inc file in the PBP directory and comment out the config lines there.

This thread explains it
http://www.picbasic.co.uk/forum/showthread.php?t=543