Subversion Repositories svnkaklik

Rev

Blame | Last modification | View Log | Download

;--- 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    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   yyy             ; goto 2 takty decfsz 1 kdyz 1 jinak 2
        call    us10

        decfsz  xxx, f
        goto    Delay1ms
        nop
;---------------------------------
        return                  ;2us

;--- Spozdeni v nasobcich 10us ----
us10:                   ; Prodleva (CT1 * 10us)
        nop     
        nop
        nop
        nop
        nop
        nop
        nop
        decfsz  yyy, f
        goto    us10
        nop
        return
        ;-------------------------

;----------------------------
; Definice promenych
;----------------------------

        cblock  

        yyy
        xxx

        endc