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: 2008/7/20 14:06,
38.103.63.16:LOG IN
|
| ©2008 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! <A HREF="http://www.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? |
|
o List host: MIT, Site host massmind.org, Top posters @20080720 Apptech, Jinx, Xiaofan Chen, olin piclist, Alan B. Pearce, David VanHorn, William \Chops\ Westfield, Tamas Rudnai, Cedric Chang, bean, * 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: Shultz Electronics, Timothy Weber, on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
|
.