Skip to content

Instantly share code, notes, and snippets.

@hed0rah
Created March 10, 2026 13:56
Show Gist options
  • Select an option

  • Save hed0rah/110b0076556e580abaafc06880b6caf8 to your computer and use it in GitHub Desktop.

Select an option

Save hed0rah/110b0076556e580abaafc06880b6caf8 to your computer and use it in GitHub Desktop.
eeprom 24x detection methods

i2c eeprom auto-detect: per-chip detection logic

Chip Size Method Logic
24X01 128B 1-byte mirror at 128 chip wraps at 128, reading there returns same 8 bytes as address 0
24X02 256B ack_count=0, wrap test passes only responds at base, burst read at 252 wraps at 256, bytes[4..7] match sig[0..3]
24X04 512B ack_count=1, block-1 wraps responds at base+1, block 1 is 256B with 1-byte addr, wrap test confirms small blocks
24X08 1KB ack_count=3, block-1 wraps responds at base+1..+3, same block-1 wrap logic as 24X04
24X16 2KB ack_count>=7 responds at base+1..+7, no other chip uses 8 addresses, data-independent
24X32 4KB 2-byte mirror at 4096 chip wraps at 4096 in 16-bit address space
24X64 8KB 2-byte mirror at 8192 chip wraps at 8192
24X128 16KB 2-byte mirror at 16384 chip wraps at 16384
24X256 32KB 2-byte mirror at 32768 chip wraps at 32768
24X512 64KB elimination ack_count=0, wrap test fails, no ACK at base+8, mirror overflows 16-bit addr space
24X1025 128KB ack_count=0, ACK at base+8 block select offset=3 puts upper bank at base+8, data-independent
24X1026 128KB ack_count=1, block-1 does NOT wrap block 1 is 64KB with 2-byte addr, wrap test fails, distinguishes from 24X04
24XM01 128KB indistinguishable from 24X1026 same size, ACK pattern, and address structure, differs only in page size (write-only property)
24XM02 256KB ack_count=3, block-1 does NOT wrap block 1 is 64KB with 2-byte addr, wrap test fails, distinguishes from 24X08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment