View previous topic :: View next topic |
Author |
Message |
bharatwalia
Joined: 04 May 2009 Posts: 35 Location: India
|
how to write data onto program memory |
Posted: Mon Jul 19, 2010 9:32 am |
|
|
Hi,
I am using PIC16F876A for my project.
I want to write a value into program memory at compile time, then at run time I want to read that value and modify it and then again write it and so on.
Can anybody provide me with a small example to that I can implement the same.
Thanks. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19367
|
|
Posted: Mon Jul 19, 2010 9:45 am |
|
|
Use the forum search. This has been answered many times....
Be aware of the limitations:
1) When writing program memory, program execution stops.
2) The limited write life of the program memory.
http://www.ccsinfo.com/forum/viewtopic.php?t=38267
http://www.ccsinfo.com/forum/viewtopic.php?t=39402
For a couple of examples.
As a very sophisticated way of doing this, you can use Addressmod, but with a cost of code bulk.
If your chip has EEPROM, use this instead....
Best Wishes |
|
![](templates/subSilver/images/spacer.gif) |
bharatwalia
Joined: 04 May 2009 Posts: 35 Location: India
|
|
Posted: Mon Jul 19, 2010 10:53 am |
|
|
Is it possible to write data onto eeprom at compile time?
And then retrieve it during program execution. |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Jul 19, 2010 11:23 am |
|
|
Yes.
For code examples use the search function of this forum. Hint, search for '0x2100' (the EEPROM address in a PIC16). |
|
![](templates/subSilver/images/spacer.gif) |
bharatwalia
Joined: 04 May 2009 Posts: 35 Location: India
|
|
Posted: Mon Jul 19, 2010 12:56 pm |
|
|
Thanks!...
I got it working .... ![Laughing](images/smiles/icon_lol.gif) |
|
![](templates/subSilver/images/spacer.gif) |
|