This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compensate clock drift for microcontroller

Hi, I am using an MSP430 which is registering time at specific moments by pressing a button. Data was collected during several days on several devices (same design) and the clock drift varies either going fast, slow or relatively steady. I want to make a simple off-line time compensation program (using matlab, c or labview) that would work on all the devices, if we assume that compensation should be linear, can somebody please explain how is it done? I am guessing that the initial time and the current computer clock should help. This may be a simple task but I am relatively new on this topic. Thank you for any suggestion that you can provide. Note: 20 ppm for crystal (error of 1.73 sec per day.)