I2C EEPROM Programmer standards and existing code / software


Active member
Hi all,

I have been working on a project that involves saving data to a XL2416CP EEPROM chip to attempt to learn about usage patterns of a water pump and detect if something is wrong.

I only recently found out that M2 parts support multiple slots and have thought it might be nice to put a debugging program in the second slot to save, edit and restore backup copies of the EEPROM memory as needed in case I accidentally corrupt or wipe something during debugging (it takes ~20 days to regenerate all the data).

I am thinking that something along the lines of a hex dumping and programming tool like PonyProg would be ideal for this, although as far as I can tell, it is geared more towards bit banging serial ports to talk in other protocols like I2C than using a microcontroller that interprets between the eeprom and computer – please correct me if I am wrong though :). I would prefer to use the same programming cable and socket connected to the download pins if possible.

I am happy to implement my own software, but thought I would check if anyone knew of anything already existing that would work or any common standards and packet / request structures used by eeprom programmers so that an existing interface tool on a Linux or Windows computer could be used to talk to it (not that I know of any readily available).

I came across this thread which as of 2009 could not find anything similar, but asking on the off chance something has come up since then.



Active member
In the end, I have written a small python script that can save or load data from binary files and send and receive it from the chip. The binary files can then be viewed or edited using pretty much any hex editor.

The PICAXE either runs the EEPROMTools.bas program or this is integrated into the main program as an optional routine to jump into if a character (currently ` ) is sent during startup.

As an example of how it could be integrated, the subroutines from EEPROMTools.bas could be added near the bottom and these lines added in the initialisation section. By default, the python script looks for '`' being printed as part of the prompt and will send ` to enter the computer interface EEPROM mode.
    setfreq m32 ; Baud rate is 38400, can be changed if needed.
    sertxd("Press '`' for EEPROMTools", cr, lf)
    serrxd[16000, main], tmpwd0l
    if tmpwd0l = "`" then computer_mode

This approach is used in this file. This github branch is still a work in progress and the actual pump monitoring stuff seems to be broken at the moment.

An example of using the script to read a 2kB EEPROM chip is:
python3 EEPROMTools.py read output.bin
The python and picaxe code can be found here: https://github.com/jgOhYeah/PICAXE-Libraries-Extras/tree/main/EEPROMTools