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

int EEPROM problems

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



Joined: 25 Apr 2007
Posts: 23

View user's profile Send private message

int EEPROM problems
PostPosted: Mon May 21, 2007 9:39 am     Reply with quote

Wow, this seems basic, but I can't see what's wrong.

I can't seem to write to internal EEPROM in my target 16F874A using the attached code segment. I've successfuly written to internal EEPROM using similar code in past projects. Here's the code:

//Store readibg just made into ext EEPROM=======================================

Store_Reading()
{
Int_EE_Adr =20;
Int_EE_Data =33;
write_eeprom (Int_EE_Adr , Int_EE_Data);
Delay_ms(100);
Int_EE_Data = 0;
Int_EE_Data = read_eeprom (Int_EE_Adr);
Delay_ms(100);
}

Both variables in the above code are defined globally as:

unsigned char Int_EE_Adr,Int_EE_Data; //address and data

The subroutine is called from the Main as:
Main()
(
while (1) //Loop forever
{
Store_Reading();
}
}

Wasted a couple of days on troubleshooting this. ANy help is appreciated!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon May 21, 2007 11:52 am     Reply with quote

Try the test program shown in this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=17590&start=1

If you've been testing internal eeprom in a loop for two days, and if
at some point you didn't have the 100 ms delays, you may have burned
up your internal eeprom (at least at certain addresses). There have
been threads on this. Here is one of them:
http://www.ccsinfo.com/forum/viewtopic.php?t=26937&highlight=eeprom+burned
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