emfcamp/badge-2024-software

M24C16-RMN6TP in approved EEPROM list, but addressing appears incorrect

gsuberland opened this issue · 3 comments

The M24C16-RMN6TP is in the list of approved EEPROMs here.

The datasheet shows that the M24C16-R series of EEPROMs uses the address format 0b1010xxxx, with the bottom bits used for page select and R/W.

image

This means that the base address of this EEPROM series is 0xA0.

However, the badge firmware uses 0x50 or 0x57 for addressing EEPROMs:

def detect_eeprom_addr(i2c):
devices = i2c.scan()
if 0x57 in devices and 0x50 not in devices:
return 0x57
if 0x50 in devices:
return 0x50
return None

As such, unless I am missing something critical, it is not possible for any hexpansions which use the M24C16-R series EEPROMs to be detected and read from with the current firmware.

The rightmost bit is R/W, so it doesn't count for the address. So you need to shift the address right by 1.

That means the address is 1010000, so 0x50. This is correct.

There are certainly issues with this EEPROM which need addressing, see #129. However, I am certain that addressing is not the issue so I'm going to close this particular issue.

No worries, it does seem that the address thing was a red herring.