I'm working on a new product design and there will probably be small or large hardware changes/fixes over the life of the product. For future firmware updates in the field I need a way to determine the hardware revision. What is a good strategy?
I'm currently pulling two spare pins up/down with external resistors and checking the pattern. This only allows for 4 hardware revisions, but that might be enough for practical purposes. It might become a problem if I need one or both of those pins in a future hardware revision.
I guess a more economical way might be to have a resistor divider connected to an ADC pin. Each hardware revision could have different value resistors. Unfortunately I don't have any spare ADCs in my current design.
I guess another way could be to encode the hardware version number in an EEPROM or the mcu flash during production? (We don't have that facility at the moment.)
I guess I'm looking for suggestions for a flexible and robust method.
[EDIT]
Re. suggestion from @trav1s: I don't have an address bus per se but I have an 24LCxx EEPROM on the I2C bus. The low 3 bits of the Slave Address is hardwired. I guess I could change the address bits and search for the EEPROM during startup.