Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
Sinchro:
2
	bsf	PORTB, vys
3
	call	Delay10us		
4
	call	Delay10us	
5
	call	Delay10us	
6
	bcf	PORTB, vys		; 1. impuls (30us)
7
	call	Delay10us
8
	call	Delay10us
9
	call	Delay10us		
10
	bsf	PORTB, vys
11
	call	Delay10us		
12
	call	Delay10us	
13
	bcf	PORTB, vys		; 2. impuls (20us)
14
	call	Delay10us
15
	call	Delay10us			
16
	bsf	PORTB, vys
17
	call	Delay10us		
18
	bcf	PORTB, vys		; 3. impuls (10us)
19
	call	Delay10us
20
 
21
	;return
22
 
23
	;-------------------------
24
Protokol:
25
	movlw	8
26
	movwf	Bity			; nastaveni slova
27
	call	Sinchro
28
VysBit:
29
	btfss	Ramec, 0
30
	call	frek0
31
	call	frek1
32
Rotace:
33
	rrf	Ramec, f
34
	decfsz	Bity, f
35
	goto	VysBit
36
	return
37
 
38
	;-------------------------
39
frek0:
40
	movlw	60
41
	movwf	Frek
42
smycka1:
43
	bsf	PORTB, vys			; 2000 Hz	60 impulsu	
44
	Delay	50
45
	bcf	PORTB, vys
46
	Delay	50
47
	decfsz	Frek,f
48
	goto	smycka1
49
	call	Rotace		
50
	;-------------------------
51
frek1:	
52
	movlw	45
53
	movwf	Frek
54
smycka2:
55
	bsf	PORTB, vys			; 1500 Hz	45 impulsu
56
	Delay	150
57
	bcf	PORTB, vys
58
	Delay	150
59
	decfsz	Frek,f
60
	goto	smycka2
61
	call	Rotace				
62
	;-------------------------
63
 
64
 
65
;----------------------------
66
; Definice promenych
67
;----------------------------
68
 
69
	cblock	
70
 
71
	Frek
72
	Bity
73
	Ramec
74
 
75
	endc