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	150
48
	movwf	CT4
49
 
50
	movlw	200
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	5
61
 
62
 
63
	bsf	PORTA, 0	;110
64
	bsf	PORTA, 1
65
	bcf	PORTA, 2
66
	Delay	5
67
 
68
	bcf	PORTA, 0	;010
69
	bsf	PORTA, 1
70
	bcf	PORTA, 2
71
	Delay	4
72
 
73
	bcf	PORTA, 0	;011
74
	bsf	PORTA, 1
75
	bsf	PORTA, 2
76
	Delay	4
77
 
78
	bcf	PORTA, 0	;001
79
	bcf	PORTA, 1
80
	bsf	PORTA, 2
81
	Delay	3
82
 
83
	bsf	PORTA, 0	;101
84
	bcf	PORTA, 1
85
	bsf	PORTA, 2
86
	Delay	3
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	2
97
 
98
	movlw	0
99
	movwf	PORTA
100
	Delay	3
101
 
102
	bcf	PORTA, 0	;010
103
	bsf	PORTA, 1
104
	bcf	PORTA, 2
105
	Delay	2
106
 
107
	movlw	0
108
	movwf	PORTA
109
	Delay	3
110
 
111
	bcf	PORTA, 0	;001
112
	bcf	PORTA, 1
113
	bsf	PORTA, 2
114
	Delay	2
115
 
116
	movlw	0
117
	movwf	PORTA
118
	Delay	3
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	1
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	1
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	1
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	1
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	1
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	1
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	1
189
;
190
;	movlw	0
191
;	movwf	PORTA
192
;	Delay	1
193
;
194
;	bcf	PORTA, 0	;010
195
;	bsf	PORTA, 1
196
;	bcf	PORTA, 2
197
;	Delay	1
198
;
199
;	movlw	0
200
;	movwf	PORTA
201
;	Delay	1
202
;
203
;	bcf	PORTA, 0	;001
204
;	bcf	PORTA, 1
205
;	bsf	PORTA, 2
206
;	Delay	1
207
;
208
;	movlw	0
209
;	movwf	PORTA
210
;	Delay	1
211
;
212
;	goto	rychle4
213
 
214
;______________________________________________________________
215
 
216
;----------------------------
217
; Definice promenych
218
;----------------------------
219
 
220
	cblock	
221
 
222
	CT1
223
	CT2
224
	CT3
225
	CT4
226
	CT5
227
	CT6
228
	endc
229
 
230
	end