Searching \ for 'help on delay rutine' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/timers.htm?key=delay
Search entire site for: 'help on delay rutine'.

Truncated match.
PICList Thread
'help on delay rutine'
1998\12\25@180902 by felix centeno

flavicon
face
part 0 2708 bytes
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi Friends I have a dude with a delay rutine and how many
cicles it take,</FONT></DIV>
<DIV><FONT size=2>this is the code: </FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>DELTX
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MOVLW&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 89H&nbsp;&nbsp;
;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
MOVWF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SERDEL1&nbsp;
;<BR>DELTX2&nbsp;&nbsp; DECFSZ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SERDEL1&nbsp;
;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
GOTO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DELTX2&nbsp;&nbsp;
;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DECFSZ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SERDEL2&nbsp;
;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
GOTO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
DELTX&nbsp;&nbsp;
;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
RETURN&nbsp;&nbsp;&nbsp; ;</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>and : can I calculate the number of cicles that take
like:</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>#cicles =&nbsp; 2 + SERDEL2*(2 + 3*SERDEL1)</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV></BODY></HTML>

</x-html>

1998\12\26@055937 by Adriano De Minicis

flavicon
face
Hi Felix,

first of all, please do not send HTML messages to this list.
Regarding your question:

> I have a dude with a delay rutine and how many cicles it take,
> this is the code:

Note that a typical loop (starting with var=N):

loop     DECFSZ    var
        GOTO      loop

executes in 3*(N-1)+2 = (3*N)-1, since the last iteration takes
2 cycles instead of 3, because "var" becomes zero, and DECFSZ skips
the GOTO.

This are the timings for your routine:

DELTX
        MOVLW     89H      ; \_ 2*SERDEL2
        MOVWF     SERDEL1  ; /

DELTX2   DECFSZ    SERDEL1  ; \_ (3*(SERDEL1-1)+2) * SERDEL2 =
        GOTO      DELTX2   ; /  = (3*SERDEL1 - 1) * SERDEL2

        DECFSZ    SERDEL2  ; \_ 3*SERDEL2 - 1
        GOTO      DELTX    ; /

        RETURN             ; 2

Total:
 (2 + 3*SERDEL1 - 1 + 3)*SERDEL2 - 1 + 2 =
= (4 + 3*SERDEL1)*SERDEL2 + 1

Note: In the above code the initialization of SERDEL2 is missing.

Adriano

1998\12\28@102429 by lilel

flavicon
face
Felix Wrote
> Hi Friends I have a dude with a delay rutine and how many cicles it
> take, this is the code:

I assume you want some help on this - not clear from your message.
Here goes:

>
> DELTX
>               MOVLW         89H   ;         ;
>               MOVWF        SERDEL1  ;
> DELTX2   DECFSZ       SERDEL1  ;
>               GOTO           DELTX2   ;
 >               DECFSZ        SERDEL2  ;
>               GOTO            DELTX   ;
>               RETURN    ;

> and : can I calculate the number of cicles that take like:
>
> #cicles =  2 + SERDEL2*(2 + 3*SERDEL1)

Looks good to me.   There was just a thread on this last week. This
code was posted as an alternativethat could be changed to give the
delay you want:

{Quote hidden}

-- Lawrence Lile

=> Median Filter Source Code
=> AutoCad blocks for electrical drafting
=> Brownout tester plans
=> Amateurish pictures of my family

at:  http://home1.gte.net/llile/index.htm

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...