Mike Keitz wrote: > Write the new values when the user releases the button. This prevents > constant writes because of autorepeating but also has an immediate > update. Unless you're storing data for more than one button in an EEPROM > byte the buttons should wear out before the EEPROM will. > > I like to always get working data from the EEPROM right when needed. > That way there's no need to copy the EEPROM to RAM on power-up or deal > with a possible discrepancy between the two. But it may be a problem > with your scheme if the user is expecting to be working with a "live" > value while updating. If you don't write to the EEPROM until after the > button is released, any program running in the background would use the > old values. Also the EEPROM is unavailable for reading during a write. > > It is more likely for a glitch to upset a RAM value than EEPROM. So your > scheme of writing RAM values to EEPROM whenever they differ is going to > be kind of susceptible. I'd have the EEPROM writing routine only run if > the user is pressing buttons to change the settings. Thanks for the useful input Mike. Looks like I need to integrate the EEPROM routines more fully into the key reading routine. I thought I had already taken care of the auto-repeat problem by using 'working' registers which are then copied to EEPROM after the user has finished updating the values. I was obviously worried about the time lag and possible corruption using this method, hence my original question. The values are live in that they are needed to be used by other routines and are also shown on a display. Because of the relatively long write time of the EEPROM I cannot see an easy way to work directly with values stored in EEPROM. Am I missing something fundamental? David