EEprom Faliure
crgwbr
Posts: 614
In the industrial project I'm doing (I'm sure you've heard about it from other posts), I need to store 6 bytes of information in EEprom. To do this I am using Mike's Minimal I2C object. The EEprom (24LC256) is on I/O line 0 and 1. What's happening, is the EEprom seems to be losing it's memory after several hours or days. For example, at 9:00 AM this morning, it read the values perfectly, 11:00AM, they all read 0. I've tried numerous things to try to correct this, including the routine Mike wrote that pulses the clock line for up to 9 times. None of these had any effect. I also don't believe that the eeprom is defective, I tried putting the values on the boot-up eeprom, same thing happened. I've been attempting to fix this problem for over a week now, and still don't have the slightest clue as to what is going on. Because of this trouble, my boss is now convinced that the propeller is not a good product, and is threatening to outsource the project to Siemens (In other words, I get fired). Please, if anyone has an Idea of what could be happening, post it. At this point, anything would help.
Thank you,
Craig
Post Edit: Code is now uploaded
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Post Edited (crgwbr) : 4/9/2007 4:08:39 PM GMT
Thank you,
Craig
Post Edit: Code is now uploaded
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Post Edited (crgwbr) : 4/9/2007 4:08:39 PM GMT
Comments
Regards,
Quattro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Thanks, Craig
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Leon
Pub GetVal(Gval)
·repeat 9
· ·outa[noparse][[/noparse]28] := 0
·· outa[noparse][[/noparse]28] := 1
·eeprom.i2cReadPage(28, $A0, $7FFC, @Gval, 2)
Sample Write:
pub write(value)
·outa[noparse][[/noparse]28] := 1
·dira[noparse][[/noparse]28] := 1
·dira[noparse][[/noparse]29] := 0
·eeprom.i2cWritepage(28,$A0,$7FFC,@value,2)
·waitcnt(clkfreq / 200 + cnt)
are you sure - the 'number of bytes' is correct ?
the following is from Mikes object -
PUB i2cReadPage(i2cSCL, i2cAddr, addrReg, dataPtr, count) : ackbit
' Read in a block of i2c data. Device address is i2cAddr. Device starting
' address is addrReg. Data address is at dataPtr. Number of bytes is count.
' The device address is modified using the upper 3 bits of the 19 bit addrReg.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Post Edit: Code is now uploaded
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Post Edited (crgwbr) : 4/9/2007 4:08:56 PM GMT
Regards,
Quattro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Somehow you're writing zeroes to the EEPROM. It would be a very very unusual hardware failure that would result in zeros being written. If this were my program, I'd look at what variables are adjacent to the 6 bytes in the VARS section to see if an array subscript could be out of range. I would look at the call structure of the program to make sure there wasn't a stack overflow occurring somewhere. If there are multiple cogs being used (other than standard I/O drivers), I'd look at their stack areas and shared variables. I'd look at all the places where the I2C routines are being called to make sure that the parameters are correct. If I couldn't find anything, I'd set up a spare PC serial port on a spare I/O pin and use the Simple_Serial I/O driver to display the parameters to the I2C routines, particularly whenever these locations are accessed for reading or writing to try to catch the problem when it happens.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Regards,
Quattro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
I agree, I don't see how it could be a hardware failure. The only objects I'm using, are Extended_FDSerial, Minimal I2C Driver, and RotaryEncoder. Of, those, the only one that isn't an I/O driver is the Rotary encoder object. However, that is an input only object, therfore, I'm not sure how it could write 0's to the eeprom.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
I already posted it. Look at the first post.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
I suspect that your repeat loop at the end of Load is being activated and that you're getting FutureDn values that are all zero and that these are being written to the eeprom. You should see this on your serial port since you're displaying them when they're received.
I'm not sure this repeat loop is what you want. If it sees an "o", it echos "k", but then it goes on to always receive the 6 values.
Thanks,
Craig
P.S.- The O and K are part of the communications protocall I designed for the computer app. It must recieve the 6 values, because the computer will always send 6 values.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Post Edited (crgwbr) : 4/9/2007 4:37:24 PM GMT
I have a EEPROM I2C object in my video overlay module.
You can download it here http://forums.parallax.com/attachment.php?attachmentid=0
It is based on the code posted by Beau.
I don't know if it will help, but it's worth a try. I haven't had any problems with it.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"Educate your children to self-control, to the habit of holding passion and prejudice and evil tendencies subject to an upright and reasoning will, and you have done much to abolish misery from their future and crimes from society"
Benjamin Franklin
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
www.hittconsulting.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Post Edited (crgwbr) : 4/9/2007 4:42:36 PM GMT
Alternatively, you could check for power to the FT232R in your code (by connecting it to an I/O pin through a 10K resistor) and ignore the serial input (and flush the receive buffer) if it's absent.
Post Edited (Mike Green) : 4/9/2007 4:45:41 PM GMT
Thank You,
Craig
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Any serial line should idle at logic true (high in this case). If the FT232R is powered, but not receiving any USB input, it should have a +3.3V output (try it). The serial routines will ignore this. The start bit of a character begins at the first high to low transition.
Thanks Again,
Craig
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
Thanks,
Craig
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."
So the prop will get the 'Green' light for the industrial app. ? (couldn't help but add that pun Mike !)
Regards,
Quattro
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'
Craig
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Microsoft: "You've got questions. We've got dancing paper clips."