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 support@ccsinfo.com

Why write_configuration_memory doesn't work?

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








Why write_configuration_memory doesn't work?
PostPosted: Wed Sep 14, 2005 6:02 pm     Reply with quote

Hi,

I tried the function write_configuration_memory() and it does not change the contents of config bits. Can anyone help?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Sep 14, 2005 6:15 pm     Reply with quote

Quote:
I tried the function write_configuration_memory() and it does not change the contents of config bits. Can anyone help?


This function is described in the README.TXT file in c:\Program Files\Picc

Post the line of code in which you call this function so we can see the
parameters that you're using.

Also post the version of your compiler, and the PIC you are using.
Guest








PostPosted: Thu Sep 15, 2005 8:13 am     Reply with quote

Here is the code I use:

int addr[14];

addr[0]=0x20;
addr[1]=0x0F;
addr[2]=0x3F;
addr[3]=0x1E;
addr[4]=0x00;
addr[5]=0x83;
addr[6]=0x81;
addr[7]=0x00;
addr[8]=0x0F;
addr[9]=0xC0;
addr[10]=0x0F;
addr[11]=0xE0;
addr[12]=0x0F;
addr[13]=0x40;
write_configuration_memory(addr,14);

Compiler version:3.227 PCWH
Ttelmah
Guest







PostPosted: Thu Sep 15, 2005 8:40 am     Reply with quote

Are you sure the bytes are not changing?. The contents of this memory, are only read on reset, so if (for instance), you change the clock configuration, it won't apply till the chip is powered off, and on again.
Also any of the 'protection' bits cannot be cleared by writing. These can only be cleared by a full chip erase.

Best Wishes
erothias



Joined: 15 Sep 2005
Posts: 3

View user's profile Send private message

PostPosted: Thu Sep 15, 2005 8:45 am     Reply with quote

After this instruction is executed, i power off and on again but nothing changes. So strange Sad
Ttelmah
Guest







PostPosted: Thu Sep 15, 2005 10:20 am     Reply with quote

You haven't answered the question from the other poster. What chip?.

Best Wishes
erothias



Joined: 15 Sep 2005
Posts: 3

View user's profile Send private message

PostPosted: Thu Sep 15, 2005 10:43 am     Reply with quote

oh,sorry

It is 18f4550
Ttelmah
Guest







PostPosted: Thu Sep 15, 2005 2:40 pm     Reply with quote

The 'obvious' possibility then, is that something has left bit 5 of address 30000B set. If this is done, the configuration registers will be write protected, and this can only be cleared in 'program' mode, not from the code itself.

Best Wishes
erothias



Joined: 15 Sep 2005
Posts: 3

View user's profile Send private message

PostPosted: Thu Sep 15, 2005 5:01 pm     Reply with quote

Thank you so much, but I still have the same problem. I set the fuse as NOWRTC but it's no good. Really funny Confused
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 15, 2005 5:43 pm     Reply with quote

Tell us exactly what you want to do. What specific Configuration Bits
do you want to change, and why ?
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