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 2

Go to most recent revision | 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
/*===========================================================================*/
29
 
30
.global main
31
 
32
.set   BCSCTL1, 0x0057
33
.set   BCSCTL2, 0x0058
34
 
35
.set   TACTL,   0x0160
36
.set   TAR,     0x0170
37
.set   TACCTL0, 0x0162
38
.set   TACCR0,  0x0172
39
.set   TACCTL1, 0x0164
40
.set   TACCR1,  0x0174
41
.set   TACCTL2, 0x0166
42
.set   TACCR2,  0x0176
43
.set   TAIV,    0x012E
44
 
45
 
46
WAIT_FUNC:
47
        dec r14
48
        jnz WAIT_FUNC
49
        ret
50
 
51
main:
52
        mov  #0x0250, r1        ; # Initialize stack pointer
53
        mov  #0x0000, &0x0200
54
        mov  #0x0000, r15
55
 
56
        mov.b  #0x00, &BCSCTL1  ; # ACLK /1
57
        mov.b  #0x06, &BCSCTL2  ; # SMCLK = MCLK/8
58
 
59
 
60
       /* --------------   TIMER A TEST:  INPUT MUX - TACLK  ----------------- */
61
 
62
        mov  #0x0000, &TACTL
63
        mov  #0x0000, &TACCTL0
64
        dint
65
 
66
        mov  #0x0000, &TACTL
67
        mov  #0x0000, &TACCTL0
68
        mov  #0x0000, &TAR
69
        mov  #0x0062, &TACTL    ; # Continuous mode, /2
70
        mov  #0x0001, r15
71
        mov  #0x0100, r14
72
        call #WAIT_FUNC
73
 
74
        dint
75
        mov  #0x0000, &0x0200
76
        mov  #0x1000, r15
77
 
78
 
79
       /* --------------   TIMER A TEST:  INPUT MUX - ACLK  ----------------- */
80
 
81
        mov  #0x0000, &TACTL
82
        mov  #0x0000, &TACCTL0
83
        dint
84
 
85
        mov  #0x0000, &TACTL
86
        mov  #0x0000, &TACCTL0
87
        mov  #0x0000, &TAR
88
        mov  #0x0162, &TACTL    ; # Continuous mode, /2
89
        mov  #0x1001, r15
90
        mov  #0x0100, r14
91
        call #WAIT_FUNC
92
 
93
        dint
94
        mov  #0x0000, &0x0200
95
        mov  #0x2000, r15
96
 
97
 
98
       /* --------------   TIMER A TEST:  INPUT MUX - SMCLK  ----------------- */
99
 
100
        mov  #0x0000, &TACTL
101
        mov  #0x0000, &TACCTL0
102
        dint
103
 
104
        mov  #0x0000, &TACTL
105
        mov  #0x0000, &TACCTL0
106
        mov  #0x0000, &TAR
107
        mov  #0x0262, &TACTL    ; # Continuous mode, /2
108
        mov  #0x2001, r15
109
        mov  #0x0100, r14
110
        call #WAIT_FUNC
111
 
112
        dint
113
        mov  #0x0000, &0x0200
114
        mov  #0x3000, r15
115
 
116
 
117
       /* --------------   TIMER A TEST:  INPUT MUX - INCLK  ----------------- */
118
 
119
        mov  #0x0000, &TACTL
120
        mov  #0x0000, &TACCTL0
121
        dint
122
 
123
        mov  #0x0000, &TACTL
124
        mov  #0x0000, &TACCTL0
125
        mov  #0x0000, &TAR
126
        mov  #0x0362, &TACTL    ; # Continuous mode, /2
127
        mov  #0x3001, r15
128
        mov  #0x0100, r14
129
        call #WAIT_FUNC
130
 
131
        dint
132
        mov  #0x0000, &0x0200
133
        mov  #0x4000, r15
134
 
135
 
136
        /* ----------------------         END OF TEST        --------------- */
137
end_of_test:
138
        nop
139
        br #0xffff
140
 
141
 
142
        /* ----------------------      INTERRUPT ROUTINES    --------------- */
143
 
144
TIMERA_CCR0_VECTOR:
145
        inc  &0x0200
146
        reti
147
 
148
 
149
TIMERA_TAIV_VECTOR:
150
        mov     &TAR, &0x0204
151
        mov    &TAIV, &0x0206
152
        reti
153
 
154
 
155
        /* ----------------------         INTERRUPT VECTORS  --------------- */
156
 
157
.section .vectors, "a"
158
.word end_of_test        ; Interrupt  0 (lowest priority)    
159
.word end_of_test        ; Interrupt  1                      
160
.word end_of_test        ; Interrupt  2                      
161
.word end_of_test        ; Interrupt  3                      
162
.word end_of_test        ; Interrupt  4                      
163
.word end_of_test        ; Interrupt  5                      
164
.word end_of_test        ; Interrupt  6                      
165
.word end_of_test        ; Interrupt  7                      
166
.word TIMERA_TAIV_VECTOR ; Interrupt  8                      
167
.word TIMERA_CCR0_VECTOR ; Interrupt  9                      
168
.word end_of_test        ; Interrupt 10                      Watchdog timer
169
.word end_of_test        ; Interrupt 11                      
170
.word end_of_test        ; Interrupt 12                      
171
.word end_of_test        ; Interrupt 13                      
172
.word end_of_test        ; Interrupt 14                      NMI
173
.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.