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 10:57, local time: 2022/8/18 04:14,
|©2022 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?|
<A HREF="http://www.massmind.org/Techref/microchip/delay/8b1cr20m-aw.htm"> PIC Microcontoller Delay Method - Delay X cycles (20-271) inclusive </A>
|Did you find what you needed?|
Welcome to massmind.org!
Welcome to www.massmind.org!