-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelay_routines.inc
67 lines (64 loc) · 992 Bytes
/
delay_routines.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* delay_routines.inc
*
* Created: 25-Dec-22 09:34:51
* Author: janos
*/
wait_1000ms:
push r17
push r18
push r19
; Assembly code auto-generated
; by utility from Bret Mulvey
; Delay 20 000 000 cycles
; 1s at 20 MHz
ldi r17, 102
ldi r18, 118
ldi r19, 194
L1000ms: dec r19
brne L1000ms
dec r18
brne L1000ms
dec r17
brne L1000ms
pop r19
pop r18
pop r17
ret
wait_20ms:
push r17
push r18
push r19
; Assembly code auto-generated
; by utility from Bret Mulvey
; Delay 400 000 cycles
; 20ms at 20 MHz
ldi r17, 3
ldi r18, 8
ldi r19, 120
L20ms: dec r19
brne L20ms
dec r18
brne L20ms
dec r17
brne L20ms
pop r19
pop r18
pop r17
ret
wait_1ms:
push r17
push r18
; Assembly code auto-generated
; by utility from Bret Mulvey
; Delay 20 000 cycles
; 1ms at 20 MHz
ldi r17, 26
ldi r18, 249
L1ms: dec r18
brne L1ms
dec r17
brne L1ms
pop r18
pop r17
ret