I am trying to implement millis() function from Arduino. What it does, it counts number of milliseconds since the program started and returns it.
What I have so far is a Timer A3, sourced from SMCLK in UP mode: Gist. (for some reason, I was unable to insert code directly here).
The problem is, that for some reason, after 5-6 uart messages, the program halts and no other millis() update is sent to the uart.
I don't know, if that is UART problem, or it has something to do with the millis implementation. But I spent two last days looking into it, following tutorials online and nothing helped. Clearly, I need second pair of eyes.
Would you please be so kind to look at the code and point to some parts, which could be wrong? Thank you in advance.