Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
#include 16C84.INC
2
 
3
	org	0
4
 
5
	goto	Start
6
	;--------------------
7
	org	4
8
	;--------------------
9
	goto	Start
10
 
11
#include Delay.asm
12
 
13
Start:
14
	page1
15
	movlw 	00000000B	; inicializace citace a prescaleru
16
	movwf	TMR0
17
	movlw 	00000000B	; konfigurace preruseni
18
	movwf	INTCON
19
 
20
	page1
21
	movlw	00000000B	; nastaveni portu na vstup nebo vystup
22
	movwf	PORTA		; 1=vstup 0=vystup
23
	movlw	01000011B
24
	movwf	PORTB
25
 
26
	bsf	TMR0, 7		; vypni pull-up na PORTB (OPTION registr)
27
 
28
	page0
29
 
30
	clrw			; vynulovani portu
31
	movwf	PORTA
32
	movwf	PORTB
33
 
34
 
35
MainLoop:
36
	movlw	255
37
	movwf	CT2
38
	movlw	252
39
	movwf	CT1
40
rozj:
41
 
42
	decf	CT1, f
43
 
44
	bsf	PORTA, 0	
45
	bcf	PORTA, 1	;100
46
	bcf	PORTA, 2
47
	call	zap
48
 
49
	bsf	PORTA, 0	;110
50
	bsf	PORTA, 1
51
	bcf	PORTA, 2
52
	call	zap
53
 
54
	bcf	PORTA, 0	;010
55
	bsf	PORTA, 1
56
	bcf	PORTA, 2
57
	call	zap
58
 
59
	decfsz	CT2, f
60
	goto	ble
61
	goto	rychle
62
 
63
ble:	bcf	PORTA, 0	;011
64
	bsf	PORTA, 1
65
	bsf	PORTA, 2
66
	call	zap
67
 
68
	bcf	PORTA, 0	;001
69
	bcf	PORTA, 1
70
	bsf	PORTA, 2
71
	call	zap
72
 
73
	bsf	PORTA, 0	;101
74
	bcf	PORTA, 1
75
	bsf	PORTA, 2
76
	call	zap
77
 
78
zap:	decfsz	
79
 
80
	movf	CT3, w
81
	movwf	xxx		;xxx promena z delay.asm
82
	call	Delay1ms
83
 
84
;----------------------------------------------------
85
rychle:
86
	bsf	PORTA, 0	
87
	bcf	PORTA, 1	;100
88
	bcf	PORTA, 2
89
	Delay	3
90
 
91
;	bsf	PORTA, 0	;110
92
;	bsf	PORTA, 1
93
;	bcf	PORTA, 2
94
;	Delay	
95
 
96
	bcf	PORTA, 0	;010
97
	bsf	PORTA, 1
98
	bcf	PORTA, 2
99
	Delay	3
100
 
101
;	bcf	PORTA, 0	;011
102
;	bsf	PORTA, 1
103
;	bsf	PORTA, 2
104
;	Delay	2
105
 
106
	bcf	PORTA, 0	;001
107
	bcf	PORTA, 1
108
	bsf	PORTA, 2
109
	Delay	3
110
 
111
;	bsf	PORTA, 0	;101
112
;	bcf	PORTA, 1
113
;	bsf	PORTA, 2
114
;	Delay	2
115
	goto	rychle
116
;______________________________________________________________
117
	movlw	250
118
	movwf	ct2
119
 
120
 
121
 
122
	decfsz	ct2
123
	goto
124
	decfsz	ct3
125
 
126
 
127
 
128
 
129
 
130
	bcf	PORTA, 2
131
	bcf	PORTA, 1
132
 
133
smycka:	
134
	btfss	PORTB, 0
135
	goto	LEDon
136
	goto	smycka
137
LEDon:
138
	bsf 	PORTA, 3	;Rozsvit LED
139
	Delay	250		
140
	bcf 	PORTA, 3	;Zhasni LED
141
	Delay	250		
142
	goto	smycka
143
	;--0-------------
144
 
145
 
146
 
147
 
148
 
149
;----------------------------
150
; Definice promenych
151
;----------------------------
152
 
153
	cblock	
154
 
155
	CT1
156
	CT2
157
	CT3
158
	CT4
159
 
160
	endc
161
 
162
	end