PDA

View Full Version : explaining timing routines



BobM
- 22nd April 2008, 04:11
Hi there
Could some kind person explain the logic behind the following code.........
---------------------------------------------------------------------
wait_1us ; 1 microsecond delay
nop ;wait 1 microsecond
return

wait_xus ; x microsecond delay
label
call wait_1us ;call wait_1us subroutine
decfsz xus,1 ;decrement xus (until zero)
goto label ;if not zero, repeat until it is !
return
--------------------------------------------------------------------
Thank you

precision
- 22nd April 2008, 06:25
see example

http://home.comcast.net/~aa0zz-3/PIC-EL-II/628diag.asm

BobM
- 22nd April 2008, 07:46
Thanks 'Precision' - exactly what I needed
Bob