albert,
I wouldn't throw hardware at a s/w issue.
I think you would be better of using the Time and TimeAlarms libraries.
They do it all for you and don't have any millis() rollover issues.
Time library tracks time and allows for a synchronization routine to set the time and keep the time in sync.
It also allows setting a sync interval for how often to re-sync the time.
The TimeAlarms library provides for setting up "alarms" that can call your functions
at predetermined date/times or periodically.
There are many examples provided including one that uses NTP to sync the time.
Although if you really want to slam the millis() clock back to zero:
/*
* Code to Reset the millis counter back to 0
* NOTE: this does not reset the hardware counter and
* also does not set the software fractional value as that was declared static
* in wiring.c
* As a result, the first "tick" will be be shorter than it should be.
*/
void millisReset()
{
extern volatile unsigned long timer0_millis;
extern volatile unsigned long timer0_overflow_count;
noInterrupts();
timer0_millis = 0;
timer0_overflow_count = 0;
interrupts();
}
--- bill