0,0 → 1,59 |
;Pro krystal 4Mhz |
|
;--- Macro na spozdeni 1ms az 255ms --- |
Delay macro ms |
movlw ms |
movwf xxx |
call Delay1ms |
endm |
|
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) --- |
Delay01 macro us |
movlw us |
movwf yyy |
call Delay10us |
|
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 yyy ; goto 2 takty decfsz 1 kdyz 1 jinak 2 |
call Delay10us |
|
decfsz xxx, f |
goto Delay1ms |
nop |
;--------------------------------- |
return ;2us |
|
;--- Spozdeni v nasobcich 10us ---- |
Delay10us: ; Prodleva (CT1 * 10us) |
nop |
nop |
nop |
nop |
nop |
nop |
nop |
decfsz yyy, f |
goto Delay10us |
nop |
return |
;------------------------- |
|
;---------------------------- |
; Definice promenych |
;---------------------------- |
|
cblock |
|
yyy |
xxx |
|
endc |
|