Go to most recent revision | 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, 1 ; Test kondenzatoru1
;call vibito
bsf PORTB, 3
bsf PORTB, 4
Delay 100
;bsf PORTA, 3
;Delay 250
;bcf PORTA, 3
bsf PORTA, 2
Delay 250
bcf PORTA, 2
Delay 250
Delay 250
Delay 250
Delay 250
Delay 250
bsf PORTA, 2
Delay 250
bcf PORTA, 2
;bsf PORTA, 3
;Delay 250
bcf PORTA, 3
bcf PORTB, 3
bcf PORTB, 4
Delay 250
;btfss PORTB, 6 ; 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
return
call Protokol
call MainLoop
;----------------------------
; Definice promenych
;----------------------------
cblock
volani
endc
end