Go Down

Topic: I2C EEPROM write (Read 251 times) previous topic - next topic

birry

Hey people! I am starting now in this new world and I have read succesfully an I2C EEPROM with bus pirate, I know it's not arduino, but I found that here could be a good place to start with. The EEPROM has written outside "ATMLH244", from which I suppose it is an Atmel from this datasheet: http://ww1.microchip.com/downloads/en/devicedoc/doc0180.pdf

For instance, I am able to read 0x00 byte from 0xA1 device:

I2C>[0xa0 0x00][0xa1 r:1] 
I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C START BIT
WRITE: 0xA1 ACK
READ: 0xB3
NACK
I2C STOP BIT
I2C>

Which value is 0xB3, so then I try to write it as datasheet says (start condition, device, address, data, stop condition):

I2C> [0xa0 0x00 0x00]
I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0x00 ACK
WRITE: 0x00 ACK
I2C STOP BIT


The acks seems that it went ok, but when I read it again, same data of before remain stored:

I2C>[0xa0 0x00][0xa1 r:1] 
I2C START BIT
WRITE: 0xA0 ACK
WRITE: 0x00 ACK
I2C STOP BIT
I2C START BIT
WRITE: 0xA1 ACK
READ: 0xB3
NACK
I2C STOP BIT
I2C>

Maybe I am interpreting wrong the datasheet for device writing? Thanks in advance!

GolamMostafa

#1
Apr 20, 2019, 07:42 am Last Edit: Apr 20, 2019, 07:43 am by GolamMostafa
Do you own an Arduino UNO?
Do you own an EEPROM chip like: AT2404 or AT24C08A or AT24C16B?

If not, please collect them and then come to the Forum for help!


Lucario448

Your I2C log doesn't seems that clear to me, not sure where you are logging the device address.


Aside from the device (slave) address byte, the master has to send two more bytes in order to write a single one (the last one it is); or just one to only set the memory address. Is that what you are doing?
Furthermore, you have to wait at least 5 milliseconds (after the stop bit of a write operation that doesn't just set the memory address) to be completely sure a data "page" has been written.

From 4K EEPROMs and above, they should take multiple slave/device addresses because part of the memory address now overlaps with part of this byte (when larger than 256 bytes).




PD:  AT24 doesn't seem to be the same as ATMLH244; are you completely sure they are?

Smajdalf

What about Write Protect pin? Do you have it connected to GND?
Banned forever by Coding Badly for "trolling". Good luck with such attitude.
Update: Timeout "Extended, yet again, for lying." From eternity to Apr 19, 2019. Interesting...
How to insert images: https://forum.arduino.cc/index.php?topic=519037.0

Go Up