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 19

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