please dont rip this site

PIC Microcontoller Delay Method

Delay X cycles (20-271) inclusive

From Andrew Warren

    ; This routine delays X cycles.  Enter with X (in the range
    ; [20-271]) in the W register.
    ;
    ; Note that the delay is inclusive of the "MOVLW X", "CALL
    ; DELAY", and "RETURN" overhead, so a sequence like:
    ;
    ;     MOVLW   100
    ;     CALL    DELAY
    ;     MOVLW   200
    ;     CALL    DELAY
    ;
    ; will delay EXACTLY 300 cycles.

    DELAY:

        MOVWF   COUNTER

        BTFSC   COUNTER, 0
        GOTO    $+1

        BTFSS   COUNTER, 1
        GOTO    SKIP
        NOP
        GOTO    $+1

    SKIP:

        RRF     COUNTER
        RRF     COUNTER

        MOVLW   4
        SUBWF   COUNTER

        BCF     COUNTER,6
        BCF     COUNTER,7

    LOOP:

        NOP
        DECFSZ  COUNTER
        GOTO    LOOP

        RETURN


file: /Techref/microchip/delay/8b1cr20m-aw.htm, 1KB, , updated: 2003/10/15 09:57, local time: 2024/12/26 19:32,
TOP NEW HELP FIND: 
3.149.25.26:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/Techref/microchip/delay/8b1cr20m-aw.htm"> PIC Microcontoller Delay Method - Delay X cycles (20-271) inclusive </A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .