OpenCores
URL https://opencores.org/ocsvn/openmsp430/openmsp430/trunk

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [core/] [sim/] [rtl_sim/] [src/] [tA_capture.s43] - Blame information for rev 204

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 olivier.gi
/*===========================================================================*/
2
/* Copyright (C) 2001 Authors                                                */
3
/*                                                                           */
4
/* This source file may be used and distributed without restriction provided */
5
/* that this copyright statement is not removed from the file and that any   */
6
/* derivative work contains the original copyright notice and the associated */
7
/* disclaimer.                                                               */
8
/*                                                                           */
9
/* This source file is free software; you can redistribute it and/or modify  */
10
/* it under the terms of the GNU Lesser General Public License as published  */
11
/* by the Free Software Foundation; either version 2.1 of the License, or    */
12
/* (at your option) any later version.                                       */
13
/*                                                                           */
14
/* This source is distributed in the hope that it will be useful, but WITHOUT*/
15
/* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or     */
16
/* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public       */
17
/* License for more details.                                                 */
18
/*                                                                           */
19
/* You should have received a copy of the GNU Lesser General Public License  */
20
/* along with this source; if not, write to the Free Software Foundation,    */
21
/* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA        */
22
/*                                                                           */
23
/*===========================================================================*/
24
/*                                  TIMER A                                  */
25
/*---------------------------------------------------------------------------*/
26
/* Test the timer A:                                                         */
27
/*                        - Check the timer capture unit.                    */
28 18 olivier.gi
/*                                                                           */
29
/* Author(s):                                                                */
30
/*             - Olivier Girard,    olgirard@gmail.com                       */
31
/*                                                                           */
32
/*---------------------------------------------------------------------------*/
33 19 olivier.gi
/* $Rev: 204 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2015-07-08 22:34:10 +0200 (Wed, 08 Jul 2015) $          */
36 2 olivier.gi
/*===========================================================================*/
37
 
38 141 olivier.gi
.include "pmem_defs.asm"
39
 
40 2 olivier.gi
.global main
41
 
42
WAIT_FUNC:
43
        dec r14
44
        jnz WAIT_FUNC
45
        ret
46 204 olivier.gi
 
47 2 olivier.gi
main:
48 111 olivier.gi
        mov  #DMEM_250, r1      ; # Initialize stack pointer
49
        mov  #0x0000, &DMEM_200
50 2 olivier.gi
        mov  #0x0000, r15
51
 
52
       /* --------------   TIMER A TEST:  INPUT MUX (CCI) ----------------- */
53
 
54
        mov  #0x0200, &TACTL
55
        mov  #0x0000, &TACCTL0
56
        mov  #0x0000, &TACCTL1
57
        mov  #0x0000, &TACCTL2
58
        dint
59
 
60
                                ; # --------- Comparator 0 ----------
61
        mov  #0x0204, &TACTL
62
        mov  #0x0000, &TACCR0
63
        mov  #0x0000, &TACCTL0  ; # CCIxA
64 111 olivier.gi
        mov  #0x0001, &DMEM_200
65 204 olivier.gi
        nop
66
        nop
67 111 olivier.gi
        mov &TACCTL0, &DMEM_202
68
        mov  #0x0002, &DMEM_200
69 204 olivier.gi
        nop
70
        nop
71 111 olivier.gi
        mov &TACCTL0, &DMEM_204
72
        mov  #0x0003, &DMEM_200
73 2 olivier.gi
 
74
        mov  #0x1000, &TACCTL0  ; # CCIxB
75 111 olivier.gi
        mov  #0x0004, &DMEM_200
76 204 olivier.gi
        nop
77
        nop
78 111 olivier.gi
        mov &TACCTL0, &DMEM_202
79
        mov  #0x0005, &DMEM_200
80 204 olivier.gi
        nop
81
        nop
82 111 olivier.gi
        mov &TACCTL0, &DMEM_204
83
        mov  #0x0006, &DMEM_200
84 2 olivier.gi
 
85
        mov  #0x2000, &TACCTL0  ; # GND
86 111 olivier.gi
        mov  #0x0007, &DMEM_200
87
        mov &TACCTL0, &DMEM_202
88
        mov  #0x0008, &DMEM_200
89
        mov &TACCTL0, &DMEM_204
90
        mov  #0x0009, &DMEM_200
91 2 olivier.gi
 
92
        mov  #0x3000, &TACCTL0  ; # VDD
93 111 olivier.gi
        mov  #0x000A, &DMEM_200
94
        mov &TACCTL0, &DMEM_202
95
        mov  #0x000B, &DMEM_200
96
        mov &TACCTL0, &DMEM_204
97
        mov  #0x000C, &DMEM_200
98 2 olivier.gi
 
99
                                ; # --------- Comparator 1 ----------
100
        mov  #0x0204, &TACTL
101
        mov  #0x0000, &TACCR1
102
        mov  #0x0000, &TACCTL1  ; # CCIxA
103 111 olivier.gi
        mov  #0x0011, &DMEM_200
104 204 olivier.gi
        nop
105
        nop
106 111 olivier.gi
        mov &TACCTL1, &DMEM_202
107
        mov  #0x0012, &DMEM_200
108 204 olivier.gi
        nop
109
        nop
110 111 olivier.gi
        mov &TACCTL1, &DMEM_204
111
        mov  #0x0013, &DMEM_200
112 2 olivier.gi
 
113
        mov  #0x1000, &TACCTL1  ; # CCIxB
114 111 olivier.gi
        mov  #0x0014, &DMEM_200
115 204 olivier.gi
        nop
116
        nop
117 111 olivier.gi
        mov &TACCTL1, &DMEM_202
118
        mov  #0x0015, &DMEM_200
119 204 olivier.gi
        nop
120
        nop
121 111 olivier.gi
        mov &TACCTL1, &DMEM_204
122
        mov  #0x0016, &DMEM_200
123 2 olivier.gi
 
124
        mov  #0x2000, &TACCTL1  ; # GND
125 111 olivier.gi
        mov  #0x0017, &DMEM_200
126
        mov &TACCTL1, &DMEM_202
127
        mov  #0x0018, &DMEM_200
128
        mov &TACCTL1, &DMEM_204
129
        mov  #0x0019, &DMEM_200
130 2 olivier.gi
 
131
        mov  #0x3000, &TACCTL1  ; # VDD
132 111 olivier.gi
        mov  #0x001A, &DMEM_200
133
        mov &TACCTL1, &DMEM_202
134
        mov  #0x001B, &DMEM_200
135
        mov &TACCTL1, &DMEM_204
136
        mov  #0x001C, &DMEM_200
137 2 olivier.gi
 
138
                                ; # --------- Comparator 2 ----------
139
        mov  #0x0204, &TACTL
140
        mov  #0x0000, &TACCR2
141
        mov  #0x0000, &TACCTL2  ; # CCIxA
142 111 olivier.gi
        mov  #0x0021, &DMEM_200
143 204 olivier.gi
        nop
144
        nop
145 111 olivier.gi
        mov &TACCTL2, &DMEM_202
146
        mov  #0x0022, &DMEM_200
147 204 olivier.gi
        nop
148
        nop
149 111 olivier.gi
        mov &TACCTL2, &DMEM_204
150
        mov  #0x0023, &DMEM_200
151 2 olivier.gi
 
152
        mov  #0x1000, &TACCTL2  ; # CCIxB
153 111 olivier.gi
        mov  #0x0024, &DMEM_200
154 204 olivier.gi
        nop
155
        nop
156 111 olivier.gi
        mov &TACCTL2, &DMEM_202
157
        mov  #0x0025, &DMEM_200
158 204 olivier.gi
        nop
159
        nop
160 111 olivier.gi
        mov &TACCTL2, &DMEM_204
161
        mov  #0x0026, &DMEM_200
162 2 olivier.gi
 
163
        mov  #0x2000, &TACCTL2  ; # GND
164 111 olivier.gi
        mov  #0x0027, &DMEM_200
165
        mov &TACCTL2, &DMEM_202
166
        mov  #0x0028, &DMEM_200
167
        mov &TACCTL2, &DMEM_204
168
        mov  #0x0029, &DMEM_200
169 2 olivier.gi
 
170
        mov  #0x3000, &TACCTL2  ; # VDD
171 111 olivier.gi
        mov  #0x002A, &DMEM_200
172
        mov &TACCTL2, &DMEM_202
173
        mov  #0x002B, &DMEM_200
174
        mov &TACCTL2, &DMEM_204
175
        mov  #0x002C, &DMEM_200
176 2 olivier.gi
 
177 204 olivier.gi
 
178
        dint
179 111 olivier.gi
        mov  #0x0000, &DMEM_200
180 2 olivier.gi
        mov  #0x1000, r15
181
 
182
       /* --------------   TIMER A TEST:  CAPTURE, EDGE SELECTION AND INTERRUPT ----------------- */
183
 
184
        mov  #0x0200, &TACTL
185
        mov  #0x0000, &TACCTL0
186
        mov  #0x0000, &TACCTL1
187
        mov  #0x0000, &TACCTL2
188
        dint
189
 
190
                                ; # --------- Comparator 0 ----------
191
        mov  #0x0204, &TACTL
192
        mov  #0x1234, &TAR
193
        mov  #0x0110, &TACCTL0  ; # No capture, Interrupt enable
194
        mov  #0x0000, &TACCR0
195 111 olivier.gi
        mov  #0x0001, &DMEM_200
196 2 olivier.gi
        nop
197
        nop
198 111 olivier.gi
        mov  &TACCR0, &DMEM_202
199 2 olivier.gi
        mov  #0x0110, &TACCTL0  ; # No capture, Interrupt enable
200
        mov  #0x0000, &TACCR0
201 111 olivier.gi
        mov  #0x0002, &DMEM_200
202 2 olivier.gi
        nop
203
        nop
204 111 olivier.gi
        mov  &TACCR0, &DMEM_204
205 2 olivier.gi
        mov  #0x0000, &TACCTL0
206 111 olivier.gi
        mov  #0x0003, &DMEM_200
207 204 olivier.gi
 
208 2 olivier.gi
        mov  #0x0204, &TACTL
209
        mov  #0x1234, &TAR
210
        mov  #0x4110, &TACCTL0  ; # Rising edge, Interrupt enable
211
        mov  #0x0000, &TACCR0
212 111 olivier.gi
        mov  #0x0004, &DMEM_200
213 2 olivier.gi
        nop
214
        nop
215 111 olivier.gi
        mov  &TACCR0, &DMEM_202
216 2 olivier.gi
        mov  #0x4110, &TACCTL0  ; # Rising edge, Interrupt enable
217
        mov  #0x0000, &TACCR0
218 111 olivier.gi
        mov  #0x0005, &DMEM_200
219 2 olivier.gi
        nop
220
        nop
221 111 olivier.gi
        mov  &TACCR0, &DMEM_204
222 2 olivier.gi
        mov  #0x0000, &TACCTL0
223 111 olivier.gi
        mov  #0x0006, &DMEM_200
224 204 olivier.gi
 
225 2 olivier.gi
        mov  #0x0204, &TACTL
226
        mov  #0x1234, &TAR
227
        mov  #0x8110, &TACCTL0  ; # Falling edge, Interrupt enable
228
        mov  #0x0000, &TACCR0
229 111 olivier.gi
        mov  #0x0007, &DMEM_200
230 2 olivier.gi
        nop
231
        nop
232 111 olivier.gi
        mov  &TACCR0, &DMEM_202
233 2 olivier.gi
        mov  #0x8110, &TACCTL0  ; # Falling edge, Interrupt enable
234
        mov  #0x0000, &TACCR0
235 111 olivier.gi
        mov  #0x0008, &DMEM_200
236 2 olivier.gi
        nop
237
        nop
238 111 olivier.gi
        mov  &TACCR0, &DMEM_204
239 2 olivier.gi
        mov  #0x0000, &TACCTL0
240 111 olivier.gi
        mov  #0x0009, &DMEM_200
241 204 olivier.gi
 
242 2 olivier.gi
        mov  #0x0204, &TACTL
243
        mov  #0x1234, &TAR
244
        mov  #0xC110, &TACCTL0  ; # Rising/Falling edge, Interrupt enable
245
        mov  #0x0000, &TACCR0
246 111 olivier.gi
        mov  #0x000A, &DMEM_200
247 2 olivier.gi
        nop
248
        nop
249 111 olivier.gi
        mov  &TACCR0, &DMEM_202
250 2 olivier.gi
        mov  #0xC110, &TACCTL0  ; # Rising/Falling edge, Interrupt enable
251
        mov  #0x0000, &TACCR0
252 111 olivier.gi
        mov  #0x000B, &DMEM_200
253 2 olivier.gi
        nop
254
        nop
255 111 olivier.gi
        mov  &TACCR0, &DMEM_204
256 2 olivier.gi
        mov  #0x0000, &TACCTL0
257 111 olivier.gi
        mov  #0x000C, &DMEM_200
258 2 olivier.gi
 
259 204 olivier.gi
 
260 2 olivier.gi
                                ; # --------- Comparator 1 ----------
261
        mov  #0x0204, &TACTL
262
        mov  #0x1234, &TAR
263
        mov  #0x0110, &TACCTL1  ; # No capture, Interrupt enable
264
        mov  #0x0000, &TACCR1
265 111 olivier.gi
        mov  #0x0001, &DMEM_200
266 2 olivier.gi
        nop
267
        nop
268 111 olivier.gi
        mov  &TACCR1, &DMEM_202
269 2 olivier.gi
        mov  #0x0110, &TACCTL1  ; # No capture, Interrupt enable
270
        mov  #0x0000, &TACCR1
271 111 olivier.gi
        mov  #0x0002, &DMEM_200
272 2 olivier.gi
        nop
273
        nop
274 111 olivier.gi
        mov  &TACCR1, &DMEM_204
275 2 olivier.gi
        mov  #0x0000, &TACCTL1
276 111 olivier.gi
        mov  #0x0003, &DMEM_200
277 204 olivier.gi
 
278 2 olivier.gi
        mov  #0x0204, &TACTL
279
        mov  #0x1234, &TAR
280
        mov  #0x4110, &TACCTL1  ; # Rising edge, Interrupt enable
281
        mov  #0x0000, &TACCR1
282 111 olivier.gi
        mov  #0x0004, &DMEM_200
283 2 olivier.gi
        nop
284
        nop
285 111 olivier.gi
        mov  &TACCR1, &DMEM_202
286 2 olivier.gi
        mov  #0x4110, &TACCTL1  ; # Rising edge, Interrupt enable
287
        mov  #0x0000, &TACCR1
288 111 olivier.gi
        mov  #0x0005, &DMEM_200
289 2 olivier.gi
        nop
290
        nop
291 111 olivier.gi
        mov  &TACCR1, &DMEM_204
292 2 olivier.gi
        mov  #0x0000, &TACCTL1
293 111 olivier.gi
        mov  #0x0006, &DMEM_200
294 204 olivier.gi
 
295 2 olivier.gi
        mov  #0x0204, &TACTL
296
        mov  #0x1234, &TAR
297
        mov  #0x8110, &TACCTL1  ; # Falling edge, Interrupt enable
298
        mov  #0x0000, &TACCR1
299 111 olivier.gi
        mov  #0x0007, &DMEM_200
300 2 olivier.gi
        nop
301
        nop
302 111 olivier.gi
        mov  &TACCR1, &DMEM_202
303 2 olivier.gi
        mov  #0x8110, &TACCTL1  ; # Falling edge, Interrupt enable
304
        mov  #0x0000, &TACCR1
305 111 olivier.gi
        mov  #0x0008, &DMEM_200
306 2 olivier.gi
        nop
307
        nop
308 111 olivier.gi
        mov  &TACCR1, &DMEM_204
309 2 olivier.gi
        mov  #0x0000, &TACCTL1
310 111 olivier.gi
        mov  #0x0009, &DMEM_200
311 204 olivier.gi
 
312 2 olivier.gi
        mov  #0x0204, &TACTL
313
        mov  #0x1234, &TAR
314
        mov  #0xC110, &TACCTL1  ; # Rising/Falling edge, Interrupt enable
315
        mov  #0x0000, &TACCR1
316 111 olivier.gi
        mov  #0x000A, &DMEM_200
317 2 olivier.gi
        nop
318
        nop
319 111 olivier.gi
        mov  &TACCR1, &DMEM_202
320 2 olivier.gi
        mov  #0xC110, &TACCTL1  ; # Rising/Falling edge, Interrupt enable
321
        mov  #0x0000, &TACCR1
322 111 olivier.gi
        mov  #0x000B, &DMEM_200
323 2 olivier.gi
        nop
324
        nop
325 111 olivier.gi
        mov  &TACCR1, &DMEM_204
326 2 olivier.gi
        mov  #0x0000, &TACCTL1
327 111 olivier.gi
        mov  #0x000C, &DMEM_200
328 2 olivier.gi
 
329 204 olivier.gi
 
330 2 olivier.gi
                                ; # --------- Comparator 2 ----------
331
        mov  #0x0204, &TACTL
332
        mov  #0x1234, &TAR
333
        mov  #0x0110, &TACCTL2  ; # No capture, Interrupt enable
334
        mov  #0x0000, &TACCR2
335 111 olivier.gi
        mov  #0x0001, &DMEM_200
336 2 olivier.gi
        nop
337
        nop
338 111 olivier.gi
        mov  &TACCR2, &DMEM_202
339 2 olivier.gi
        mov  #0x0110, &TACCTL2  ; # No capture, Interrupt enable
340
        mov  #0x0000, &TACCR2
341 111 olivier.gi
        mov  #0x0002, &DMEM_200
342 2 olivier.gi
        nop
343
        nop
344 111 olivier.gi
        mov  &TACCR2, &DMEM_204
345 2 olivier.gi
        mov  #0x0000, &TACCTL2
346 111 olivier.gi
        mov  #0x0003, &DMEM_200
347 204 olivier.gi
 
348 2 olivier.gi
        mov  #0x0204, &TACTL
349
        mov  #0x1234, &TAR
350
        mov  #0x4110, &TACCTL2  ; # Rising edge, Interrupt enable
351
        mov  #0x0000, &TACCR2
352 111 olivier.gi
        mov  #0x0004, &DMEM_200
353 2 olivier.gi
        nop
354
        nop
355 111 olivier.gi
        mov  &TACCR2, &DMEM_202
356 2 olivier.gi
        mov  #0x4110, &TACCTL2  ; # Rising edge, Interrupt enable
357
        mov  #0x0000, &TACCR2
358 111 olivier.gi
        mov  #0x0005, &DMEM_200
359 2 olivier.gi
        nop
360
        nop
361 111 olivier.gi
        mov  &TACCR2, &DMEM_204
362 2 olivier.gi
        mov  #0x0000, &TACCTL2
363 111 olivier.gi
        mov  #0x0006, &DMEM_200
364 204 olivier.gi
 
365 2 olivier.gi
        mov  #0x0204, &TACTL
366
        mov  #0x1234, &TAR
367
        mov  #0x8110, &TACCTL2  ; # Falling edge, Interrupt enable
368
        mov  #0x0000, &TACCR2
369 111 olivier.gi
        mov  #0x0007, &DMEM_200
370 2 olivier.gi
        nop
371
        nop
372 111 olivier.gi
        mov  &TACCR2, &DMEM_202
373 2 olivier.gi
        mov  #0x8110, &TACCTL2  ; # Falling edge, Interrupt enable
374
        mov  #0x0000, &TACCR2
375 111 olivier.gi
        mov  #0x0008, &DMEM_200
376 2 olivier.gi
        nop
377
        nop
378 111 olivier.gi
        mov  &TACCR2, &DMEM_204
379 2 olivier.gi
        mov  #0x0000, &TACCTL2
380 111 olivier.gi
        mov  #0x0009, &DMEM_200
381 204 olivier.gi
 
382 2 olivier.gi
        mov  #0x0204, &TACTL
383
        mov  #0x1234, &TAR
384
        mov  #0xC110, &TACCTL2  ; # Rising/Falling edge, Interrupt enable
385
        mov  #0x0000, &TACCR2
386 111 olivier.gi
        mov  #0x000A, &DMEM_200
387 2 olivier.gi
        nop
388
        nop
389 111 olivier.gi
        mov  &TACCR2, &DMEM_202
390 2 olivier.gi
        mov  #0xC110, &TACCTL2  ; # Rising/Falling edge, Interrupt enable
391
        mov  #0x0000, &TACCR2
392 111 olivier.gi
        mov  #0x000B, &DMEM_200
393 2 olivier.gi
        nop
394
        nop
395 111 olivier.gi
        mov  &TACCR2, &DMEM_204
396 2 olivier.gi
        mov  #0x0000, &TACCTL2
397 111 olivier.gi
        mov  #0x000C, &DMEM_200
398 2 olivier.gi
 
399 204 olivier.gi
 
400
        dint
401 111 olivier.gi
        mov  #0x0000, &DMEM_200
402 2 olivier.gi
        mov  #0x2000, r15
403 204 olivier.gi
 
404 2 olivier.gi
       /* --------------   TIMER A TEST:  CAPTURE OVERFLOW ----------------- */
405
 
406
        mov  #0x0200, &TACTL
407
        mov  #0x0000, &TACCTL0
408
        mov  #0x0000, &TACCTL1
409
        mov  #0x0000, &TACCTL2
410
        dint
411
 
412
                                ; # --------- Comparator 0 ----------
413
        mov  #0x0204, &TACTL
414
        mov  #0xC000, &TACCTL0  ; # Both edges:    No read -> overflow
415 111 olivier.gi
        mov  #0x0001, &DMEM_200
416 2 olivier.gi
        nop
417
        nop
418 111 olivier.gi
        mov &TACCTL0, &DMEM_202
419
        mov  #0x0002, &DMEM_200
420 2 olivier.gi
        nop
421
        nop
422 111 olivier.gi
        mov &TACCTL0, &DMEM_204
423 2 olivier.gi
        mov  #0x0000, &TACCTL0
424 111 olivier.gi
        mov  #0x0003, &DMEM_200
425 2 olivier.gi
 
426
        mov  #0x0204, &TACTL
427
        mov  #0xC000, &TACCTL0  ; # Both edges:    Read -> no overflow
428 111 olivier.gi
        mov  #0x0004, &DMEM_200
429 2 olivier.gi
        nop
430
        nop
431 111 olivier.gi
        mov &TACCTL0, &DMEM_202
432 2 olivier.gi
        mov  &TACCR0, r10       ; # Read
433 111 olivier.gi
        mov  #0x0005, &DMEM_200
434 2 olivier.gi
        nop
435
        nop
436 111 olivier.gi
        mov &TACCTL0, &DMEM_204
437 2 olivier.gi
        mov  #0x0000, &TACCTL0
438 111 olivier.gi
        mov  #0x0006, &DMEM_200
439 2 olivier.gi
 
440
                                ; # --------- Comparator 1 ----------
441
        mov  #0x0204, &TACTL
442
        mov  #0xC000, &TACCTL1  ; # Both edges:    No read -> overflow
443 111 olivier.gi
        mov  #0x0001, &DMEM_200
444 2 olivier.gi
        nop
445
        nop
446 111 olivier.gi
        mov &TACCTL1, &DMEM_202
447
        mov  #0x0002, &DMEM_200
448 2 olivier.gi
        nop
449
        nop
450 111 olivier.gi
        mov &TACCTL1, &DMEM_204
451 2 olivier.gi
        mov  #0x0000, &TACCTL1
452 111 olivier.gi
        mov  #0x0003, &DMEM_200
453 2 olivier.gi
 
454
        mov  #0x0204, &TACTL
455
        mov  #0xC000, &TACCTL1  ; # Both edges:    Read -> no overflow
456 111 olivier.gi
        mov  #0x0004, &DMEM_200
457 2 olivier.gi
        nop
458
        nop
459 111 olivier.gi
        mov &TACCTL1, &DMEM_202
460 2 olivier.gi
        mov  &TACCR1, r10       ; # Read
461 111 olivier.gi
        mov  #0x0005, &DMEM_200
462 2 olivier.gi
        nop
463
        nop
464 111 olivier.gi
        mov &TACCTL1, &DMEM_204
465 2 olivier.gi
        mov  #0x0000, &TACCTL1
466 111 olivier.gi
        mov  #0x0006, &DMEM_200
467 2 olivier.gi
 
468
                                ; # --------- Comparator 2 ----------
469
        mov  #0x0204, &TACTL
470
        mov  #0xC000, &TACCTL2  ; # Both edges:    No read -> overflow
471 111 olivier.gi
        mov  #0x0001, &DMEM_200
472 2 olivier.gi
        nop
473
        nop
474 111 olivier.gi
        mov &TACCTL2, &DMEM_202
475
        mov  #0x0002, &DMEM_200
476 2 olivier.gi
        nop
477
        nop
478 111 olivier.gi
        mov &TACCTL2, &DMEM_204
479 2 olivier.gi
        mov  #0x0000, &TACCTL2
480 111 olivier.gi
        mov  #0x0003, &DMEM_200
481 2 olivier.gi
 
482
        mov  #0x0204, &TACTL
483
        mov  #0xC000, &TACCTL2  ; # Both edges:    Read -> no overflow
484 111 olivier.gi
        mov  #0x0004, &DMEM_200
485 2 olivier.gi
        nop
486
        nop
487 111 olivier.gi
        mov &TACCTL2, &DMEM_202
488 2 olivier.gi
        mov  &TACCR2, r10       ; # Read
489 111 olivier.gi
        mov  #0x0005, &DMEM_200
490 2 olivier.gi
        nop
491
        nop
492 111 olivier.gi
        mov &TACCTL2, &DMEM_204
493 2 olivier.gi
        mov  #0x0000, &TACCTL2
494 111 olivier.gi
        mov  #0x0006, &DMEM_200
495 2 olivier.gi
 
496 204 olivier.gi
        dint
497 111 olivier.gi
        mov  #0x0000, &DMEM_200
498 2 olivier.gi
        mov  #0x3000, r15
499
 
500 204 olivier.gi
 
501 2 olivier.gi
        /* ----------------------         END OF TEST        --------------- */
502
end_of_test:
503
        nop
504
        br #0xffff
505
 
506
 
507
        /* ----------------------      INTERRUPT ROUTINES    --------------- */
508
 
509
TIMERA_CCR0_VECTOR:
510 111 olivier.gi
        inc  &DMEM_200
511 2 olivier.gi
        reti
512
 
513 204 olivier.gi
 
514 2 olivier.gi
TIMERA_TAIV_VECTOR:
515 111 olivier.gi
        mov     &TAR, &DMEM_204
516
        mov    &TAIV, &DMEM_206
517 2 olivier.gi
        reti
518
 
519
 
520
        /* ----------------------         INTERRUPT VECTORS  --------------- */
521
 
522
.section .vectors, "a"
523
.word end_of_test        ; Interrupt  0 (lowest priority)    
524
.word end_of_test        ; Interrupt  1                      
525
.word end_of_test        ; Interrupt  2                      
526
.word end_of_test        ; Interrupt  3                      
527
.word end_of_test        ; Interrupt  4                      
528
.word end_of_test        ; Interrupt  5                      
529
.word end_of_test        ; Interrupt  6                      
530
.word end_of_test        ; Interrupt  7                      
531
.word TIMERA_TAIV_VECTOR ; Interrupt  8                      
532
.word TIMERA_CCR0_VECTOR ; Interrupt  9                      
533
.word end_of_test        ; Interrupt 10                      Watchdog timer
534
.word end_of_test        ; Interrupt 11                      
535
.word end_of_test        ; Interrupt 12                      
536
.word end_of_test        ; Interrupt 13                      
537
.word end_of_test        ; Interrupt 14                      NMI
538
.word main               ; Interrupt 15 (highest priority)   RESET

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.