CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PIC12F629 Config bits change when I compile, why??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
BrokenRotor



Joined: 28 Mar 2012
Posts: 5
Location: Minnesota

View user's profile Send private message

PIC12F629 Config bits change when I compile, why??
PostPosted: Sun Oct 21, 2012 8:45 am     Reply with quote

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. Mad

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

View user's profile Send private message

PostPosted: Sun Oct 21, 2012 2:19 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Oct 21, 2012 9:51 pm     Reply with quote

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 Embarassed . 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

View user's profile Send private message

PostPosted: Mon Oct 22, 2012 4:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 22, 2012 4:42 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Oct 22, 2012 2:41 pm     Reply with quote

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 Laughing
_________________
Never give up, just keep throwing more money at it..
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group