Subversion Repositories svnkaklik

Rev

Blame | Last modification | View Log | Download

#include 16C84.INC

vys     EQU     1       ;vystupni portB protokol.asm
C1      EQU     2       ;pripojeni C1 na port B
C2      EQU     3       ;ptipojeni C2 na port B

        org     0

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

#include Delay.asm
#include Protokol.asm
Start:
        page1
        movlw   00000000B       ; inicializace citace a prescaleru
        movwf   TMR0
        movlw   00000000B       ; konfigurace preruseni
        movwf   INTCON

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

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

        page0

        clrw                    ; vynulovani portu
        movwf   PORTA
        movwf   PORTB

        bsf     PORTA, 3        ; Pull-Up na tlacitka

        bcf     PORTB, 1        ; zhasnuti LED
        bcf     PORTB, 2
        bcf     PORTB, 3

MainLoop:
        movlw   2
        movwf   volani          ; Nastavi pocet volani procedury vybito 
        bsf     PORTB, C1       ; Nabiti kondenzatoru1
        bsf     PORTB, C2       ; Nabiti kondenzatoru2
dal:
        btfss   PORTA, C1       ; Test kondenzatoru1
        call    vibito

        btfss   PORTB, C2       ; Test kondenzatoru2
        call    vibito

        incf    Ramec, f
        goto    dal
        goto    MainLoop
        ;---------------

vibito:
        movlw   4
        movwf   CT1             ; uvolneni mista
zapis:  
        rlf     Ramec, f
        decfsz  CT1, f
        goto    zapis
        decfsz  volani, f

        call    Protokol

        goto    MainLoop


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

        cblock  

        volani
        CT1

        endc

        end