Pages: [1]   Go Down
Author Topic: EEPROM Chip resets when arduino is reset  (Read 1746 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am currently building and writing code for a data logger that reads 4 analog inputs, then stores this data on an external EEPROM chip (24L256), which can be read off of the chip at a later time. So the program works flawlessly until i reset the power. Once the power is reset, the read data command gives nothing, suggesting that the data has been erased in the power off. I think there is something wrong with how I have set up the eeprom chip, but I'm not sure what.

The code and circuit diagrams I designed are at the following link.
http://truweatherballoon.blogspot.com

Thanks in advance for the help.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8933
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Your circuit diagram shows no connection to the Vcc pin of the 24L256.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That is a mistake. Vcc is set to 5 volts (pin smiley-cool and the write protects is set to gnd (pin 7). I will update picture asap.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8933
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

"Wire.available()

Description
Returns the number of bytes available for retrieval with receive(). This should be called on a master device after a call to requestFrom() or on a slave inside the onReceive() handler."
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I should use this to return the number of available bytes I can read? I don't understand how this command will stop my EEPROM chip from being erased upon reset.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8933
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You are attempting to read data from the buffer (result = Wire.receive()smiley-wink before you check to see if there is any data in the buffer (Wire.available()).  Perhaps the library is returning an error due to a buffer under-run.  It is possible that your data is in the EEPROM but your reading code is incorrect.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The thing is i can write data to the chip, then read it 100 times and it works perfectly. As soon as I turn off the bread board and turn it back on and try to read the data i just stored on it, nothing comes up. So its not like the code doesn't work, it seems more like the chip doesn't work, which makes me think there is something wrong with my pull up resistor or something.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok the problem has to be in the code. I have reset the power in the eeprom chip alone and it still reads the data off of it fine. Is there something at the start of the code that would be initializing the eeprom chip?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nevermind, I found the problem. Everytime I turn on the chip, endloop is reset, causing my read loop to reset at 0, so the chip is not infact blank, but my loop was reading nothing.
Logged

Pages: [1]   Go Up
Jump to: