all wait statements are timed loops. they function as long their execution is not delayed.
for example : if you use waitms 1000 in the main program, and then you have an interrupt that keeps firing and this interrupts uses a lot of time, it will delay the main code, in this case the waitms code.
So check if your ints are triggered, and how often. And more important : how much time they take.
If you need an uninterrupted precise time, you need to sacrifice a timer. it is clocked independent of interrupts.
↧