Quote Originally Posted by pxidr84 View Post
Hi Steve,

It works quite good, but I cannot exeed 65 seconds (because 66*1000=66000, 16-bit integer is overflowed).
But, more importantly, I want to integrate the loop in a low priority DT interrupt. I really don't understand how you're using flags, etc. (I'm a beginner lol).

Thanks
Use a long for your variable - you'll have to work hard to overflow 32 bits.