| 0/2548 |
From Dwayne Reid
;10 bit delay routine providing 1 cycle resolution. Works with both 12 & 14 bit core PICs.
;Original idea from Mike Harrison. This version by Dwayne Reid
;
;enters with upper 8 bits of delay in DELAYU, lower 2 bits in bits 1,0 of DELAYL
;bits 7..2 in DELAYL can be used as flags for whatever purpose desired.
;returns with W destroyed
Delay10bit ;delay is 10 bit value + 7 cycles ( + call + return, if any)
incf DELAYU,F ;correct for dec & test instead of test & dec
Dly10bLoop
comf DELAYL,W ;invert LSBs
decfsz DELAYU,F
goto Dly10bLoop ;coarse delay to closest 4 cycles
andlw b'00000011'
addwf PCL,F
nop
nop
nop
| file: /techref/microchip/delay/10b1cr15m-dr.htm, 1KB, , updated: 2001/1/10 15:37, local time: 2008/7/4 13: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/10b1cr15m-dr.htm"> PIC Microcontoller Delay Method - Delay X cycles (7-1031) exclusive</A> |
| Did you find what you needed? |
|
o List host: MIT, Site host massmind.org, Top posters @20080704 Apptech, Jinx, Xiaofan Chen, David VanHorn, Alan B. Pearce, Bob Axtell, William \Chops\ Westfield, Cedric Chang, Gerhard Fiedler, 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, Larry Williams, David VanHorn, Bryan Whitehouse, Timothy Weber, David Challis. Peter Todd. on-going support is MOST appreciated! * Contributors: Neil Narwani, David Cary, Elemer AM Nyiry, Philip J Taylor, Gus Calabrese of Omegadogs.com, Gautama Venegas, Patrick B. Murphy, William Chops Westfield, Peter Todd, Leslie Ellis |
|
.