From Swordfish Wiki

SwordfishUser: UMCUserCodeDelayLoop

 [USERCODE]

 ;======================
 ; delay loop
 ;======================
 ; used for powerup delay, pll turn on, etc
 ;#define DELAY_LOOP 1

 #ifdef DELAY_LOOP
 errorlevel -207             ; disable 'label not in column 1 warning'
 #define START_DELAY 200
 #define DelayCount Index    ; alias Index as DelayCount

    movlw   START_DELAY
    movwf   DelayCount
    movlw   0
 MsDelayLoop:
    addlw   1
    bnz     MsDelayLoop     ; 3 cycles x 256 = 768 cycles
    decfsz  DelayCount      ; START_DELAY * 768 instruction cycles total (approx)
    goto    MsDelayLoop
 #endif
Retrieved from https://www.sfcompiler.co.uk/wiki/pmwiki.php?n=SwordfishUser.UMCUserCodeDelayLoop
Page last modified on August 21, 2011, at 01:06 PM