I updated Melanie's code which did not behaved as expected on small EEPROMs. Here's the new topic: EEPROM automatic identification routine