Suspends program execution for a given time in mS.
The number of milliseconds to wait. (1-65535)
No accurate timing is possible with this command.
In addition, the use of interrupts can slow this routine.
WaitMS will call the routine _WAITMS. R24 and R25 are loaded with the number of milliseconds to wait.
Uses and saves R30 and R31.
Depending on the used XTAL the asm code can look like :
Push R30 ; save Z
Ldi R30,$E8 ; delay for 1 mS
Sbiw R30,1 ; -1
Brne _WaitMS_2 ; until 1 mS is ticked away
Brne _WaitMS_1 ; for number of mS
WAITMS 10 ' wait for 10 mS