You have two major problems. 1. The application note code does not do I2C properly The code does not let slaves wait-state the master. 2. EEPROMs have non-intuitive behaviour. You can't read them back immediately. They go off-line during their write-cycle of about 10 ms. That is, they don't respond to their I2C bus address. So your code needs to either wait say 20ms, or retry until the slave EEPROM responds. The latter is better because it automatically waits as long as is needed. No code-re-write if you change EEPROM type.