Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
#include 16C84.INC
2
 
3
vys	EQU	1	;vystupni portB protokol.asm
4
C1	EQU	2	;pripojeni C1 na port B
5
C2	EQU	3	;ptipojeni C2 na port B
6
 
7
	org	0
8
 
9
	goto	Start
10
	;--------------------
11
	org	4
12
	;--------------------
13
	goto	Start
14
 
15
#include Delay.asm
16
#include Protokol.asm
17
Start:
18
	page1
19
	movlw 	00000000B	; inicializace citace a prescaleru
20
	movwf	TMR0
21
	movlw 	00000000B	; konfigurace preruseni
22
	movwf	INTCON
23
 
24
	page1
25
	movlw	11110011B	; nastaveni portu na vstup nebo vystup
26
	movwf	PORTA		; 1=vstup 0=vystup
27
	movlw	11110001B
28
	movwf	PORTB
29
 
30
	bsf	TMR0, 7		; vypni pull-up na PORTB (OPTION registr)
31
 
32
	page0
33
 
34
	clrw			; vynulovani portu
35
	movwf	PORTA
36
	movwf	PORTB
37
 
38
	bsf	PORTA, 3	; Pull-Up na tlacitka
39
 
40
	bcf	PORTB, 1	; zhasnuti LED
41
	bcf	PORTB, 2
42
	bcf	PORTB, 3
43
 
44
MainLoop:
45
	movlw	2
46
	movwf	volani		; Nastavi pocet volani procedury vybito	
47
	bsf	PORTB, C1	; Nabiti kondenzatoru1
48
	bsf	PORTB, C2	; Nabiti kondenzatoru2
49
dal:
50
	;btfss	PORTA, 1	; Test kondenzatoru1
51
	;call	vibito
52
	bsf	PORTB, 3
53
	bsf	PORTB, 4
54
	Delay	100
55
	;bsf	PORTA, 3
56
	;Delay	250
57
	;bcf	PORTA, 3
58
 
59
	bsf	PORTA, 2
60
	Delay	250
61
	bcf	PORTA, 2
62
 
63
	Delay	250
64
	Delay	250
65
	Delay	250
66
	Delay	250
67
	Delay	250
68
 
69
	bsf	PORTA, 2
70
	Delay	250
71
	bcf	PORTA, 2
72
 
73
	;bsf	PORTA, 3
74
	;Delay	250
75
	bcf	PORTA, 3
76
 
77
	bcf	PORTB, 3
78
	bcf	PORTB, 4
79
 	Delay	250
80
	;btfss	PORTB, 6	; Test kondenzatoru2
81
	;call	vibito
82
	;incf	Ramec, f
83
	;goto	dal
84
	goto 	MainLoop
85
	;---------------
86
 
87
vibito:
88
	movlw	4
89
	movwf	CT1				; uvolneni mista
90
zapis:	
91
	rlf	Ramec, f
92
	decfsz	CT1, f
93
	goto	zapis
94
	decfsz	volani, f
95
	return
96
	call	Protokol
97
	call	MainLoop
98
 
99
 
100
;----------------------------
101
; Definice promenych
102
;----------------------------
103
 
104
	cblock	
105
 
106
	volani
107
 
108
	endc
109
 
110
	end