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/5/16 18:35,
|©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://piclist.com/techref/microchip/delay/8b1cr20m-aw.htm"> PIC Microcontoller Delay Method - Delay X cycles (20-271) inclusive </A>
|Did you find what you needed?|
PICList 2022 contributors:
o List host: MIT, Site host massmind.org, Top posters @20220516
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to piclist.com!