I2C EEPROM on uPy/ESP8266?

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
deshipu
Posts: 1348
Joined: Thu May 28, 2015 5:54 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by deshipu » Mon Jan 30, 2017 6:48 pm

Hmm... did you commit your write in the Arduino program?

mikruth
Posts: 18
Joined: Wed Jan 11, 2017 6:00 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by mikruth » Mon Jan 30, 2017 7:41 pm

Not sure about commit but here is write code.

Wire.beginTransmission(deviceaddress);
Wire.write((int)(eeaddress >> 8)); // MSB
Wire.write((int)(eeaddress & 0xFF)); // LSB
Wire.write(data);
Wire.endTransmission();
delay(5);

User avatar
deshipu
Posts: 1348
Joined: Thu May 28, 2015 5:54 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by deshipu » Mon Jan 30, 2017 8:30 pm

I have no idea if there should be a separate commit command, I'm just shooting in the dark here, but it looks like it's not getting commited...

Say, what happens if you write to the memory using Arduino, then disconnect it, re-connect and read using Arduino?

mikruth
Posts: 18
Joined: Wed Jan 11, 2017 6:00 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by mikruth » Mon Jan 30, 2017 8:57 pm

That's fine. I used arduino to write the first 200 memory locations on the eeprom. Then read them back. Disconnected arduino and power to eeprom. Reconnected and booted a new sketch to read only and it was all correct. Then tried to read 1 memory location with ESP which returned xff. Tried again with arduino and all eeprom memory returned 255.

User avatar
deshipu
Posts: 1348
Joined: Thu May 28, 2015 5:54 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by deshipu » Mon Jan 30, 2017 9:23 pm

Does that also happen when you don't actually perform any read commands, and only connect the chip to the esp8266?

I'm assuming with Arduino you are powering the EEPROM with 5V. Are you also powering it with 5V when connected to the ESP8266?

mikruth
Posts: 18
Joined: Wed Jan 11, 2017 6:00 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by mikruth » Mon Jan 30, 2017 10:17 pm

Powering chip with 3.3v only. Yes....the chip changed by just booting up ESP with chip connected. Will try tomorrow without boot.py or main.py to see if something in there is causing problems.

User avatar
deshipu
Posts: 1348
Joined: Thu May 28, 2015 5:54 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by deshipu » Tue Jan 31, 2017 8:48 am

Can you try to power it with 5V when connected to the esp8266? (you can do it safely with i2c, as long as the pullup resistors are still to the 3.3V line).

Also, which pins are you using for I2C? There is a kind of tradition for using pins gpio5 for scl and gpio4 for sda -- they are relatively safe. If you use gpio2, you have to be aware that there is some UART traffic on that pin when the module boots -- that may be sending random commands to your EEPROM and, possibly, deleting its contents.

User avatar
ioukos
Posts: 33
Joined: Wed Oct 19, 2016 11:31 am
Location: Alsace, Europe

Re: I2C EEPROM on uPy/ESP8266?

Post by ioukos » Tue Jan 31, 2017 10:33 am

Hello,

Hmmm, I'm using this kind of module;
(not an ad, just to show you the picture)
http://www.terapeak.com/worth/at24c256- ... 653621371/

My guess is I don't need pull-up resistor. I'm right?

User avatar
deshipu
Posts: 1348
Joined: Thu May 28, 2015 5:54 pm

Re: I2C EEPROM on uPy/ESP8266?

Post by deshipu » Tue Jan 31, 2017 10:34 am

Hard to say without a schematic.

User avatar
mcauser
Posts: 404
Joined: Mon Jun 15, 2015 8:03 am

Re: I2C EEPROM on uPy/ESP8266?

Post by mcauser » Tue Jan 31, 2017 10:54 am

I have the same module and can confirm it has 2x 10k pull up resistors.
Schematic can be found here: http://arduinolearning.com/learning/bas ... eeprom.php

Post Reply