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

Subversion Repositories openmsp430

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

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 clock input mux.                 */
28 18 olivier.gi
/*                                                                           */
29
/* Author(s):                                                                */
30
/*             - Olivier Girard,    olgirard@gmail.com                       */
31
/*                                                                           */
32
/*---------------------------------------------------------------------------*/
33 19 olivier.gi
/* $Rev: 141 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2012-05-05 23:22:06 +0200 (Sat, 05 May 2012) $          */
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
 
47
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
        mov.b  #0x00, &BCSCTL1  ; # ACLK /1
53
        mov.b  #0x06, &BCSCTL2  ; # SMCLK = MCLK/8
54
 
55
 
56
       /* --------------   TIMER A TEST:  INPUT MUX - TACLK  ----------------- */
57
 
58
        mov  #0x0000, &TACTL
59
        mov  #0x0000, &TACCTL0
60
        dint
61
 
62
        mov  #0x0000, &TACTL
63
        mov  #0x0000, &TACCTL0
64
        mov  #0x0000, &TAR
65
        mov  #0x0062, &TACTL    ; # Continuous mode, /2
66
        mov  #0x0001, r15
67
        mov  #0x0100, r14
68
        call #WAIT_FUNC
69
 
70
        dint
71 111 olivier.gi
        mov  #0x0000, &DMEM_200
72 2 olivier.gi
        mov  #0x1000, r15
73
 
74
 
75
       /* --------------   TIMER A TEST:  INPUT MUX - ACLK  ----------------- */
76
 
77
        mov  #0x0000, &TACTL
78
        mov  #0x0000, &TACCTL0
79
        dint
80
 
81
        mov  #0x0000, &TACTL
82
        mov  #0x0000, &TACCTL0
83
        mov  #0x0000, &TAR
84
        mov  #0x0162, &TACTL    ; # Continuous mode, /2
85
        mov  #0x1001, r15
86
        mov  #0x0100, r14
87
        call #WAIT_FUNC
88
 
89
        dint
90 111 olivier.gi
        mov  #0x0000, &DMEM_200
91 2 olivier.gi
        mov  #0x2000, r15
92
 
93
 
94
       /* --------------   TIMER A TEST:  INPUT MUX - SMCLK  ----------------- */
95
 
96
        mov  #0x0000, &TACTL
97
        mov  #0x0000, &TACCTL0
98
        dint
99
 
100
        mov  #0x0000, &TACTL
101
        mov  #0x0000, &TACCTL0
102
        mov  #0x0000, &TAR
103
        mov  #0x0262, &TACTL    ; # Continuous mode, /2
104
        mov  #0x2001, r15
105
        mov  #0x0100, r14
106
        call #WAIT_FUNC
107
 
108
        dint
109 111 olivier.gi
        mov  #0x0000, &DMEM_200
110 2 olivier.gi
        mov  #0x3000, r15
111
 
112
 
113
       /* --------------   TIMER A TEST:  INPUT MUX - INCLK  ----------------- */
114
 
115
        mov  #0x0000, &TACTL
116
        mov  #0x0000, &TACCTL0
117
        dint
118
 
119
        mov  #0x0000, &TACTL
120
        mov  #0x0000, &TACCTL0
121
        mov  #0x0000, &TAR
122
        mov  #0x0362, &TACTL    ; # Continuous mode, /2
123
        mov  #0x3001, r15
124
        mov  #0x0100, r14
125
        call #WAIT_FUNC
126
 
127
        dint
128 111 olivier.gi
        mov  #0x0000, &DMEM_200
129 2 olivier.gi
        mov  #0x4000, r15
130
 
131
 
132
        /* ----------------------         END OF TEST        --------------- */
133
end_of_test:
134
        nop
135
        br #0xffff
136
 
137
 
138
        /* ----------------------      INTERRUPT ROUTINES    --------------- */
139
 
140
TIMERA_CCR0_VECTOR:
141 111 olivier.gi
        inc  &DMEM_200
142 2 olivier.gi
        reti
143
 
144
 
145
TIMERA_TAIV_VECTOR:
146 111 olivier.gi
        mov     &TAR, &DMEM_204
147
        mov    &TAIV, &DMEM_206
148 2 olivier.gi
        reti
149
 
150
 
151
        /* ----------------------         INTERRUPT VECTORS  --------------- */
152
 
153
.section .vectors, "a"
154
.word end_of_test        ; Interrupt  0 (lowest priority)    
155
.word end_of_test        ; Interrupt  1                      
156
.word end_of_test        ; Interrupt  2                      
157
.word end_of_test        ; Interrupt  3                      
158
.word end_of_test        ; Interrupt  4                      
159
.word end_of_test        ; Interrupt  5                      
160
.word end_of_test        ; Interrupt  6                      
161
.word end_of_test        ; Interrupt  7                      
162
.word TIMERA_TAIV_VECTOR ; Interrupt  8                      
163
.word TIMERA_CCR0_VECTOR ; Interrupt  9                      
164
.word end_of_test        ; Interrupt 10                      Watchdog timer
165
.word end_of_test        ; Interrupt 11                      
166
.word end_of_test        ; Interrupt 12                      
167
.word end_of_test        ; Interrupt 13                      
168
.word end_of_test        ; Interrupt 14                      NMI
169
.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.