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	CT1
38
	movlw	252
39
	movwf	CT2
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:
79
	movf	CT1, w
80
	movwf	xxx		;xxx promena z delay.asm
81
	call	Delay1ms
82
 
83
;----------------------------------------------------
84
rychle:
85
	bsf	PORTA, 0	
86
	bcf	PORTA, 1	;100
87
	bcf	PORTA, 2
88
	Delay	3
89
 
90
;	bsf	PORTA, 0	;110
91
;	bsf	PORTA, 1
92
;	bcf	PORTA, 2
93
;	Delay	
94
 
95
	bcf	PORTA, 0	;010
96
	bsf	PORTA, 1
97
	bcf	PORTA, 2
98
	Delay	3
99
 
100
;	bcf	PORTA, 0	;011
101
;	bsf	PORTA, 1
102
;	bsf	PORTA, 2
103
;	Delay	2
104
 
105
	bcf	PORTA, 0	;001
106
	bcf	PORTA, 1
107
	bsf	PORTA, 2
108
	Delay	3
109
 
110
;	bsf	PORTA, 0	;101
111
;	bcf	PORTA, 1
112
;	bsf	PORTA, 2
113
;	Delay	2
114
	goto	rychle
115
;______________________________________________________________
116
 
117
	bcf	PORTA, 2
118
	bcf	PORTA, 1
119
 
120
smycka:	
121
	btfss	PORTB, 0
122
	goto	LEDon
123
	goto	smycka
124
LEDon:
125
	bsf 	PORTA, 3	;Rozsvit LED
126
	Delay	250		
127
	bcf 	PORTA, 3	;Zhasni LED
128
	Delay	250		
129
	goto	smycka
130
	;---------------
131
 
132
 
133
 
134
 
135
 
136
;----------------------------
137
; Definice promenych
138
;----------------------------
139
 
140
	cblock	
141
 
142
	CT1
143
	CT2
144
 
145
	endc
146
 
147
	end