View previous topic :: View next topic |
Author |
Message |
Guest
|
Why write_configuration_memory doesn't work? |
Posted: Wed Sep 14, 2005 6:02 pm |
|
|
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
|
|
Posted: Wed Sep 14, 2005 6:15 pm |
|
|
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
|
|
Posted: Thu Sep 15, 2005 8:13 am |
|
|
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
|
|
Posted: Thu Sep 15, 2005 8:40 am |
|
|
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
|
|
Posted: Thu Sep 15, 2005 8:45 am |
|
|
After this instruction is executed, i power off and on again but nothing changes. So strange |
|
|
Ttelmah Guest
|
|
Posted: Thu Sep 15, 2005 10:20 am |
|
|
You haven't answered the question from the other poster. What chip?.
Best Wishes |
|
|
erothias
Joined: 15 Sep 2005 Posts: 3
|
|
Posted: Thu Sep 15, 2005 10:43 am |
|
|
oh,sorry
It is 18f4550 |
|
|
Ttelmah Guest
|
|
Posted: Thu Sep 15, 2005 2:40 pm |
|
|
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
|
|
Posted: Thu Sep 15, 2005 5:01 pm |
|
|
Thank you so much, but I still have the same problem. I set the fuse as NOWRTC but it's no good. Really funny |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Sep 15, 2005 5:43 pm |
|
|
Tell us exactly what you want to do. What specific Configuration Bits
do you want to change, and why ? |
|
|
|