Subversion Repositories svnkaklik

Rev

Go to most recent revision | Blame | Last modification | View Log | Download

Sinchro:
        bsf     PORTB, vys
        call    Delay10us               
        call    Delay10us       
        call    Delay10us       
        bcf     PORTB, vys              ; 1. impuls (30us)
        call    Delay10us
        call    Delay10us
        call    Delay10us               
        bsf     PORTB, vys
        call    Delay10us               
        call    Delay10us       
        bcf     PORTB, vys              ; 2. impuls (20us)
        call    Delay10us
        call    Delay10us                       
        bsf     PORTB, vys
        call    Delay10us               
        bcf     PORTB, vys              ; 3. impuls (10us)
        call    Delay10us
        
        ;return

        ;-------------------------
Protokol:
        movlw   8
        movwf   Bity                    ; nastaveni slova
        call    Sinchro
VysBit:
        btfss   Ramec, 0
        call    frek0
        call    frek1
Rotace:
        rrf     Ramec, f
        decfsz  Bity, f
        goto    VysBit
        return

        ;-------------------------
frek0:
        movlw   60
        movwf   Frek
smycka1:
        bsf     PORTB, vys                      ; 2000 Hz       60 impulsu      
        Delay   50
        bcf     PORTB, vys
        Delay   50
        decfsz  Frek,f
        goto    smycka1
        call    Rotace          
        ;-------------------------
frek1:  
        movlw   45
        movwf   Frek
smycka2:
        bsf     PORTB, vys                      ; 1500 Hz       45 impulsu
        Delay   150
        bcf     PORTB, vys
        Delay   150
        decfsz  Frek,f
        goto    smycka2
        call    Rotace                          
        ;-------------------------


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

        cblock  
        
        Frek
        Bity
        Ramec
        
        endc