chipKIT® Development Platform

Inspired by Arduino™

Arduino Millis() vs Chipkit Millis()

Created Fri, 09 May 2014 16:49:16 +0000 by samdesd


samdesd

Fri, 09 May 2014 16:49:16 +0000

Hi,

I am referring to the above topic with the following text from Brian W.Evans - Arduino notebook_v1-1 (you can google it) ... saying that:

"Millis number will overflow and it will reset back to zero after about 9 hours. "

My need: To my work... 9 hours is no good, and I wanted a similar function that last 24 hours before I reset it to zero.

My questions are:

  1. Millis() is a built in function that Chipkit MUST ALSO HAVE as part of its Arduino compatibility, true?

  2. Does millis() in Chipkit last 9 hours as well?

  3. Which timer (the timer number) does it uses ?

  4. How can I overwrite/disable this function? - (Hence, I can use the same timer for my own creation of timeLine)

Hope to get some clear explanation. Thanks.

SAM


majenko

Fri, 09 May 2014 16:58:56 +0000

The guy doesn't know what he's talking about.

Millis() resets after about 49 days:

2^^32 = 4294967296 milliseconds == 4294967.296 seconds == 71582.788266667 minutes == 1193.046471111 hours == 49.71026963 days.

I have no idea where he got the figure 9 days from. Even if it's getting muddled with micros(), that's still:

4294967296 microseconds == 4294967.296 milliseconds == 4294.967296 seconds == 71.582788267 minutes == 1.193046471 hours.

so ignore what he says about millis().


samdesd

Fri, 09 May 2014 17:32:40 +0000

Thanks Majenko,

SAM