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
 
10
Start:
11
	page1
12
	movlw 	00000000B	; inicializace citace a prescaleru
13
	movwf	TMR0
14
	movlw 	00000000B	; konfigurace preruseni
15
	movwf	INTCON
16
 
17
	page1
18
	movlw	11110111B	; nastaveni portu na vstup nebo vystup
19
	movwf	PORTA		; 1=vstup 0=vystup
20
	movlw	11110001B
21
	movwf	PORTB
22
 
23
	bsf	TMR0, 7		; vypni pull-up na PORTB (OPTION registr)
24
 
25
	page0
26
 
27
	clrw			; vynulovani portu
28
	movwf	PORTA
29
	movwf	PORTB
30
 
31
	bsf	PORTA, 3	; Pull-Up na tlacitka
32
 
33
	bcf	PORTB, 1	; zhasnuti LED
34
	bcf	PORTB, 2
35
	bcf	PORTB, 3
36
 
37
MainLoop:
38
				;prodleva 10ms
39
 
40
	movlw	250		; 2,5 ms
41
	movwf	CT10
42
	call	Delay10us
43
	movlw	250		; 2,5 ms
44
	movwf	CT10
45
	call	Delay10us
46
	movlw	250		; 2,5 ms
47
	movwf	CT10
48
	call	Delay10us
49
	movlw	250		; 2,5 ms
50
	movwf	CT10
51
	call	Delay10us
52
 
53
	bsf	PORTB, 1	; ON
54
 
55
	movlw	150
56
 
57
	btfss	PORTA, 1	; Test TL1
58
	movlw	100
59
 
60
	btfss	PORTB, 6	; Test TL2
61
	movlw	200
62
 
63
	movwf	CT10
64
	call	Delay10us	
65
 
66
	bcf	PORTB, 1	; OFF
67
 
68
 
69
	bcf	PORTB, 2	; zhasnuti LED
70
	bcf	PORTB, 3
71
 
72
	btfss	PORTA, 1	; Test TL1
73
	bsf	PORTB, 2	; rozsviceni LED2
74
 
75
	btfss	PORTB, 6	; Test TL2
76
	bsf	PORTB, 3	; rozsviceni LED2
77
 
78
	goto	MainLoop
79
	;---------------
80
 
81
Delay10us:			; Prodleva (DELAY10 * 10us)+3us
82
	nop	
83
	nop
84
	nop
85
	nop
86
	nop
87
	nop
88
	nop
89
	decfsz	CT10, 1
90
	goto	Delay10us
91
	return
92
 
93
#include SERVO.INC
94
 
95
	end