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
 
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	11110111B
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	; Rozsvit LED
32
 
33
	bsf	PORTB, 3	; Pridrz napajeni
34
 
35
MainLoop:
36
	call	Delay250ms
37
	bcf	PORTB, 3	
38
	bcf	PORTA, 3	
39
	call	Delay250ms
40
	bsf	PORTB, 3	
41
	bsf	PORTA, 3	
42
 
43
	goto	MainLoop
44
	;---------------
45
 
46
;--- Spozdeni 250ms ----
47
Delay250ms:
48
	movlw	100		; 2,5 ms
49
	movwf	CT2
50
Delay250:
51
	movlw	250		; 2,5 ms
52
	movwf	CT1
53
	call	Delay10us
54
 
55
	decfsz	CT2, 1
56
	goto	Delay250
57
	return
58
 
59
;--- Spozdeni v nasobcich 10us ----
60
Delay10us:			; Prodleva (CT1 * 10us)+3us
61
	nop	
62
	nop
63
	nop
64
	nop
65
	nop
66
	nop
67
	nop
68
	decfsz	CT1, 1
69
	goto	Delay10us
70
	return
71
 
72
#include SERVO.INC
73
 
74
	end