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
zap:
14
	movf	CT2, w
15
	movwf	xxx		;xxx promena z delay.asm
16
	call	Delay1ms
17
	return
18
;----------------------------------------------------
19
 
20
Start:
21
	page1
22
	movlw 	00000000B	; inicializace citace a prescaleru
23
	movwf	TMR0
24
	movlw 	00000000B	; konfigurace preruseni
25
	movwf	INTCON
26
 
27
	page1
28
	movlw	00000000B	; nastaveni portu na vstup nebo vystup
29
	movwf	PORTA		; 1=vstup 0=vystup
30
	movlw	01000011B
31
	movwf	PORTB
32
 
33
	bsf	TMR0, 7		; vypni pull-up na PORTB (OPTION registr)
34
 
35
	page0
36
 
37
	clrw			; vynulovani portu
38
	movwf	PORTA
39
	movwf	PORTB
40
 
41
 
42
MainLoop:
43
;	movlw	50		; Otacky
44
;	movwf	CT2
45
;	movlw	45		; Pocet kroku zrychleni
46
;	movwf	CT1
47
;rozj2:	
48
;	decf	CT2, f
49
 
50
 
51
	movlw	250		; Pocet otacek jednoho kroku zrychleni
52
	movwf	CT3
53
 
54
	movlw	150
55
	movwf	CT4
56
 
57
	movlw	200
58
	movwf	CT5
59
 
60
	movlw	250
61
	movwf	CT5
62
 
63
rozj:				; Rozjezd
64
	bsf	PORTA, 0	
65
	bcf	PORTA, 1	;100
66
	bcf	PORTA, 2
67
	Delay	5
68
 
69
;	call	zap
70
 
71
	bsf	PORTA, 0	;110
72
	bsf	PORTA, 1
73
	bcf	PORTA, 2
74
	Delay	5
75
 
76
	bcf	PORTA, 0	;010
77
	bsf	PORTA, 1
78
	bcf	PORTA, 2
79
	Delay	4
80
 
81
	bcf	PORTA, 0	;011
82
	bsf	PORTA, 1
83
	bsf	PORTA, 2
84
	Delay	4
85
 
86
	bcf	PORTA, 0	;001
87
	bcf	PORTA, 1
88
	bsf	PORTA, 2
89
	Delay	3
90
 
91
	bsf	PORTA, 0	;101
92
	bcf	PORTA, 1
93
	bsf	PORTA, 2
94
	Delay	3
95
 
96
	decfsz	CT3, f
97
	goto	rozj
98
 
99
;	decfsz	CT1, f
100
;	goto	rozj2
101
;	goto	rozj
102
 
103
rychle:
104
	bsf	PORTA, 0	
105
	bcf	PORTA, 1	;100
106
	bcf	PORTA, 2
107
	Delay	2
108
 
109
	movlw	0
110
	movwf	PORTA
111
	Delay	3
112
 
113
	bcf	PORTA, 0	;010
114
	bsf	PORTA, 1
115
	bcf	PORTA, 2
116
	Delay	2
117
 
118
	movlw	0
119
	movwf	PORTA
120
	Delay	3
121
 
122
	bcf	PORTA, 0	;001
123
	bcf	PORTA, 1
124
	bsf	PORTA, 2
125
	Delay	2
126
 
127
	movlw	0
128
	movwf	PORTA
129
	Delay	3
130
 
131
	decfsz	CT4, f
132
	goto	rychle
133
 
134
rychle2:
135
 
136
	bsf	PORTA, 0	
137
	bcf	PORTA, 1	;100
138
	bcf	PORTA, 2
139
	Delay	1
140
 
141
	movlw	0
142
	movwf	PORTA
143
	Delay	3
144
 
145
	bcf	PORTA, 0	;010
146
	bsf	PORTA, 1
147
	bcf	PORTA, 2
148
	Delay	1
149
 
150
	movlw	0
151
	movwf	PORTA
152
	Delay	3
153
 
154
	bcf	PORTA, 0	;001
155
	bcf	PORTA, 1
156
	bsf	PORTA, 2
157
	Delay	1
158
 
159
	movlw	0
160
	movwf	PORTA
161
	Delay	3
162
	decfsz	CT5, f
163
	goto	rychle2
164
 
165
rychle3:
166
	bsf	PORTA, 0	
167
	bcf	PORTA, 1	;100
168
	bcf	PORTA, 2
169
	Delay	1
170
 
171
	movlw	0
172
	movwf	PORTA
173
	Delay	2
174
 
175
	bcf	PORTA, 0	;010
176
	bsf	PORTA, 1
177
	bcf	PORTA, 2
178
	Delay	1
179
 
180
	movlw	0
181
	movwf	PORTA
182
	Delay	2
183
 
184
	bcf	PORTA, 0	;001
185
	bcf	PORTA, 1
186
	bsf	PORTA, 2
187
	Delay	1
188
 
189
	movlw	0
190
	movwf	PORTA
191
	Delay	2
192
;	decfsz	CT3, f
193
	goto	rychle3
194
 
195
;rychle4:
196
;	bsf	PORTA, 0	
197
;	bcf	PORTA, 1	;100
198
;	bcf	PORTA, 2
199
;	Delay	1
200
;
201
;	movlw	0
202
;	movwf	PORTA
203
;	Delay	1
204
;
205
;	bcf	PORTA, 0	;010
206
;	bsf	PORTA, 1
207
;	bcf	PORTA, 2
208
;	Delay	1
209
;
210
;	movlw	0
211
;	movwf	PORTA
212
;	Delay	1
213
;
214
;	bcf	PORTA, 0	;001
215
;	bcf	PORTA, 1
216
;	bsf	PORTA, 2
217
;	Delay	1
218
;
219
;	movlw	0
220
;	movwf	PORTA
221
;	Delay	1
222
;
223
;	goto	rychle4
224
 
225
;______________________________________________________________
226
 
227
;----------------------------
228
; Definice promenych
229
;----------------------------
230
 
231
	cblock	
232
 
233
	CT1
234
	CT2
235
	CT3
236
	CT4
237
	CT5
238
	CT6
239
	endc
240
 
241
	end