Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
#include 16C84.INC
2
 
3
PRYJM	EQU	0		;portb
4
 
5
	org	0
6
 
7
	goto	Start
8
	;--------------------
9
	org	4
10
	;--------------------
11
	goto	Start
12
 
13
#include delay.asm
14
 
15
 
16
Start:
17
	page1
18
	movlw 	00101000B	; inicializace citace a prescaleru
19
	movwf	TMR0
20
	movlw 	00000000B	; konfigurace preruseni
21
	movwf	INTCON
22
 
23
	page1
24
	movlw	11110111B	; nastaveni portu na vstup nebo vystup
25
	movwf	PORTA		; 1=vstup 0=vystup
26
	movlw	11110001B
27
	movwf	PORTB
28
 
29
	;bsf	TMR0, 7		; vypni pull-up na PORTB (OPTION registr)
30
 
31
	page0
32
 
33
	clrw			; vynulovani portu
34
	movwf	PORTA
35
	movwf	PORTB
36
 
37
	bsf	PORTA, 3	; Pull-Up na tlacitka
38
 
39
	bcf	PORTB, 1	; zhasnuti LED
40
	bcf	PORTB, 2
41
	bcf	PORTB, 3
42
 
43
MainLoop:
44
	btfss	PORTB, PRYJM	;cekani na impuls1
45
	goto 	MainLoop
46
 
47
	call	Delay10us
48
	call	Delay10us
49
 
50
	btfss	PORTB, PRYJM	;potvrzeni impulsu1
51
	goto 	MainLoop
52
 
53
	call	Delay10us
54
	call	Delay10us
55
smycka:
56
	btfsc	PORTB, PRYJM
57
	goto 	smycka
58
				;sinchronizace
59
	call	Delay10us
60
 
61
smycka1:			;2impuls
62
	btfss	PORTB, PRYJM			
63
	goto	smycka1
64
	call	Delay10us	
65
 
66
smycka2:
67
	btfss	PORTB, PRYJM
68
	goto 	MainLoop
69
 
70
mezera2:
71
	btfsc	PORTB, PRYJM
72
	goto	mezera2
73
 
74
impuls3:
75
	btfss	PORTB, PRYJM
76
	goto	impuls3
77
 
78
mezera3:
79
	btfsc	PORTB, PRYJM
80
	goto	mezera3
81
 
82
	call	Delay10ms
83
	clrf	TMR0
84
	Delay
85
 
86
	;-------------------------
87
 
88
;----------------------------
89
; Definice promenych
90
;----------------------------
91
 
92
	cblock	
93
 
94
	CT1
95
	CT2
96
 
97
	endc
98
 
99
	end