Did you write this library? What exactly is this line suppose to do???
If yo are using Arduino UNO R3, then follow Fig-2 of post #9 for I2C bus connection. You must use the pull-up resistors with the I2C Bus.
What is 7E?
No. That isn't the response from the code you posted.
It should start with "EEPROM is not found!" or "EEPROM is preesent." Not my spelling.
I don't know what "7E" is, that is the output in the serial monitor for the code you posted...
Thanks for spoting te mis-spelling. I have corrected it.
1. Have you connected the pull-up resistors?
2. have you put the EEPROM omn the breadbord?
3. Usea DVM with sound and check the jumpers continuity from the pins of the EEPROM upto the UNO-R3 ends.
4. Still proble, chnage the EEPROM.
Thanks for your help by he way, it's appreciated.
1. Have you connected the pull-up resistors? Yes
2. have you put the EEPROM omn the breadbord? Yes
3. Usea DVM with sound and check the jumpers continuity from the pins of the EEPROM upto the UNO-R3 ends. I have continuity
Then my sketch/codes of post #9 should be suspected. Do you have a DS1307 or DS3231 RTC Module? That Module contains 24C32 EEPROM. You can test the sketch on that EEPROM. I am doing the test on my RTC Module.
7E is the HEX value the sketch stored in location 0x0C, or so it thinks.
The sketch writes the value, then a few milliseconds later, reads it.
If that is the code he's running. It should be 0x37.
byte M24AA01::write(byte address, byte *data, byte len)
{
byte r = 0;
for(byte i=0; i<len; )
{
Wire.beginTransmission(EEPROM_ADDR | m_addr);
Wire.write(address + i);
byte l = len > 8 ? 8 : l;
Wire.write(data+i, l);
r |= Wire.endTransmission();
delay(3);
i += l;
}
return r;
}
That should return 0 if the write is successful. The return value is the status from Wire.endTransmission(), not the number of bytes written. A value of 0 indicates success.
The codes has written 0x37 and NOT 0x7E. The sketch has read back the written value and has showed on Serial Monitor in HEX. If the write is good, then SM should show 37.
Just out of interest, i changed this to
Wire.write(0x38);
But it still returns 7E
Did you get the message "EEPROM is present"?
Measure the voltge level at Pin-7 of EEPROM and report it.
yes
EEPROM is present.
7E
Measure the voltge level at Pin-7 of EEPROM and report it.
It is 0V - So write protection is disabled
Corrct!
Change the above line to the following one and then re-run the sketch of post #9 and report what you have seen on SM?
byte wrStatus = Wire.endTransmission();
delay(5):
Serial.println(wrStatus, DEC);
EEPROM is present.
0
7E
The single "0" is the status of the write() operation, not the number of bytes written.
A value of "0" indicate success, any other value indicates an error.
The value is derived from the return value of the Wire.endTransmission() function, which also uses "0" to indicate success.