i was working with AT24C32 eeprom wrote a code for that and it work pretty well,but now i am working with 24c16
when i run the same code interfacing 24c16 the code stops working.can anyone tell me where the threat is
A few things that would be helpful. Show us a datasheet. If you added Serial.prints to show that you have made it to certain areas of your code before it hangs, will help you narrow it down to where the code is stopping. Print things like "started", "section 1", "section 2", and print (i) to find the position you are in during your for loops.
Is this the correct address of the chip? We don't know without a datasheet.
@RandallR
How do you have the EEPROM wired up to the Arduino? I've been trying to get a 24LC256 to respond over I2C with no luck. I tried your scanning routine and it doesn't see anything.
I have pins 1-4 to ground.
pin 5 SDA to Analog pin 4
pin 6 SCL to Analog pin 5
Pin 7 WP to ground
Pin 8 +5V to the +5V pin on the Nano.
I found my problem. It's a bad breadboard. I've just moved the Nano and EEPROM to a brand new one and all is well. @cyclegadget - Thanks for the interesting link.
A bit late in the day, seeing that the posts are from three years ago, but I got stuck two days on the RTC before I found that the Leonardo uses not A5 and A4 but D2 and D3 for I2C communication.
So if anybody lands here with a Leonardo that does not work: here you are.