forked from spqr/umichmoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathport1_isr.asm
292 lines (269 loc) · 10.2 KB
/
port1_isr.asm
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
///////////////////////////////////////////////////////////////////////////////
// /
// IAR C/C++ Compiler V5.10.6.50180/W32 for MSP430 03/Aug/2012 15:07:53 /
// Copyright 1996-2010 IAR Systems AB. /
// /
// __rt_version = 3 /
// __double_size = 32 /
// __reg_r4 = regvar /
// __reg_r5 = regvar /
// __pic = no /
// __core = 430X /
// __data_model = small /
// Source file = C:\Documents and Settings\Addison /
// Mayberry\Desktop\moofirmwaredev\build_port1_isr.c /
// Command line = "C:\Documents and Settings\Addison /
// Mayberry\Desktop\moofirmwaredev\build_port1_isr.c" /
// -lcN "C:\Documents and Settings\Addison /
// Mayberry\Desktop\moofirmwaredev\Debug\List\" -la /
// "C:\Documents and Settings\Addison /
// Mayberry\Desktop\moofirmwaredev\Debug\List\" -o /
// "C:\Documents and Settings\Addison /
// Mayberry\Desktop\moofirmwaredev\Debug\Obj\" --no_cse /
// --no_unroll --no_inline --no_code_motion --no_tbaa /
// --debug -D__MSP430F2618__ -e --double=32 /
// --dlib_config "C:\Program Files\IAR Systems\Embedded /
// Workbench 6.0\430\LIB\DLIB\dl430xsfn.h" --regvar_r4 /
// --regvar_r5 --core=430X --data_model=small -Ol /
// --multiplier=16s /
// List file = C:\Documents and Settings\Addison /
// Mayberry\Desktop\moofirmwaredev\Debug\List\build_port1 /
// _isr.s43 /
// /
// /
///////////////////////////////////////////////////////////////////////////////
NAME port1_isr
RTMODEL "__SystemLibrary", "DLib"
RTMODEL "__core", "430X"
RTMODEL "__data_model", "small"
RTMODEL "__double_size", "32"
RTMODEL "__pic", "no"
RTMODEL "__reg_r4", "regvar"
RTMODEL "__reg_r5", "regvar"
RTMODEL "__rt_version", "3"
RSEG CSTACK:DATA:SORT:NOROOT(0)
PUBWEAK `??Port1_ISR??INTVEC 36`
PUBWEAK P1IE
PUBWEAK P1IES
PUBWEAK P1IFG
PUBWEAK P1SEL
PUBLIC Port1_ISR
FUNCTION Port1_ISR,080233H
ARGFRAME CSTACK, 0, STACK
LOCFRAME CSTACK, 4, STACK
PUBWEAK TACCTL1
PUBWEAK TAR
PUBLIC port1_isr_decls
FUNCTION port1_isr_decls,0201H
ARGFRAME CSTACK, 0, STACK
LOCFRAME CSTACK, 4, STACK
CFI Names cfiNames0
CFI StackFrame CFA SP DATA
CFI Resource PC:20, SP:20, SR:16, R4L:16, R4H:4, R4:20, R5L:16, R5H:4
CFI Resource R5:20, R6L:16, R6H:4, R6:20, R7L:16, R7H:4, R7:20, R8L:16
CFI Resource R8H:4, R8:20, R9L:16, R9H:4, R9:20, R10L:16, R10H:4
CFI Resource R10:20, R11L:16, R11H:4, R11:20, R12L:16, R12H:4, R12:20
CFI Resource R13L:16, R13H:4, R13:20, R14L:16, R14H:4, R14:20, R15L:16
CFI Resource R15H:4, R15:20
CFI ResourceParts R4 R4H, R4L
CFI ResourceParts R5 R5H, R5L
CFI ResourceParts R6 R6H, R6L
CFI ResourceParts R7 R7H, R7L
CFI ResourceParts R8 R8H, R8L
CFI ResourceParts R9 R9H, R9L
CFI ResourceParts R10 R10H, R10L
CFI ResourceParts R11 R11H, R11L
CFI ResourceParts R12 R12H, R12L
CFI ResourceParts R13 R13H, R13L
CFI ResourceParts R14 R14H, R14L
CFI ResourceParts R15 R15H, R15L
CFI EndNames cfiNames0
CFI Common cfiCommon0 Using cfiNames0
CFI CodeAlign 2
CFI DataAlign 2
CFI ReturnAddress PC CODE
CFI CFA SP+4
CFI PC Frame(CFA, -4)
CFI SR Undefined
CFI R4L SameValue
CFI R4H 0
CFI R4 Concat
CFI R5L SameValue
CFI R5H 0
CFI R5 Concat
CFI R6L SameValue
CFI R6H 0
CFI R6 Concat
CFI R7L SameValue
CFI R7H 0
CFI R7 Concat
CFI R8L SameValue
CFI R8H 0
CFI R8 Concat
CFI R9L SameValue
CFI R9H 0
CFI R9 Concat
CFI R10L SameValue
CFI R10H 0
CFI R10 Concat
CFI R11L SameValue
CFI R11H 0
CFI R11 Concat
CFI R12L Undefined
CFI R12H Undefined
CFI R12 Undefined
CFI R13L Undefined
CFI R13H Undefined
CFI R13 Undefined
CFI R14L Undefined
CFI R14H Undefined
CFI R14 Undefined
CFI R15L Undefined
CFI R15H Undefined
CFI R15 Undefined
CFI EndCommon cfiCommon0
CFI Common cfiCommon1 Using cfiNames0
CFI CodeAlign 2
CFI DataAlign 2
CFI ReturnAddress PC CODE
CFI CFA SP+4
CFI PC or(add(CFA, literal(-4)), lshift(add(CFA, literal(-2)), 4))
CFI SR Frame(CFA, -4)
CFI R4L SameValue
CFI R4H 0
CFI R4 Concat
CFI R5L SameValue
CFI R5H 0
CFI R5 Concat
CFI R6L SameValue
CFI R6H 0
CFI R6 Concat
CFI R7L SameValue
CFI R7H 0
CFI R7 Concat
CFI R8L SameValue
CFI R8H 0
CFI R8 Concat
CFI R9L SameValue
CFI R9H 0
CFI R9 Concat
CFI R10L SameValue
CFI R10H 0
CFI R10 Concat
CFI R11L SameValue
CFI R11H 0
CFI R11 Concat
CFI R12L SameValue
CFI R12H 0
CFI R12 Concat
CFI R13L SameValue
CFI R13H 0
CFI R13 Concat
CFI R14L SameValue
CFI R14H 0
CFI R14 Concat
CFI R15L SameValue
CFI R15H 0
CFI R15 Concat
CFI EndCommon cfiCommon1
Port1_ISR SYMBOL "Port1_ISR"
`??Port1_ISR??INTVEC 36` SYMBOL "??INTVEC 36", Port1_ISR
EXTERN delimiterNotFound
ASEGN DATA16_AN:DATA:NOROOT,023H
// unsigned char volatile P1IFG
P1IFG:
DS8 1
ASEGN DATA16_AN:DATA:NOROOT,024H
// unsigned char volatile P1IES
P1IES:
DS8 1
ASEGN DATA16_AN:DATA:NOROOT,025H
// unsigned char volatile P1IE
P1IE:
DS8 1
ASEGN DATA16_AN:DATA:NOROOT,026H
// unsigned char volatile P1SEL
P1SEL:
DS8 1
ASEGN DATA16_AN:DATA:NOROOT,0164H
// unsigned short volatile TACCTL1
TACCTL1:
DS8 2
ASEGN DATA16_AN:DATA:NOROOT,0170H
// unsigned short volatile TAR
TAR:
DS8 2
// This is needed to make the inline assembly compile properly w/ these symbols
RSEG CODE:CODE:REORDER:NOROOT(1)
port1_isr_decls:
CFI Block cfiBlock0 Using cfiCommon0
CFI Function port1_isr_decls
MOV.B &0x25, R14
MOV.W &0x164, R15
MOV.B &0x26, R13
MOV.B &0x24, R12
RETA
CFI EndBlock cfiBlock0
REQUIRE P1IE
REQUIRE TACCTL1
REQUIRE P1SEL
REQUIRE P1IES
//*************************************************************************
//************************ PORT 1 INTERRUPT *******************************
// warning : Whenever the clock frequency changes, the value of TAR should be
// changed in aesterick lines
// Pin Setup : P1.2
// Description : Port 1 interrupt is used as finding delimeter.
RSEG ISR_CODE:CODE:REORDER:NOROOT(1)
Port1_ISR:
CFI Block cfiBlock1 Using cfiCommon1
CFI Function Port1_ISR // (5-6 cycles) to enter interrupt
MOV TAR, R7 // move TAR to R7(count) register (3 CYCLES)
MOV.B #0x0, &0x23 // 4 cycles, clear P1IFG
MOV.W #0x0, &0x170 // 4 cycles, TAR = 0
BIC.W #0xf0, 0(SP) // Change status register so we leave low
// power mode 4 when exit interrupt
CMP #0000h, R5 // if (bits == 0) (1 cycle)
JEQ bit_Is_Zero_In_Port_Int // 2 cycles
// bits != 0:
MOV #0000h, R5 // bits = 0 (1 cycles)
CMP #0010h, R7 // finding delimeter (12.5us, 2 cycles)
// 2d -> 14
JNC delimiter_Value_Is_wrong //(2 cycles)
CMP #0040h, R7 // finding delimeter (12.5us, 2 cycles)
// 43H
JC delimiter_Value_Is_wrong
CLR P1IE
BIS #8010h, TACCTL1 // (5 cycles) TACCTL1 |= CM1 + CCIE
MOV #0004h, P1SEL // enable TimerA1 (4 cycles)
RETI
delimiter_Value_Is_wrong:
BIC #0004h, P1IES
MOV #0000h, R5 // bits = 0 (1 cycles)
MOV.B #0x1, &delimiterNotFound
RETI
bit_Is_Zero_In_Port_Int: // bits == 0
MOV #0000h, TAR // reset timer (4 cycles)
BIS #0004h, P1IES // 4 cycles change port interrupt edge to neg
INC R5 // 1 cycle
RETI
CFI EndBlock cfiBlock1
REQUIRE P1IFG
REQUIRE TAR
COMMON INTVEC:CONST:ROOT(1)
ORG 36
`??Port1_ISR??INTVEC 36`:
DC16 Port1_ISR
END
//
// 18 bytes in segment CODE
// 8 bytes in segment DATA16_AN
// 2 bytes in segment INTVEC
// 78 bytes in segment ISR_CODE
//
// 96 bytes of CODE memory
// 0 bytes of CONST memory (+ 2 bytes shared)
// 0 bytes of DATA memory (+ 8 bytes shared)
//
//Errors: none
//Warnings: none