That is exactly what EEPROM is for - storage of configuration data, etc. The data is non-volatile, it is retained even if the PIC powered down, and is available on power-up. The 16F628A comes with 128 bytes of EEPROM built in. You now have 3 extra I/O pins available plus you save on the cost of the DIP switch and other components.
See page 123 of the manual for the READ command, and Page 159 for the WRITE command to read/write EEPROM.
Bookmarks