ExpertMemory & Interfaces

Pico I²C EEPROM Memory Notebook

Write a short byte string to an AT24C256C EEPROM, wait for its internal write cycle, and read it back over I²C.

Estimated time: 1–2 hours · Skills: I²C addressing, word addresses, nonvolatile memory writes

Parts from the database

Other supplies

Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.

Connections

  1. Use a breakout. VCC to Pico 3V3, GND to ground, SDA to GP0, SCL to GP1.
  2. Tie A0/A1/A2 to ground for address 0x50 and WP low to allow writes; ensure pull-ups go to 3.3 V.
  3. AT24C256 has 64-byte pages; this example writes only three bytes at offset zero.

Build steps

  1. Run the code once; it writes EHH and reads it back.
  2. Power-cycle, then read again to confirm nonvolatile storage.
  3. Avoid rapid repeated writes to the same cell.
  4. Longer writes must be page-aware and not cross a 64-byte boundary.

Software and firmware setup

from machine import I2C, Pin
from time import sleep_ms
i2c = I2C(0, sda=Pin(0), scl=Pin(1), freq=100000)
address = 0x50
word_address = 0
payload = b'EHH'
i2c.writeto(address, bytes([word_address >> 8, word_address & 255]) + payload)
sleep_ms(10)
i2c.writeto(address, bytes([word_address >> 8, word_address & 255]), stop=False)
print(i2c.readfrom(address, len(payload)))

Review the pin assignments in the sketch against the wiring table before uploading.

Test your build

The terminal prints `b'EHH'`; the same value after a power cycle shows data persisted.

Troubleshooting

  • No ACK: verify 0x50, address pins, WP low, and 3.3 V pull-ups.
  • Readback differs: wait for write cycle and send both address bytes.
  • Boundary problems: page writes are limited to 64 bytes.

Safety and limitations

Use 3.3 V levels. EEPROM write endurance is finite; do not run a fast write loop.

Manufacturer and platform documentation

Community Notes for This Project

These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.

Set up the comments service to load community notes.

Share a tip or question about this build

← Browse all projects