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, C1	; Test kondenzatoru1
51
	call	vibito
52
 
53
	btfss	PORTB, C2	; Test kondenzatoru2
54
	call	vibito
55
 
56
	incf	Ramec, f
57
	goto	dal
58
	goto 	MainLoop
59
	;---------------
60
 
61
vibito:
62
	movlw	4
63
	movwf	CT1		; uvolneni mista
64
zapis:	
65
	rlf	Ramec, f
66
	decfsz	CT1, f
67
	goto	zapis
68
	decfsz	volani, f
69
 
70
	call	Protokol
71
 
72
	goto	MainLoop
73
 
74
 
75
;----------------------------
76
; Definice promenych
77
;----------------------------
78
 
79
	cblock	
80
 
81
	volani
82
	CT1
83
 
84
	endc
85
 
86
	end