I think, as Henrik demonstrates, allotting 6 bits to each value is the most efficient or supportable or likely to be upgradable later (perhaps at some future date a pin-compatible processor with more EEPROM) method and so this is my advice as well. And, as he demonstrates the details, I will only suggest that a bit array of 24 elements would store 4 of your 6 bit numbers and write to 3 bytes of EEPROM without waste (well, except the two final bytes). For myself, it seems easiest to read and write to this array - shifting values in prior to a write and out to retrieve the stored values. Simpler in my mind to calculate retrieval positions with integer math. Henrick has done the "heavy lifting" for the subroutines to read and write...
You may also look at BCD encoding. This is typically done with 4 or 8 bits, but there are 6 bit examples out there. Perhaps there is something that we have not thought of...
Bookmarks