EEPROM Microcontroller

eeprommicrocontroller

It is just a general question. I have designed some micro controller boards with On-Board EEPROM. This EEPROM is to store some configuration parameters for program like calibration data and system IDs. Now when i want to write some configuration parameters,I load some program to write to that specific EEPROM address and run once. Then I load application program.
I think this not the most efficient way to do that task. What is general method to write EEPROM data.
One way to provide some external interface to EEPROM and then using some PC program write direcly into it. But I guess this exposes external interface andleads to vulnerable system.
Other could be to add methods in application program itself using serial port and define some API to change those parameters.
I just want to know the acceptable practice in community from accessibility and security point of view. If it involves any hardware change i can incorporate in future design.
Thanks

EDIT-
On-Board EEPROM is external EEPROM.

Best Answer

The way I usually do it is to have an "EEPROM Is Valid" flag in the EEPROM. Then the main program contains a set of defaults, and if the EEPROM isn't "valid" it loads the defaults into the EEPROM and sets the valid flag.

That way the first time the board is powered up it sets up the EEPROM for you, but subsequent powerups just use the EEPROM data that's already set.

Also has the benefit that it can be reset to factory settings if you want.

Of course, it's then up to the main program to update those values as needed, but without knowing what your system does I can't comment on that.