Stop eeprom from Writing if data is available on the chip?

Hello sense i lack the coding skills to figure this help i was wondering if there is a way to stop writing to a External eeprom chip if data is available on the chip to put a stop in the sketch so it can't be written over top of what is there? i need someone help to develop this idea can someone please help me out? thank you

Hello,

There is always data on the chip, even when empty: when a cell is not written, its value will be 0xFF.

Generally if you read from an address that hasn't been written to yet, it will contain 255 (ff in hex) So you could just make sure that you NEVER write 255 to your eeprom and then before you write to it, make sure that it currently holds 255.

ohh i didn't know that/ hmmmm good question.

hey Guix and Ken what i want to put is to write to itis.

Hello all my name is John Smith. // << first line.
my Home address is 19elm st //<Second line
trenton. ave 00000 //< third line
//<sicp this line for space
Phone number 000-000-0000//< fifth line

This is what i wont to write to it or maybe a little more who knows and then have it display to the Serial monitor.
After it writes all that had it so it can't be written over so that information there is locked in for good.

Is this related to / or the same as / the question in your other Thread where I have already tried to help?

You haven't answered my question about exactly what sort of EEPROM chip you want to use.

For the benefit of other readers of this Thread it seems that the OP is NOT talking about writing to the Arduino's internal EEPROM.

Please don't waste time with double posts.

...R

Yes I'm trying to do it 2 ways one in Visual basic or visual studios and the other in sketch so i keep it apart. but i did ask if can be done in sketch code too.

josephchrzempiec:
Yes I'm trying to do it 2 ways one in Visual basic or visual studios and the other in sketch so i keep it apart. but i did ask if can be done in sketch code too.

This makes no sense at two levels.
First I don't know what you mean by it. I asked questions in your other Thread that you had not answered last time I looked.
And second, it would be much easier if you dealt with all aspects of your project in a single Thread.

...R

Hello sorry let me rephrase thsi you are correct I'm trying to write some text in the eeprom chip. This chip is module 24AA256UID a 256k EEProm chip. i first wanted to see if i can somehow get it to same some text like letters numbers and speical characters somehow in a sketch. sense I'm not real good at coding is why i posted this. if somehow i can get it to save i would like to upgrade this to make a visual basic or visual studio application so i can write to the cheap instead ohaving to keep updating the Sketch all the time. But the more i thought about it the more i want to try something different to make it so one chip i can save something one time. Meaning write to it then once it save can't be rewritten again. and second chip to where i can write over it as many times as i can. I'm sorry my wife a little sick sorry for the late responce back.

josephchrzempiec:
This chip is module 24AA256UID a 256k EEProm chip.

It has taken a large number of fruitless posts to get to this important piece of information.

What is the chip connected to and can you provide a wiring diagram? A photo of a pencil drawing will be fine. It can't be programmed without being connected to something!

...R

I do not have a wiring disgram it is connected to I2C. i will do a drawing. mine is setup the same way no difference http://www.allbluesystem.com/arduino_i2c.jpg

That picture clearly shows the EEPROM connected to an Arduino. Yet in this post in your other Thread you gave me to understand that it is not connected to an Arduino. This is very frustrating.

Are you able to write data to the EEPROM and read it back so you can be sure it was written?

If you are, then all you need to do when you are finished uploading data is to write a certain number (any number you like) to a particular byte on the EEPROM and then write an Arduino program that will not write data to the chip if that number is in that location.

This is the exact same advice that I gave in Reply #1 in your other Thread.

...R

Okay let me explain a little more you are correct i want to make it removeable so like a docking station type of eeprom.
hardware is not a problem it's software that is my always problem. I'm good at hardware but not good at working or communicating what's on my mind. if i said things wrong I'm sorry having a learning disorder mix with add and adhd it's hard for me to put in words what i say a lot of times i have to use google to rethink my words and ask my family for help to say things so i can write them down better.

josephchrzempiec:
i want to make it removeable so like a docking station type of eeprom.

You have not said anything wrong. You have just been slow at giving us important information about your project. We cannot guess what you have in your mind or on your workbench.

First question - you have not told me whether you understand what I said about having a special byte to signify that the EEPROM has data on it?
There is not much point moving forward until you do.

There are two issues concerning a docking station ...
-- The hardware arrangmentts - which I assume you know how to do
-- The the devices you want to be able to dock with - I will call these the "hosts"

Two more questions
Are the hosts all owned and controlled by you?
Is the software on the hosts written by you?

...R

josephchrzempiec:
hey Guix and Ken what i want to put is to write to itis.

Hello all my name is John Smith. // << first line.
my Home address is 19elm st //<Second line
trenton. ave 00000 //< third line
//<sicp this line for space
Phone number 000-000-0000//< fifth line

This is what i wont to write to it or maybe a little more who knows and then have it display to the Serial monitor.
After it writes all that had it so it can't be written over so that information there is locked in for good.

It sounds like you want to write the information to the EEPROM as a security measure in a way that does not allow it to be changed by any means. Is that right ?

Hello Robin Let me try to explain as best as i can this project is for me. maybe later down the road i want to make a program for this but for now will stick with what i got. Hardware for now it's just all breadboard not sure if going to make it removeable or not still deciding on that part. i have 3 chips a 256k, 512k, and a 1mb chip. how they work or bytes and whatnot i do not understand i never learned that part yet. What i would like to do is a blackbook this is for me like names places, birthdays , times and dates as well so some of my thoughts in it. not sure how many Characters long or spacing or Special characters is needed whatever i can fill up within the chat.

Not sure what special byte to signify means? the docking station part is still undecided as of yet everything is on breadboard for now. yes this will be on my computer always. as far as software or coding I'm sorry i can not code that is my problem. I tried so many times to learn to code and is upsets me a lot trying to remember all this stuff even little at a time over time it's still hard for me. Anything else can ask me if i can answer best i can thank you.

Hello Helibob thanks for the reply. I was thinking of some kind of security but as i thought about it the more or less thing is only i use this computer no one else does unless it's my wife searching for stuff online. So i think as this point it's not really a security problem or something i need to add right now maybe down the road. Just for right now trying to save some words and keep adding more would be great.

At first i did want to just write once to it. But as of last night i thought that would not be a good idea incase i would like to add more in time so i through that idea of just writting to it once out the window.

Here is the outline of an idea for you to think about.

The EEPROM will start with every byte set to FF (in Hexadecimal) (255 in decimal) so to write a new entry you could read the EEPROM until you find a location set to FF and you know that it will not have been previously written to. Having found the first available previously unused address in the EEPROM write your data to it in successive locations. Then next time do the same thing the next entry will be placed after the previous one.

NOTE: This does not mean that a program could not write to any location in the EEPROM if it was was written to ignore the current value of the EEPROM being written to.

Helibob that is actually a good idea to make the entry i would like to write then save it. If i want to write more maybe needs to find a way to check to see if something is there and pick up where it's left off in a new line. kind of like when writting to a paper that is cool. and is there a way i can delete some stuff if needed i guess i can delete it from the sketch and save and upload the latest information? Which brings me back to my old problem not able to code this to make it work. i have a same sketch below i attacked in zip. That i found online that i can right a 1 to 255 and shows up in the serial monitor to read it from the eeprom chip but not sure what it actually does other then put in single numbers.

externaleeprom.zip (457 Bytes)