Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
;--- Macro na spozdeni 1ms az 255ms ---
2
Delay	macro	ms
3
	movlw	ms
4
	movwf	CT2
5
	call	Delay1ms	
6
	endm
7
 
8
;--- Macro na spozdeni 0,1ms az 2,5ms (10-250) ---
9
Delay01	macro	us
10
	movlw	us
11
	movwf	CT1
12
	call	us10
13
 
14
	nop
15
	nop			; Z duvodu vyrovnani poctu potrebnych taktu jako na Delay1ms
16
	nop
17
	return	
18
	endm
19
;--- Spozdeni v nasobcich 1ms+2us ----
20
 
21
Delay1ms:
22
	movlw	99		; 1 ms
23
	movwf	CT1		; goto 2 takty decfsz 1 kdyz 1 jinak 2
24
	call	us10
25
 
26
	decfsz	CT2, f
27
	goto	Delay1ms
28
	nop
29
;---------------------------------
30
	return			;2us
31
 
32
;--- Spozdeni v nasobcich 10us ----
33
us10:			; Prodleva (CT1 * 10us)
34
	nop	
35
	nop
36
	nop
37
	nop
38
	nop
39
	nop
40
	nop
41
	decfsz	CT1, f
42
	goto	us10
43
	nop
44
	return
45
	;-------------------------
46
 
47
;----------------------------
48
; Definice promenych
49
;----------------------------
50
 
51
	cblock	
52
 
53
	CT1
54
	CT2
55
 
56
	endc
57