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.
Parts from the database
- AT24C256C-SSHM × 1256-kilobit EEPROM on a breakout
- Raspberry-Pi-Pico × 1I²C host
Other supplies
- 3.3 V-compatible SOIC breakoutCommon build supply
- two 4.7 kΩ pull-ups if not fittedCommon build supply
- breadboardCommon build supply
- jumper wiresCommon build supply
- MicroPython installedCommon build supply
Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.
Connections
- Use a breakout. VCC to Pico 3V3, GND to ground, SDA to GP0, SCL to GP1.
- Tie A0/A1/A2 to ground for address 0x50 and WP low to allow writes; ensure pull-ups go to 3.3 V.
- AT24C256 has 64-byte pages; this example writes only three bytes at offset zero.
Build steps
- Run the code once; it writes EHH and reads it back.
- Power-cycle, then read again to confirm nonvolatile storage.
- Avoid rapid repeated writes to the same cell.
- 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)))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.