View previous topic :: View next topic |
Author |
Message |
Andreas
Joined: 25 Oct 2004 Posts: 136
|
PI18F8720 EEPROM |
Posted: Wed Mar 23, 2005 10:53 am |
|
|
Hi Friends,
I like to write to the internal EEPROM and getting no success
I am using the write_eeprom(adr,data) instruction but nothing changes
in the EEPROM Watch Window
To I have to set some specific Parameters to allow to write to EEPROM ?
all suggestions are very welcome
best regards
Andreas |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Mar 23, 2005 1:53 pm |
|
|
Quote: |
I am using the write_eeprom(adr,data) instruction but nothing changes
in the EEPROM Watch Window.
To I have to set some specific Parameters to allow to write to EEPROM ? |
1. Make you don't have WRTD and CPD in your #fuses statement.
WRTD will "write protect" the data eeprom, and CPD will "code protect" it.
2. The problem could be in the CCS functions or it could be in the MPLAB
simulator. You can check if the problem is caused by the CCS
functions by using the sample code in data sheet instead.
Look in section 7.3 for ASM code to read the data eeprom, and look
in section 7.4 for code to write it. |
|
|
Guest
|
|
Posted: Wed Mar 23, 2005 2:04 pm |
|
|
Hi PCM Programmer,
I checked the fuses , all okay !
Thats the code I am using, very simple !?
PCWH 3.219
CCS IDE
I cant see any changes in the EEPROM Watch window ?
Code: |
for (cnt2 = 0; cnt2 < 20; cnt2++)
{
write_eeprom(cnt2,0xAA);
}
best regards
Andreas
|
|
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Mar 23, 2005 2:49 pm |
|
|
You have to read the eeprom data back from the device to update the watch window. |
|
|
Andreas
Joined: 25 Oct 2004 Posts: 136
|
|
Posted: Wed Mar 23, 2005 2:54 pm |
|
|
Mark,
I thought that with autorefresh this is handled automatic.
But anyway, for some curious reason the program is now working
as it should, unfortunatly I have no idea why !!!
Thanks to all for the hints
best regards
Andreas |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|