Go Down

Topic: I2C EEPROM not working (Read 613 times) previous topic - next topic

mhenstell

Hello,

I just got a 24LC256 I2C EEPROM that I'm trying to interface with my arduino. I've tried every I2C EEPROM example in the playground and on the forums, but I can't seem to get it to work. It looks like it's working (writing and reading, printing to the serial port), but I get the exact same results if I remove the chip from the circuit. I'm using the Wire library, pins 4 and 5 for SDA and SCL, WP to ground. I believe I read that the Wire library uses the same buffer for sending and receiving, which might explain why it looks like I'm receiving data OK.. but it doesn't matter if the EEPROM is present or not. Any ideas? Thanks

Delta

As posted very recently - are you using pins 4&5 of the digital or analog - I2C is on pins 4 & 5 of the analog inputs - This seems to trip up a lot of people.

mhenstell

Oops, musta missed that one. Now it appears to work alright, however I'm having some trouble with:

Code: [Select]
void i2c_eeprom_write_page( int deviceaddress, unsigned int eeaddresspage, byte* data, byte length ) {
Wire.beginTransmission(deviceaddress);
Wire.send((int)(eeaddresspage >> 8)); // Address High Byte
Wire.send((int)(eeaddresspage & 0xFF)); // Address Low Byte
byte c;
for ( c = 0; c < length; c++)
  Wire.send(data[c]);
Wire.endTransmission();
delay(10);                           // need some delay
}


Doesn't seem to matter what number I put for the page address, it doesn't seem to be writing anything. I thought it might be a problem with the page address, but now it looks like this function isn't writing anything at all, and the data I'm getting from the dump is left over from the last example I had working. Any thoughts?


Go Up