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

PI18F8720 EEPROM

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



Joined: 25 Oct 2004
Posts: 136

View user's profile Send private message

PI18F8720 EEPROM
PostPosted: Wed Mar 23, 2005 10:53 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 23, 2005 1:53 pm     Reply with quote

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








PostPosted: Wed Mar 23, 2005 2:04 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Mar 23, 2005 2:49 pm     Reply with quote

You have to read the eeprom data back from the device to update the watch window.
Andreas



Joined: 25 Oct 2004
Posts: 136

View user's profile Send private message

PostPosted: Wed Mar 23, 2005 2:54 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Mar 23, 2005 2:58 pm     Reply with quote

I couldn't make it work in Single Step mode with the simulator,
but if I press "Run", then it shows AA AA AA, etc. in the EEPROM
window.

This is mentioned in a thread on the Microchip forum.
http://forum.microchip.com/tm.asp?m=80900&mpage=1&key=eeprom%2Csimulate&anchor#81132
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