>> I am storing a number of records in eeprom - kind of a circular buffer >> arrangement. Part of each record is a 1 byte number used as a 'sequence' >> counter - its purpose is to tell me which record is the newest. > >If you place the records in a circular buffer then surely the one that >the buffer pointer points to is the newest entered. Thats the problem - I have to find *which* record is newest in order to set the buffer pointer. When the system powers down, all I have is the data stored in eeprom. I am currently using 8 records of 32 bytes each in the buffer - another record is stored at some time varying from 1 minute to an hour. Each record includes a CRC to warn me of a corrupted record or damaged eeprom. If a damaged sectoin of eeprom is found, I swap in one of 7 spare chunks (just change the pointer in my 'housekeeping' section. Essentially, I consider any location that gets written often to be subject to damage. Thats why I don't keep my buffer pointer in eeprom - it would have to be written every time a new record was written - and, if that location died, I would have no way of dealing with it. The way I have it set up now, my housekeeping section get written once upon first power-up, then written only when necessary to map out a defective section of eeprom. Each of the 8 records currently in use contains the 1 byte sequence count - I simply need to find out which count is highest so that I can set my buffer pointer to that record. I start off with 512 bytes of eeprom. This is divided into 16 chunks of 32 bytes each. One of those chunks is reserved for what I call 'housekeeping' - it contains 3 copies of the start addresses of the 8 records in my buffer. This leaves me with 7 spare chunks of eeprom that will get swapped in as required. When the last of those is gone, my buffer drops from 8 records down to 7, then 6, etc. Of course, when I have lost more than a couple of spare chunks, I'll signal that maintenance is required. I hope this explains things a bit more clearly. dwayne Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 15 years of Engineering Innovation (1984 - 1999) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Do NOT send unsolicited commercial email to this email address. My posting messages to Usenet neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email.