-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlayout.s
82 lines (80 loc) · 1.62 KB
/
layout.s
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
irq_handler: ; 4 cycles
ld ZL, r30 ; 2
ld ZH, r31 ; 2
ijmp ; 2
input_change_handler: ; 4 cycles
rjmp keyboard_handler
graphics_driver:
timer_interrupt_handler:
row
column
write_column_data:
75 rows; 9900 cycles -->
write_row_data:
500 cycles ->
100 x {
ld r, Z+ ; 2
ori r, 3 ; Set hsync vsync 1
out PORTA, r ; 1
nop ; 1
}
25 cycles -> # front porch
ldi r, 3 ; 1
out PORTA, r ; 1
nop x 23
80 cycles -> # sync
ldi r, 2 ; 1
out PORTA, r ; 1
nop x 78
55 cycles -> # back porch
ldi r, 3 ; 1
out PORTA, r ; 1
nop x 53
write_front_porch:
1 row: 660 cycles --->
525 cycles -> # data + front porch h
ldi r, 3 ; 1
out PORTA, r ; 1
# MAKE MACRO
ld r31, low(return_front_porch) ; 1
ld r30, hi(return_front_porch) ; 1
set timer to 525 - 18
reti ; 4
# 10 instructions return
return_front_porch:
80 cycles -> # sync
ldi r, 2 ; 1
out PORTA, r ; 1
nop x 78
55 cycles -> # back porch
ldi r, 3 ; 1
out PORTA, r ; 1
nop x 53
write_vsync:
4 row: 2640 cycles --->
525 cycles -> # data + front porch h
ldi r, 2 ; 1
out PORTA, r ; 1
nop x 523
80 cycles -> # hsync
ldi r, 0 ; 1
out PORTA, r ; 1
nop x 78
55 cycles -> # back porch h
ldi r, 2 ; 1
out PORTA, r ; 1
nop x 53
back_porch_vsync
23 row: 15180 cycles --->
525 cycles ->
ldi r, 3 ; 1
out PORTA, r ; 1
nop x 523
80 cycles -> # hsync
ldi r, 2 ; 1
out PORTA, r ; 1
nop x 78
55 cycles -> # back porch h
ldi r, 3 ; 1
out PORTA, r ; 1
nop x 53