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

Is possible to read, write bit by bit from internal EEPROM?

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



Joined: 21 Sep 2010
Posts: 159

View user's profile Send private message

Is possible to read, write bit by bit from internal EEPROM?
PostPosted: Mon Nov 13, 2023 2:09 pm     Reply with quote

Hy.
Can I read a single bit from EEPROM, or write without affect other bit's from the same addres? To wear less eeprom...

I'm refer bit like int1, (not byte, I already know).
dyeatman



Joined: 06 Sep 2003
Posts: 1912
Location: Norman, OK

View user's profile Send private message

PostPosted: Mon Nov 13, 2023 2:33 pm     Reply with quote

Maybe someone else has but I have never seen one.
All the ones I have seen are byte or word wide read/writes.
_________________
Google and Forum Search are some of your best tools!!!!
nailuy



Joined: 21 Sep 2010
Posts: 159

View user's profile Send private message

PostPosted: Mon Nov 13, 2023 10:09 pm     Reply with quote

dyeatman thank you for reply.
Before I post this question ... I search on google.
I find something but is applied to Arduino or other platform for developing.
If nobody know, mabe it isn't possible.
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Tue Nov 14, 2023 1:53 am     Reply with quote

One simple comment here.
There is no 'wear' on a read.
You can read from an EEPROM (internal or external), an infinite number
of times. Life is just the same as for RAM.
It is only _writes_ that use lives.

There is no 'bit read' operation on any memory of this type (except bit
orientated ones).
nailuy



Joined: 21 Sep 2010
Posts: 159

View user's profile Send private message

PostPosted: Tue Nov 14, 2023 5:35 am     Reply with quote

oky, thank you.
I do not find anithing...
I know the wite is distroing the eeprom device .
that I was asking special for single bit...

How to close the subject or solve?
temtronic



Joined: 01 Jul 2010
Posts: 9098
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Nov 14, 2023 6:13 am     Reply with quote

you can
edit your original subject line to say '......[solved] '
or
simply delete the post
asmallri



Joined: 12 Aug 2004
Posts: 1630
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Nov 14, 2023 7:12 am     Reply with quote

nailuy wrote:
oky, thank you.
I do not find anithing...
I know the wite is distroing the eeprom device .
that I was asking special for single bit...


There are a few things to consider, you may already have considered these...

If this is an external EEPROM then you can probably use a Pin-For-Pin compatible FRAM instead.

Before doing a write to EEPROM, copy the byte to RAM, if operating on the specific bit in RAM does not change the value i.e. you are writing a 1 to a location that is already a 1 then do not perform the write. Similarly if you are writing a zero to a location that is already a zero, do not perform the write.

Write you code such that you can do your own wear leveling. For example, place you target data structure at location X, then, at the start of some new point in time (like a week, a month or a year) move the entire block to location Y.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Tue Nov 14, 2023 7:54 am     Reply with quote

Andrew's point here is vital.
Read the current byte. Save a copy of this.
Do all the updates you want.
Then compare the updated byte with the copy. Only write if there is a
change.
Also if something is changing frequently, consider only actually 'writing'
this when the power is turned off. This way several changes may only result
in a single write to the EEPROM.
On the wear leveling, this is how the driver using the program memory
instead of EEPROM works, storing a value together with an 'address', and
moving forwards through the page of memory with these.
If your device has a genuine EEPROM, these now have very high lives.
Even the old 16F84 supported a million cycles on the EEPROM. Short
cycle lives only matter if you start to use this like RAM to hold values
that you change frequently. So if you are using a dynamic value only write
it if it remains stable for several minutes. Don't update it every few
seconds.
It really is down to how often you change the value. So (for example),
if you stored a 'counter' into the EEPROM as fast as possible, you could
kill a cell in about an hour. However write a value once an hour and the
EEPROM would last over a hundred years!....
temtronic



Joined: 01 Jul 2010
Posts: 9098
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Nov 15, 2023 6:40 pm     Reply with quote

The sad thing is I probably still have a few 1 bit microprocessors 'somewhere' in the basement. Motorola MC14500B, I think.
Those WOULD read 1 bit at a time, of the external memory....
great this dinosaur is feeling real old now....
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Thu Nov 16, 2023 8:31 am     Reply with quote

Yes.
It is interesting how many things had singe bit memories in the past.
Reason these have fallen massively out of favour is chip real estate.
On the EEPROM and flash memories, the erase and write are done using
much higher voltages than the normal operations. This high voltage is
what slowly kills the cells, but also needs rather large transistors to
handle these. To reduce the chip size they now only have one per
byte, or on the flash chips one per row.
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