Subversion Repositories svnkaklik

Rev

Go to most recent revision | 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
	;-------------------------
33
Rotace:
34
	rrf	Ramec, f
35
	decfsz	Bity, f
36
	goto	VysBit
37
	return
38
 
39
	;-------------------------
40
frek0:
41
	movlw	60
42
	movwf	Frek
43
smycka1:
44
	bsf	PORTB, vys			; 2000 Hz	60 impulsu	
45
	Delay	50
46
	bcf	PORTB, vys
47
	Delay	50
48
	decfsz	Frek,f
49
	goto	smycka1
50
	goto	Rotace		
51
	;-------------------------
52
frek1:	
53
	movlw	45
54
	movwf	Frek
55
smycka2:
56
	bsf	PORTB, vys			; 1500 Hz	45 impulsu
57
	Delay	150
58
	bcf	PORTB, vys
59
	Delay	150
60
	decfsz	Frek,f
61
	goto	smycka2
62
	goto	Rotace				
63
	;-------------------------
64
 
65
 
66
;----------------------------
67
; Definice promenych
68
;----------------------------
69
 
70
	cblock	
71
 
72
	Frek
73
	Bity
74
	Ramec
75
 
76
	endc