View previous topic :: View next topic |
Author |
Message |
BrokenRotor
Joined: 28 Mar 2012 Posts: 5 Location: Minnesota
|
PIC12F629 Config bits change when I compile, why?? |
Posted: Sun Oct 21, 2012 8:45 am |
|
|
Hello guys, I need help.
I am using MPLAB and a command line compiler for the midrange mcu's. Problem is when I set the config bits using MPLAB, compile, then look at them, the osc function changes from intosc to rcosc and the mclr function changes as well.
So I tried to use the #fuse command but I cannot find a listing of what are valid names for the fuses.
If I try to program the chip then I get a warning about pickit3 cannot program intosc and int mclr. I am trying to use external mclr and intosc.
Can someone kick me in the right direction please.
Here's the section of code where I try setting this up.
Code: |
#include <12f629.h>
#fuses NOWDT,NOPROTECT,NOCPD,INTRC_IO,NOBROWNOUT, PUT //, NOMCLR
#use delay(internal=4000000)
|
Thank you.
Steve _________________ Never give up, just keep throwing more money at it.. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Sun Oct 21, 2012 2:19 pm |
|
|
Check the build options in MPLAB.
MPLAB _defaults_ in many versions to building for 'debug', not 'release'. Some fuses have specific values that have to be used for debug. On your chip (for instance), the MCLR pin is used by the debugger, hence the MCLR fuse can't be selected.
The list of valid fuse names is at the top of the include file for each processor.
Best Wishes |
|
|
BrokenRotor
Joined: 28 Mar 2012 Posts: 5 Location: Minnesota
|
|
Posted: Sun Oct 21, 2012 9:51 pm |
|
|
Ttelmah wrote: | The list of valid fuse names is at the top of the include file for each processor.
Best Wishes |
I tried switching to release mode, still seems to change the config setings. Somehow I am missing something. I will have to check again tomorrow when I'm more awake. Long day today.
Thanks for pointing out the fuse names were in front of my face . Man I can't believe I totally missed that. Guess I looked at the code so long I couldn't see anything. Now I see it plain as day. Thanks. _________________ Never give up, just keep throwing more money at it.. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Oct 22, 2012 4:32 am |
|
|
and as another little one that is often 'missed', in the compiler directory, there is a file called 'fuses.txt', which gives what the CCS names 'mean'. A useful look-up.
Best Wishes |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Oct 22, 2012 4:42 am |
|
|
Other comment, you need to have selected the Pickit3, as a _programmer_, not as a debugger, or it'll insist on programming in debug mode....
Best Wishes |
|
|
BrokenRotor
Joined: 28 Mar 2012 Posts: 5 Location: Minnesota
|
|
Posted: Mon Oct 22, 2012 2:41 pm |
|
|
Ttelmah wrote: | and as another little one that is often 'missed', in the compiler directory, there is a file called 'fuses.txt', which gives what the CCS names 'mean'. A useful look-up.
Best Wishes |
I have the command line compiler and I guess that file does not come with. At least I have not been able to find it.
I do have pickit3 selected as the programmer.
I'm sure it's something stupid I am missing, but man it's driving me crazy. Gonna leave it for a day and maybe it will fix itself _________________ Never give up, just keep throwing more money at it.. |
|
|
|