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 111

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: 111 $                                                                */
34
/* $LastChangedBy: olivier.girard $                                          */
35
/* $LastChangedDate: 2011-05-20 22:39:02 +0200 (Fri, 20 May 2011) $          */
36 2 olivier.gi
/*===========================================================================*/
37
 
38
.global main
39
 
40 111 olivier.gi
.set   DMEM_BASE, (__data_start     )
41
.set   DMEM_200,  (__data_start+0x00)
42
.set   DMEM_202,  (__data_start+0x02)
43
.set   DMEM_204,  (__data_start+0x04)
44
.set   DMEM_206,  (__data_start+0x06)
45
.set   DMEM_250,  (__data_start+0x50)
46
 
47 2 olivier.gi
.set   BCSCTL1, 0x0057
48
.set   BCSCTL2, 0x0058
49
 
50
.set   TACTL,   0x0160
51
.set   TAR,     0x0170
52
.set   TACCTL0, 0x0162
53
.set   TACCR0,  0x0172
54
.set   TACCTL1, 0x0164
55
.set   TACCR1,  0x0174
56
.set   TACCTL2, 0x0166
57
.set   TACCR2,  0x0176
58
.set   TAIV,    0x012E
59
 
60
 
61
WAIT_FUNC:
62
        dec r14
63
        jnz WAIT_FUNC
64
        ret
65
 
66
main:
67 111 olivier.gi
        mov  #DMEM_250, r1      ; # Initialize stack pointer
68
        mov  #0x0000, &DMEM_200
69 2 olivier.gi
        mov  #0x0000, r15
70
 
71
        mov.b  #0x00, &BCSCTL1  ; # ACLK /1
72
        mov.b  #0x06, &BCSCTL2  ; # SMCLK = MCLK/8
73
 
74
 
75
       /* --------------   TIMER A TEST:  INPUT MUX - TACLK  ----------------- */
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  #0x0062, &TACTL    ; # Continuous mode, /2
85
        mov  #0x0001, 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  #0x1000, r15
92
 
93
 
94
       /* --------------   TIMER A TEST:  INPUT MUX - ACLK  ----------------- */
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  #0x0162, &TACTL    ; # Continuous mode, /2
104
        mov  #0x1001, 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  #0x2000, r15
111
 
112
 
113
       /* --------------   TIMER A TEST:  INPUT MUX - SMCLK  ----------------- */
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  #0x0262, &TACTL    ; # Continuous mode, /2
123
        mov  #0x2001, 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  #0x3000, r15
130
 
131
 
132
       /* --------------   TIMER A TEST:  INPUT MUX - INCLK  ----------------- */
133
 
134
        mov  #0x0000, &TACTL
135
        mov  #0x0000, &TACCTL0
136
        dint
137
 
138
        mov  #0x0000, &TACTL
139
        mov  #0x0000, &TACCTL0
140
        mov  #0x0000, &TAR
141
        mov  #0x0362, &TACTL    ; # Continuous mode, /2
142
        mov  #0x3001, r15
143
        mov  #0x0100, r14
144
        call #WAIT_FUNC
145
 
146
        dint
147 111 olivier.gi
        mov  #0x0000, &DMEM_200
148 2 olivier.gi
        mov  #0x4000, r15
149
 
150
 
151
        /* ----------------------         END OF TEST        --------------- */
152
end_of_test:
153
        nop
154
        br #0xffff
155
 
156
 
157
        /* ----------------------      INTERRUPT ROUTINES    --------------- */
158
 
159
TIMERA_CCR0_VECTOR:
160 111 olivier.gi
        inc  &DMEM_200
161 2 olivier.gi
        reti
162
 
163
 
164
TIMERA_TAIV_VECTOR:
165 111 olivier.gi
        mov     &TAR, &DMEM_204
166
        mov    &TAIV, &DMEM_206
167 2 olivier.gi
        reti
168
 
169
 
170
        /* ----------------------         INTERRUPT VECTORS  --------------- */
171
 
172
.section .vectors, "a"
173
.word end_of_test        ; Interrupt  0 (lowest priority)    
174
.word end_of_test        ; Interrupt  1                      
175
.word end_of_test        ; Interrupt  2                      
176
.word end_of_test        ; Interrupt  3                      
177
.word end_of_test        ; Interrupt  4                      
178
.word end_of_test        ; Interrupt  5                      
179
.word end_of_test        ; Interrupt  6                      
180
.word end_of_test        ; Interrupt  7                      
181
.word TIMERA_TAIV_VECTOR ; Interrupt  8                      
182
.word TIMERA_CCR0_VECTOR ; Interrupt  9                      
183
.word end_of_test        ; Interrupt 10                      Watchdog timer
184
.word end_of_test        ; Interrupt 11                      
185
.word end_of_test        ; Interrupt 12                      
186
.word end_of_test        ; Interrupt 13                      
187
.word end_of_test        ; Interrupt 14                      NMI
188
.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.