Subversion Repositories svnkaklik

Rev

Blame | Last modification | View Log | Download

#include 16C84.INC

        org     0

        goto    Start
        ;--------------------
        org     4
        ;--------------------
        goto    Start

#include Delay.asm
        
zap:
        movf    CT2, w
        movwf   xxx             ;xxx promena z delay.asm
        call    Delay1ms
        return
;----------------------------------------------------

Start:
        page1
        movlw   00000000B       ; inicializace citace a prescaleru
        movwf   TMR0
        movlw   00000000B       ; konfigurace preruseni
        movwf   INTCON

        page1
        movlw   00000000B       ; nastaveni portu na vstup nebo vystup
        movwf   PORTA           ; 1=vstup 0=vystup
        movlw   01000011B
        movwf   PORTB

        bsf     TMR0, 7         ; vypni pull-up na PORTB (OPTION registr)

        page0

        clrw                    ; vynulovani portu
        movwf   PORTA
        movwf   PORTB
        

MainLoop:
;       movlw   50              ; Otacky
;       movwf   CT2
;       movlw   45              ; Pocet kroku zrychleni
;       movwf   CT1
;rozj2: 
;       decf    CT2, f


        movlw   250             ; Pocet otacek jednoho kroku zrychleni
        movwf   CT3
        
        movlw   150
        movwf   CT4

        movlw   200
        movwf   CT5

        movlw   250
        movwf   CT5

rozj:                           ; Rozjezd
        bsf     PORTA, 0        
        bcf     PORTA, 1        ;100
        bcf     PORTA, 2
        Delay   5
        
;       call    zap

        bsf     PORTA, 0        ;110
        bsf     PORTA, 1
        bcf     PORTA, 2
        Delay   5

        bcf     PORTA, 0        ;010
        bsf     PORTA, 1
        bcf     PORTA, 2
        Delay   4

        bcf     PORTA, 0        ;011
        bsf     PORTA, 1
        bsf     PORTA, 2
        Delay   4

        bcf     PORTA, 0        ;001
        bcf     PORTA, 1
        bsf     PORTA, 2
        Delay   3

        bsf     PORTA, 0        ;101
        bcf     PORTA, 1
        bsf     PORTA, 2
        Delay   3

        decfsz  CT3, f
        goto    rozj

;       decfsz  CT1, f
;       goto    rozj2
;       goto    rozj

rychle:
        bsf     PORTA, 0        
        bcf     PORTA, 1        ;100
        bcf     PORTA, 2
        Delay   2

        movlw   0
        movwf   PORTA
        Delay   3

        bcf     PORTA, 0        ;010
        bsf     PORTA, 1
        bcf     PORTA, 2
        Delay   2

        movlw   0
        movwf   PORTA
        Delay   3

        bcf     PORTA, 0        ;001
        bcf     PORTA, 1
        bsf     PORTA, 2
        Delay   2

        movlw   0
        movwf   PORTA
        Delay   3

        decfsz  CT4, f
        goto    rychle

rychle2:

        bsf     PORTA, 0        
        bcf     PORTA, 1        ;100
        bcf     PORTA, 2
        Delay   1

        movlw   0
        movwf   PORTA
        Delay   3

        bcf     PORTA, 0        ;010
        bsf     PORTA, 1
        bcf     PORTA, 2
        Delay   1

        movlw   0
        movwf   PORTA
        Delay   3

        bcf     PORTA, 0        ;001
        bcf     PORTA, 1
        bsf     PORTA, 2
        Delay   1

        movlw   0
        movwf   PORTA
        Delay   3
        decfsz  CT5, f
        goto    rychle2

rychle3:
        bsf     PORTA, 0        
        bcf     PORTA, 1        ;100
        bcf     PORTA, 2
        Delay   1

        movlw   0
        movwf   PORTA
        Delay   2

        bcf     PORTA, 0        ;010
        bsf     PORTA, 1
        bcf     PORTA, 2
        Delay   1

        movlw   0
        movwf   PORTA
        Delay   2

        bcf     PORTA, 0        ;001
        bcf     PORTA, 1
        bsf     PORTA, 2
        Delay   1

        movlw   0
        movwf   PORTA
        Delay   2
;       decfsz  CT3, f
        goto    rychle3

;rychle4:
;       bsf     PORTA, 0        
;       bcf     PORTA, 1        ;100
;       bcf     PORTA, 2
;       Delay   1
;
;       movlw   0
;       movwf   PORTA
;       Delay   1
;
;       bcf     PORTA, 0        ;010
;       bsf     PORTA, 1
;       bcf     PORTA, 2
;       Delay   1
;
;       movlw   0
;       movwf   PORTA
;       Delay   1
;
;       bcf     PORTA, 0        ;001
;       bcf     PORTA, 1
;       bsf     PORTA, 2
;       Delay   1
;
;       movlw   0
;       movwf   PORTA
;       Delay   1
;
;       goto    rychle4

;______________________________________________________________

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

        cblock  

        CT1
        CT2
        CT3
        CT4
        CT5
        CT6
        endc

        end