If you have Duty defined as a word, you will have some problems reading and writing to Eprom.

EEprom works in bytes, not words... if you write a word, you will have to do a double read....First read will pick up the MSB, and the second read will pick up the LSB.

If you know that your duty will not go more than 255, then change the Duty to a "Byte" instead of a word. Then a very simple Read/Write to EEPROM is all that is needed.

If your Duty is more, then you will have to read Two bytes, and concatinate <sp> the two bytes together to make up your stored Word.


Dwayne