-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathcycles.txt
58 lines (34 loc) · 1.27 KB
/
cycles.txt
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
.L2 - top of outer loop body
3 cycles to initialize inner loop (loads Z into r18 and 7 into r19)
.L3 - Inner loop body
2 cycles to lower the line
7 cycles for condition setup
2 cycles for 1 bit condition, continue below - bit is 1
3 cycles for 0 bit, and jump to .L4 - bit is 0
.LM8 - Bit is a 1: low for 1us, high for 3us
* nop block 1: 5 nops
2 cycles to raies the line
* nop block 2: 30 nops
2 cycles to jump to .L5 - end of conditional branch
L4 - Bit is a 0: low for 3us, high for 1us
* nop block 3: 36 cycles
2 cycles to raise the line
.L5 - end of conditional branch - line needs to stay high for 16 more cycles
1 cycle to subtract 1 from r19
1 cycle to continue below
2 cycles to jump to .L6 - end of outer loop body
* nop block 4: 9 nops
1 cycle to rotate bits of r18
2 cycles to jump to .L3 - top of inner loop body
.L6 - end of outer loop body
2 cycles to save r18 into Z (unnecessary)
1 cycle to subtract 1 from r20 (must be length)
1 cycle to continue below
2 cycles to go to .L7 and exit the loop
2 cycles to add 1 to r30 (Z pointer)
2 cycles to jump to .L2 - top of outer loop bodys
.L7 - end of loops, send a stop bit
* nop block 5: 4 nops
2 cycles to bring the line low
* nop block 6: 14 nops
2 cycles to bring the line high