Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
Hi, I want to acces a 24LC1025 from Microchip. Whenever I write something to the device, I got no ACKs. I have testet this with two other eeproms without success. The SDA and SCL are pulled high to 5V via 10k (also tested with 1k and 3k3)
Datasheet: http://ww1.microchip.com/downloads/en/DeviceDoc/21941J.pdf
Here is the code and the result. Maybe someone has a suggestion:
I2C cmp(p28, p27); // I2C sda,scl printf(" I2C Reset!\n"); cmp.frequency(400000); int ret; char buf[128]; cmp.start(); // Start condition ret= cmp.write(0xA0); printf(" 1:%i\n", ret); ret= cmp.write(0x00); printf(" 1:%i\n", ret); ret= cmp.write(0x00); printf(" 1:%i\n", ret); for (i=0; i<5; i++) printf(" write:%i %i\n", i, cmp.write(i)); cmp.stop(); // Stop condition wait_ms(30); //write cycle time for page update cmp.start(); // Start condition ret= cmp.write(0xA0); printf(" 2:%i\n", ret); ret= cmp.write(0x00); printf(" 2:%i\n", ret); ret= cmp.write(0x00); printf(" 2:%i\n", ret); cmp.start(); // Start condition printf(" 2:%i\n", cmp.write(0xA1)); for (i=0; i<5-1; i++) { buf[i]=cmp.read(1); //ACK printf(" read:%i %i\n", i,buf[i] ); } i++; buf[i]=cmp.read(0); // NOACK printf(" read:%i %i\n", i,buf[i] ); cmp.stop(); // Stop conditionResult: