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

How to set Configuration bits?!

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



Joined: 16 Oct 2010
Posts: 20

View user's profile Send private message

How to set Configuration bits?!
PostPosted: Fri Nov 26, 2010 10:59 am     Reply with quote

Hello
I am making a small project to write/read in/from external memory. I am using PIC16F877A.
The simulation on Proteus 7.7 is working very well but I get this error:

Code:
Configuration word bits CP(A) (bits 4-5, 0b00) and CP(B) (bits 12-13, 0b10) should be identical.


After searching, I found that I should set the configuration bits, CP1:CP0, to 0.
My question is how to do that? What is the code? how can I program these bits using CCS and using Assembly?

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Nov 26, 2010 5:33 pm     Reply with quote

The config bits are set with the #fuses statement. The allowable fuse
values are given at the top of the 16F877A.H file.

Look in the 16F877A data sheet, in the section on "Special Features of the
CPU". Then look in the Config bits section. It will show the bit layout of
the config word.

Then compile your program. Look at the end of the .LST file. It shows
the fuses, and it shows the Hex value of the config word. Compare this
config word to the bit layout given in the PIC data sheet. You can then
tell if CCS is setting the config bits the way you want. If not, look at the
allowable settings in the .H file and choose some different ones, that
might be better. Re-compile and check the .LST file again. Do this until
you get it right.
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