Go Down

Topic: "Year 2000 problem" in Arduino (Read 1 time) previous topic - next topic


The micros( ) in wiring.c function using the the variable timer0_millis, which is defined volatile unsigned long timer0_millis , the maximum value is oxFFFFFFFF . It adds MILLIS_INC on  each Timer0 interrupt(at 12MHZ clock, the MILLIS_INC = 1).  After  (0xFFFFFFFF/MILLIS_INC) Timer0 interupts,  timer0_millis will become 0 on next interrupt, so the delay( ) function will  occur the "Year 2000 problem" , because it uses if (((uint16_t)micros() - start) >= 1000) ,which the micros() is equal  timer0_millis.

At about 68 days, it maybe accur "Year 2000 problem".

by Rom Huang


All this is well known so:-
So what is your point or question?

James C4S

At about 68 days, it maybe accur "Year 2000 problem".

I would assume that is why the millis() reference page (http://arduino.cc/en/Reference/Millis) says:  "This number will overflow (go back to zero), after approximately 50 days."

The solution is very simple and well documented:
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131