chipKIT32/chipKIT32-MAX — Issue #143: millis() significantly broken!
Author: WestfW
Created: 2011-11-01 06:44:18+00:00
State: open

The patch for https://github.com/chipKIT32/chipKIT32-MAX/issues/124 seems to have broken millis() pretty significantly.
Printing millis() and micros() in response to a periodic signal (chasing another issue; discussion here: http://chipkit.org/forum/viewtopic.php?f=6&t=464 ) produces this massive glitch in millis() near the 107 s mark, when the core timer overflows:

103.07 - 103 - 1001119
104.07 - 104 - 1001119
105.07 - 105 - 1001119
106.07 - 106 - 1001119
107.07 - 107 - 1001120
214.75 - 107 - 698505
214.75 - 108 - 1001118
214.75 - 109 - 1001119
214.75 - 110 - 1001120
214.75 - 111 - 1001120
214.75 - 112 - 1001121

millis() continues to report 214750 until about the (actual) 214 second mark, at which point it starts behaving normally again:

214.75 - 210 - 1001119
214.75 - 211 - 1001116
214.75 - 212 - 1001121
214.75 - 213 - 1001118
215.30 - 214 - 444251
216.29 - 215 - 1001120
217.26 - 216 - 1001116
218.23 - 217 - 1001121
219.21 - 218 - 1001116
220.21 - 219 - 1001121
221.20 - 220 - 1001118

And then it breaks again at ~321 s:

318.31 - 317 - 1001118
319.31 - 318 - 1001120
320.31 - 319 - 1001119
321.31 - 320 - 1001117
429.50 - 320 - 189963
429.50 - 321 - 1001120
429.50 - 322 - 1001119
429.50 - 323 - 1001117