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
	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
 
44
	movlw	250		; Pocet otacek jednoho kroku zrychleni
45
	movwf	CT3
46
 
47
	movlw	170
48
	movwf	CT4
49
 
50
	movlw	150
51
	movwf	CT5
52
 
53
	movlw	250
54
	movwf	CT5
55
 
56
rozj:				; Rozjezd
57
	bsf	PORTA, 0	
58
	bcf	PORTA, 1	;100
59
	bcf	PORTA, 2
60
	Delay	6
61
 
62
 
63
	bsf	PORTA, 0	;110
64
	bsf	PORTA, 1
65
	bcf	PORTA, 2
66
	Delay	6
67
 
68
	bcf	PORTA, 0	;010
69
	bsf	PORTA, 1
70
	bcf	PORTA, 2
71
	Delay	5
72
 
73
	bcf	PORTA, 0	;011
74
	bsf	PORTA, 1
75
	bsf	PORTA, 2
76
	Delay	5
77
 
78
	bcf	PORTA, 0	;001
79
	bcf	PORTA, 1
80
	bsf	PORTA, 2
81
	Delay	5
82
 
83
	bsf	PORTA, 0	;101
84
	bcf	PORTA, 1
85
	bsf	PORTA, 2
86
	Delay	5
87
 
88
	decfsz	CT3, f
89
	goto	rozj
90
 
91
 
92
rychle:
93
	bsf	PORTA, 0	
94
	bcf	PORTA, 1	;100
95
	bcf	PORTA, 2
96
	Delay	3
97
 
98
	movlw	0
99
	movwf	PORTA
100
	Delay	5
101
 
102
	bcf	PORTA, 0	;010
103
	bsf	PORTA, 1
104
	bcf	PORTA, 2
105
	Delay	3
106
 
107
	movlw	0
108
	movwf	PORTA
109
	Delay	5
110
 
111
	bcf	PORTA, 0	;001
112
	bcf	PORTA, 1
113
	bsf	PORTA, 2
114
	Delay	3
115
 
116
	movlw	0
117
	movwf	PORTA
118
	Delay	5
119
 
120
	decfsz	CT4, f
121
	goto	rychle
122
 
123
rychle2:
124
 
125
	bsf	PORTA, 0	
126
	bcf	PORTA, 1	;100
127
	bcf	PORTA, 2
128
	Delay	3
129
 
130
	movlw	0
131
	movwf	PORTA
132
	Delay	3
133
 
134
	bcf	PORTA, 0	;010
135
	bsf	PORTA, 1
136
	bcf	PORTA, 2
137
	Delay	3
138
 
139
	movlw	0
140
	movwf	PORTA
141
	Delay	3
142
 
143
	bcf	PORTA, 0	;001
144
	bcf	PORTA, 1
145
	bsf	PORTA, 2
146
	Delay	3
147
 
148
	movlw	0
149
	movwf	PORTA
150
	Delay	3
151
	decfsz	CT5, f
152
	goto	rychle2
153
 
154
rychle3:
155
	bsf	PORTA, 0	
156
	bcf	PORTA, 1	;100
157
	bcf	PORTA, 2
158
	Delay	3
159
 
160
	movlw	0
161
	movwf	PORTA
162
	Delay	2
163
 
164
	bcf	PORTA, 0	;010
165
	bsf	PORTA, 1
166
	bcf	PORTA, 2
167
	Delay	3
168
 
169
	movlw	0
170
	movwf	PORTA
171
	Delay	2
172
 
173
	bcf	PORTA, 0	;001
174
	bcf	PORTA, 1
175
	bsf	PORTA, 2
176
	Delay	3
177
 
178
	movlw	0
179
	movwf	PORTA
180
	Delay	2
181
	decfsz	CT3, f
182
	goto	rychle3
183
 
184
rychle4:
185
	bsf	PORTA, 0	
186
	bcf	PORTA, 1	;100
187
	bcf	PORTA, 2
188
	Delay	2
189
 
190
	movlw	0
191
	movwf	PORTA
192
	Delay	2
193
 
194
	bcf	PORTA, 0	;010
195
	bsf	PORTA, 1
196
	bcf	PORTA, 2
197
	Delay	2
198
 
199
	movlw	0
200
	movwf	PORTA
201
	Delay	2
202
 
203
	bcf	PORTA, 0	;001
204
	bcf	PORTA, 1
205
	bsf	PORTA, 2
206
	Delay	2
207
 
208
	movlw	0
209
	movwf	PORTA
210
	Delay	2
211
 
212
	goto	rychle4
213
;______________________________________________________________
214
 
215
;----------------------------
216
; Definice promenych
217
;----------------------------
218
 
219
	cblock	
220
 
221
	CT1
222
	CT2
223
	CT3
224
	CT4
225
	CT5
226
	CT6
227
	endc
228
 
229
	end