I'm having odd problems with an EEPROM. Certain locations are unwriteable, the rest if just fine. For example, here's some test code to load test data to a particular location:
--------------------------
' Setup hardware addresses
SYMBOL EXTERNAL_MEMORY_ADDRESS = %10100000
SYMBOL eeprom_pointer = w1
SYMBOL temp_var = b10
Main:
pause 1000
' Setup memory
hi2csetup i2cmaster, EXTERNAL_MEMORY_ADDRESS, i2cfast, i2cword
'pattern_pointer = $2E7C hi2cout pattern_pointer, (65, 36, 2, 0, 0, 0, 0, 16) pause 20
' Point to address of memory to test
eeprom_pointer = $2E7C
' Load test data
hi2cout eeprom_pointer, (1, 2, 3, 4, 5, 6, 7, 8)
' Wait for write
pause 20
' Read test data back to terminal
eeprom_pointer = $2E7C
for eeprom_pointer = $2E7C to $2E83
hi2cin eeprom_pointer, (temp_var)
sertxd ("Byte at ", #eeprom_pointer, " is ", #temp_var, cr, lf)
next
end
--------------------------
The data I get back is:
Byte at 11900 is 1
Byte at 11901 is 2
Byte at 11902 is 3
Byte at 11903 is 4
Byte at 11904 is 0
Byte at 11905 is 32
Byte at 11906 is 70
Byte at 11907 is 16
Clearly, the last four bytes aren't being written to.
Is this how EEPROMS die? I'm a little surprised, as I'm damn sure it hasn't been written to many times. Is there anything I can do about it? (Short of replacing the chip, which is underneath the bodge of the replacement power supply which is glued in place...)
--------------------------
' Setup hardware addresses
SYMBOL EXTERNAL_MEMORY_ADDRESS = %10100000
SYMBOL eeprom_pointer = w1
SYMBOL temp_var = b10
Main:
pause 1000
' Setup memory
hi2csetup i2cmaster, EXTERNAL_MEMORY_ADDRESS, i2cfast, i2cword
'pattern_pointer = $2E7C hi2cout pattern_pointer, (65, 36, 2, 0, 0, 0, 0, 16) pause 20
' Point to address of memory to test
eeprom_pointer = $2E7C
' Load test data
hi2cout eeprom_pointer, (1, 2, 3, 4, 5, 6, 7, 8)
' Wait for write
pause 20
' Read test data back to terminal
eeprom_pointer = $2E7C
for eeprom_pointer = $2E7C to $2E83
hi2cin eeprom_pointer, (temp_var)
sertxd ("Byte at ", #eeprom_pointer, " is ", #temp_var, cr, lf)
next
end
--------------------------
The data I get back is:
Byte at 11900 is 1
Byte at 11901 is 2
Byte at 11902 is 3
Byte at 11903 is 4
Byte at 11904 is 0
Byte at 11905 is 32
Byte at 11906 is 70
Byte at 11907 is 16
Clearly, the last four bytes aren't being written to.
Is this how EEPROMS die? I'm a little surprised, as I'm damn sure it hasn't been written to many times. Is there anything I can do about it? (Short of replacing the chip, which is underneath the bodge of the replacement power supply which is glued in place...)