Yes you're correct, i is overrun.
This is AI generated code, by the way

I added this:

Code:
    if i>=80 then
    serout2 portc.5,84, ["Oops!", 10, 13]
    i=0
    endif
And now output looks like this with GPS connected:
Oops!
Oops!
Oops!
Time: 16:36:37
Time: 16:36:38
Time: 16:36:39
Time: 16:36:40
Oops!
Time: 16:36:42
Oops!

And only "Oops!" with GPS disconnected, but there are no more resets...