Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

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