Project with a counter that needs count saved when powered down

Every time you write even a single bit to the EEPROM the complete cell the bit is in has to be erased before it can be written to. Unchanged data will simply be rewritten to the same location.

Also by default all bits are set. Reading a never used byte from EEPROM always returns 255.