init of new files (of hdw tank project + some small mods, more to come
[my-code/atmel.git] / led_plex / main.asm
1 ; main file of led_plex project
2 ;
3 ; author: hackbard@hackdaworld.org
4 ;
5
6 ; device specific definition file
7 .include "../include/tn2313def.inc"
8
9 ; defines
10 .def    tmp1            = r16
11 .def    tmp2            = r17
12 .def    uart_rxtx       = r18
13
14 ;
15 ; interrupts
16 ;
17
18 ; RESET
19 rjmp INIT
20
21 ; INT0
22 reti
23
24 ; INT1
25 reti
26
27 ; T1 CAPT1
28 reti
29
30 ; T1 COMP A
31 reti
32
33 ; T1 OVF1
34 rjmp T1_OVF1
35
36 ; T0 OVF0
37 rjmp T0_OVF0
38
39 ; UART RX
40 rjmp UART_RX
41
42 ; UART UDRE
43 reti
44
45 ; UART TX
46 reti
47
48 ; ANA COMP
49 reti
50
51 ; PCINT
52 reti
53
54 ; T1 COMP B
55 reti
56
57 ; T0 COMP A
58 reti
59
60 ; T0 COMP B
61 reti
62
63 ; USI START
64 reti
65
66 ; USI OVF
67 reti
68
69 ; EE READY
70 reti
71
72 ; WDT OVF
73 reti
74
75
76 ; include control defines
77 .include "ctrl.def"
78
79 RESET:
80 INIT:
81
82         ; port init
83         rcall PORT_INIT
84
85         ; timer init
86         rcall TIMER_INIT
87
88         ; uart init
89         rcall UART_INIT
90
91         ; uart interrupt enable
92         rcall UART_INT_RX_INIT
93
94         ; set stackpointer
95         ldi tmp1,low(RAMEND)
96         out SPL,tmp1
97
98         ; global interrupt enable
99         ;sei 
100
101         ; signal ready output
102         ldi uart_rxtx,0x23
103         rcall UART_TX
104
105 MAIN:
106
107         ; loop forever
108         rjmp MAIN
109
110
111 ; include subroutines
112 .include "port.asm"
113 .include "timer.asm"
114 .include "uart.asm"
115
116
117 ;
118 ; interrupt routines
119 ;
120
121 T1_OVF1:
122         reti
123
124 T0_OVF0:
125         reti
126
127 UART_RX:
128         reti
129