Go to most recent revision | Blame | Last modification | View Log | Download
;--- Macro na spozdeni 1ms az 255ms ---
Delay macro ms
movlw ms
movwf CT2
call Delay1ms
endm
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
Delay01 macro us
movlw us
movwf CT1
call us10
nop
nop ; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
nop
return
endm
;--- Spozdeni v nasobcich 1ms+2us ----
Delay1ms:
movlw 99 ; 1 ms
movwf CT1 ; goto 2 takty decfsz 1 kdyz 1 jinak 2
call us10
decfsz CT2, f
goto Delay1ms
nop
;---------------------------------
return ;2us
;--- Spozdeni v nasobcich 10us ----
us10: ; Prodleva (CT1 * 10us)
nop
nop
nop
nop
nop
nop
nop
decfsz CT1, f
goto us10
nop
return
;-------------------------
;----------------------------
; Definice promenych
;----------------------------
cblock
CT1
CT2
endc