I'm using C18 compiler and 24LC256 EEPROM. I would like to know how to handle **Rollover** case in terms of large EEPROM write.I'm writing a Routine that writes 120 Bytes every half an hour and i would like to know how can i save/store my data easily as Page Write will take only 5 ms as equal to a single write operation.The Page size here is 64 Bytes.And i have to write for 10 hours making it 2.4 K space per day.


Well the problem i have is:

1.I want to use Page Write Efficiently and wants to prevent Roll over condition.
 page size starts from 0-63 , 64-127 ,128-191,192-255...up to 32 K.
 I want to  Predict when is the Page Limit coming and wants the Page Write to shift     accordingly.

eg:
If i start with 0th address: 0-63 will occupy 64 bytes and 64-103 will occupy the next 44 Bytes.
Then for the next Page Write i can only write 20 locations and have to write 64  and 20 in another two Page Write Operations.


Note:Dedicating starting Page Locations for each Page Write is not required.

I have been trying to find an algorithm to do so. It would be extremely helpful if you sort out an issue for this.

Regards

Arookie