I have written code which correctly works with EEPROM 24C64 but when i replaced it with lower memory 24C04, same code is not working.
Please help if anybody know why is it happening.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
I have written code which correctly works with EEPROM 24C64 but when i replaced it with lower memory 24C04, same code is not working.
Please help if anybody know why is it happening.
Thanks for reply Clemens Ladisch,
My code is working correctly without any trouble with 24C64, but not with 24C04.
I read about the difference in address etc between these two chips, but things are not clear.
Can you please provide me a working code for 24C04.
Why don't you use the MSP's communication module? Which MSP do you use? There are code examples that show how to initialize and operate I²C communication with a communication module like USI or USCI, without all these delays and port function switching.
How do you expect anybody to be able to help you?
Already after the third post, I got the impression that this is a "do my homework quickly" request. Further posts reinforced that suspicion - especially the aggressive style when being averted ...
The 24C64 datasheet says:
The device address word consists of a mandatory one, zero sequence for the first four most significant bits as shown. […] The 32K/64K uses the three device address bits A2, A1, A0 to allow as many as eight devices on the same bus. […]
A write operation requires two 8-bit data word addresses following the device address word and acknowledgment.
The 24C04 datasheet says:
The device address word consists of a mandatory one, zero sequence for the first four most significant bits as shown. […] The 4K EEPROM only uses the A2 and A1 device address bits with the third bit being a memory page address bit. […]
A write operation requires an 8-bit data word address following the device address word and acknowledgment.
So you have to change how you send the address.
Your code already contains a mechanism to change this (two_byte_address), but it was commented out. And you have to put the ninth bit into the address byte.
**Attention** This is a public forum