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 CCS Technical Support

EEPROM Erased when clearing an EEPROM cell bit?

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



Joined: 09 Feb 2009
Posts: 12

View user's profile Send private message

EEPROM Erased when clearing an EEPROM cell bit?
PostPosted: Tue Apr 28, 2009 12:12 pm     Reply with quote

The data sheet for the 16F688 states,"A byte write automatically erases the location and writes the new data (erase before write)."

When most EEPROMs are erased, the memory is set to 0xFF. Writing to the EEPROM clears the required bits. If you wanted to change an EEPROM byte from 0x7F to 0x77, you wouldn't need to "erase" the byte, just clear bit 3 of the eeprom cell.

Is a complete erase done even when the write only requires clearing set bits in the eeprom?
_________________
Calvin
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Tue Apr 28, 2009 12:18 pm     Reply with quote

for the data sheet I'm looking at.. 18F4620
It shows a similar statement to your quote.
and a little above that it shows.
Quote:
The data EEPROM allows byte read and write

so the answer is no. Now perhaps there is no degradation of
eeprom cells in a bits that don't change,.. but that's a different question.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Apr 28, 2009 3:08 pm     Reply with quote

Quote:
Is a complete erase done even when the write only requires clearing set bits in the eeprom?

How do I know, that the light is out, when the refrigerator door is closed? You can't know, the same with the said EEPROM erase action, cause there is no separate erase command.
ckrusen



Joined: 09 Feb 2009
Posts: 12

View user's profile Send private message

PostPosted: Tue Apr 28, 2009 3:43 pm     Reply with quote

FvM wrote:
Quote:
Is a complete erase done even when the write only requires clearing set bits in the eeprom?

How do I know, that the light is out, when the refrigerator door is closed? You can't know, the same with the said EEPROM erase action, cause there is no separate erase command.


I didn't know if the micro tried to optimze the EEPROM write cycle.

After all, if I wanted to erase a small section of a blackboard, I wouldn't run an eraser over an entire blackboard, then rewrite the stuff I didn't want to erase.
_________________
Calvin
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Tue Apr 28, 2009 11:37 pm     Reply with quote

From a user perspective, your question won't get you anywhere, cause the erase action is hardwired to the write command. There is nothing you can influence.

I understand, that you want to know, what the device is actually doing, when you e.g. update a cell from 0x7f to 0x3f. As previously mentioned, it's difficult to know exactly (unless reverse engineering the chip). I expect a solution, that involves a minimum gate count, not optimizing anything without a serious need.

In other words, most likely the erase is always performed without considering the actual data. Besides achieving a lean design, there are probably additional technical reasons to do so, in a short assuring reliable operation in any case.

When looking at memory with separate accessable erase and program action, the question gets interesting - and also complicated. You'll find e.g. specifications, that allow not more than two consecutive program cycles of a byte cell after an erase, because not programming a bit apparently affects the memory somehow.
Ttelmah
Guest







PostPosted: Wed Apr 29, 2009 2:49 am     Reply with quote

If you look at latter chips like the PIC24's, these have a 'PGMONLY' bit that can be set, to perform a write without automatic erase. On the PIC16 chips, there is no choice. Interestingly though, the 'life' consequences are the same. The 'erase/write' cycle, is treated for endurance terms, as only one cycle of the memory, even if the value in an individual bit changes twice during this.

Best Wishes
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Wed Apr 29, 2009 3:46 am     Reply with quote

I think, it's difficult to conclude detailed properties from a few meagre datasheet lines. Actually, there are only four small PIC24FxxKA devices up to now, that are equipped with data EEPROM and the said feature. With all other PIC24 chips, EEPROM must be emulated in program flash.
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