1 |
50 |
olivier.gi |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2 |
166 |
olivier.gi |
<html><head><title>openMSP430 Integration and Connectivity</title></head><body><br>
|
3 |
50 |
olivier.gi |
<a name="TOC"></a>
|
4 |
|
|
<h3>Table of content</h3>
|
5 |
|
|
<ul>
|
6 |
135 |
olivier.gi |
<li><a href="#1.%20Overview"> 1. Overview</a></li>
|
7 |
|
|
<li><a href="#2.%20Clocks"> 2. Clocks</a></li>
|
8 |
|
|
<li><a href="#3.%20Resets"> 3. Resets</a></li>
|
9 |
166 |
olivier.gi |
<li><a href="#4.%20Program%20Memory"> 4. Program Memory</a></li>
|
10 |
|
|
<li><a href="#5.%20Data%20Memory"> 5. Data Memory</a></li>
|
11 |
135 |
olivier.gi |
<li><a href="#6.%20Peripherals"> 6. Peripherals</a></li>
|
12 |
|
|
<li><a href="#7.%20Interrupts"> 7. Interrupts</a></li>
|
13 |
|
|
<li><a href="#8.%20Serial%20Debug%20Interface">8. Serial Debug Interface</a></li>
|
14 |
166 |
olivier.gi |
<ul>
|
15 |
|
|
<li><a href="#8.1%20UART"> 8.1 UART Configuration</a></li>
|
16 |
|
|
<li><a href="#8.2%20I2C"> 8.2 I2C Configuration</a></li>
|
17 |
|
|
</ul>
|
18 |
50 |
olivier.gi |
</ul>
|
19 |
|
|
|
20 |
|
|
<a name="1. Overview"></a>
|
21 |
|
|
<h1>1. Overview</h1>
|
22 |
135 |
olivier.gi |
This chapter aims to give a comprehensive description of all openMSP430
|
23 |
|
|
core interfaces in order to facilitate its integration within an ASIC
|
24 |
|
|
or FPGA.<br><br>The
|
25 |
|
|
following diagram shows an overview of the openMSP430 core connectivity
|
26 |
|
|
in an FPGA system (i.e. all ASIC specific pins are left unused):<br><br>
|
27 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1353268529" alt="Core Integration" title="Core Integration" width="100%">
|
28 |
135 |
olivier.gi |
<br><br>
|
29 |
|
|
The full pinout of the core is summarized in the following table.<br>
|
30 |
|
|
<br>
|
31 |
50 |
olivier.gi |
<table border="1">
|
32 |
135 |
olivier.gi |
<tbody><tr> <td align="center"><b>Port Name</b></td> <td align="center"><b>Direction</b></td> <td align="center"><b>Width</b> </td> <td style="vertical-align: top; text-align: center;"><span style="font-weight: bold;">Clock</span><br style="font-weight: bold;">
|
33 |
|
|
<span style="font-weight: bold;">Domain</span><br>
|
34 |
|
|
</td>
|
35 |
|
|
<td align="center"><b>Description</b></td> </tr>
|
36 |
50 |
olivier.gi |
|
37 |
135 |
olivier.gi |
<tr> <td colspan="5" align="center"> <b><i>Clocks</i></b> </td></tr>
|
38 |
116 |
olivier.gi |
<tr>
|
39 |
135 |
olivier.gi |
<td> <a href="#2.%20Clocks">cpu_en</a> </td>
|
40 |
|
|
<td style="text-align: center;"> Input </td>
|
41 |
|
|
<td style="text-align: center;"> 1 </td>
|
42 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
43 |
|
|
|
44 |
|
|
or mclk<b><sup><font color="#ff0000">4</font></sup></b></td>
|
45 |
|
|
<td><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">Enable CPU code execution (asynchronous and non-glitchy).<br>Set to 1 if unused.</span> </td>
|
46 |
116 |
olivier.gi |
</tr>
|
47 |
50 |
olivier.gi |
<tr>
|
48 |
135 |
olivier.gi |
<td> <a href="#2.%20Clocks">dco_clk</a> </td>
|
49 |
|
|
<td style="text-align: center;"> Input </td>
|
50 |
|
|
<td style="text-align: center;"> 1 </td>
|
51 |
|
|
<td style="vertical-align: top; text-align: center;">-<br>
|
52 |
|
|
</td>
|
53 |
|
|
<td><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">Fast oscillator (fast clock)</span> </td>
|
54 |
50 |
olivier.gi |
</tr>
|
55 |
|
|
<tr>
|
56 |
135 |
olivier.gi |
<td> <a href="#2.%20Clocks">lfxt_clk</a> </td>
|
57 |
|
|
<td style="text-align: center;"> Input </td>
|
58 |
|
|
<td style="text-align: center;"> 1 </td>
|
59 |
|
|
<td style="vertical-align: top; text-align: center;">-<br>
|
60 |
|
|
</td>
|
61 |
|
|
<td><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">Low frequency oscillator (typ. 32kHz)<br>Set to 0 if unused.</span></td>
|
62 |
50 |
olivier.gi |
</tr>
|
63 |
|
|
<tr>
|
64 |
135 |
olivier.gi |
<td> <a href="#2.%20Clocks">mclk</a> </td>
|
65 |
|
|
<td style="text-align: center;"> Output </td>
|
66 |
|
|
<td style="text-align: center;"> 1 </td>
|
67 |
|
|
<td style="vertical-align: top; text-align: center;">-<br>
|
68 |
|
|
</td>
|
69 |
|
|
<td> Main system clock </td>
|
70 |
50 |
olivier.gi |
</tr>
|
71 |
|
|
<tr>
|
72 |
135 |
olivier.gi |
<td> <a href="#2.%20Clocks">aclk_en</a> </td>
|
73 |
|
|
<td style="text-align: center;"> Output </td>
|
74 |
|
|
<td style="text-align: center;"> 1 </td>
|
75 |
|
|
<td style="vertical-align: top; text-align: center;">mclk<br>
|
76 |
|
|
</td>
|
77 |
|
|
<td><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">FPGA ONLY: ACLK enable</span> </td>
|
78 |
50 |
olivier.gi |
</tr>
|
79 |
|
|
<tr>
|
80 |
135 |
olivier.gi |
<td> <a href="#2.%20Clocks">smclk_en</a> </td>
|
81 |
|
|
<td style="text-align: center;"> Output </td>
|
82 |
|
|
<td style="text-align: center;"> 1 </td>
|
83 |
|
|
<td style="vertical-align: top; text-align: center;">mclk<br>
|
84 |
|
|
</td>
|
85 |
|
|
<td> <span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">FPGA ONLY: SMCLK enable</span> </td>
|
86 |
50 |
olivier.gi |
</tr>
|
87 |
|
|
|
88 |
|
|
<tr>
|
89 |
135 |
olivier.gi |
<td style="vertical-align: top;"><a href="integration.html#2.%20Clocks">dco_enable</a></td>
|
90 |
|
|
<td style="vertical-align: top; text-align: center;">Output<br>
|
91 |
|
|
</td>
|
92 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
93 |
|
|
</td>
|
94 |
|
|
<td style="vertical-align: top; text-align: center;">dco_clk<br>
|
95 |
|
|
</td>
|
96 |
|
|
<td style="vertical-align: top;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">ASIC ONLY: Fast oscillator enable</span></td>
|
97 |
|
|
</tr>
|
98 |
|
|
<tr>
|
99 |
|
|
<td style="vertical-align: top;"><a href="integration.html#2.%20Clocks">dco_wkup</a></td>
|
100 |
|
|
<td style="vertical-align: top; text-align: center;">Output</td>
|
101 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
102 |
|
|
</td>
|
103 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
104 |
|
|
</td>
|
105 |
|
|
<td style="vertical-align: top;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">ASIC ONLY: Fast oscillator wakeup (asynchronous)</span></td>
|
106 |
|
|
</tr>
|
107 |
|
|
<tr>
|
108 |
|
|
<td style="vertical-align: top;"><a href="integration.html#2.%20Clocks">lfxt_enable</a></td>
|
109 |
|
|
<td style="vertical-align: top; text-align: center;">Output</td>
|
110 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
111 |
|
|
</td>
|
112 |
|
|
<td style="vertical-align: top; text-align: center;">lfxt_clk<br>
|
113 |
|
|
</td>
|
114 |
|
|
<td style="vertical-align: top;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">ASIC ONLY: Low frequency oscillator enable</span></td>
|
115 |
|
|
</tr>
|
116 |
|
|
<tr>
|
117 |
|
|
<td style="vertical-align: top;"><a href="integration.html#2.%20Clocks">lfxt_wkup</a></td>
|
118 |
|
|
<td style="vertical-align: top; text-align: center;">Output</td>
|
119 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
120 |
|
|
</td>
|
121 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
122 |
|
|
</td>
|
123 |
|
|
<td style="vertical-align: top;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">ASIC ONLY: Low frequency oscillator wakeup (asynchronous)</span></td>
|
124 |
|
|
</tr>
|
125 |
|
|
<tr>
|
126 |
|
|
<td style="vertical-align: top;"><a href="integration.html#2.%20Clocks">aclk</a></td>
|
127 |
|
|
<td style="vertical-align: top; text-align: center;">Output</td>
|
128 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
129 |
|
|
</td>
|
130 |
|
|
<td style="vertical-align: top; text-align: center;">-<br>
|
131 |
|
|
</td>
|
132 |
|
|
<td style="vertical-align: top;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">ASIC ONLY: ACLK</span></td>
|
133 |
|
|
</tr>
|
134 |
|
|
<tr>
|
135 |
|
|
<td style="vertical-align: top;"><a href="integration.html#2.%20Clocks">smclk</a></td>
|
136 |
|
|
<td style="vertical-align: top; text-align: center;">Output</td>
|
137 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
138 |
|
|
</td>
|
139 |
|
|
<td style="vertical-align: top; text-align: center;">-<br>
|
140 |
|
|
</td>
|
141 |
|
|
<td style="vertical-align: top;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">ASIC ONLY: SMCLK</span></td>
|
142 |
|
|
</tr>
|
143 |
|
|
<tr>
|
144 |
|
|
<td style="vertical-align: top;"><a href="integration.html#2.%20Clocks">wkup</a></td>
|
145 |
|
|
<td style="vertical-align: top; text-align: center;">Input<br>
|
146 |
|
|
</td>
|
147 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
148 |
|
|
</td>
|
149 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
150 |
|
|
</td>
|
151 |
|
|
<td style="vertical-align: top;"><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">ASIC ONLY: System Wake-up (asynchronous and non-glitchy)<br>Set to 0 if unused.</span></td>
|
152 |
|
|
</tr>
|
153 |
|
|
<tr> <td colspan="5" align="center"> <b><i>Resets</i></b> </td></tr>
|
154 |
|
|
<tr>
|
155 |
|
|
<td> <a href="#3.%20Resets">puc_rst</a> </td>
|
156 |
|
|
<td style="text-align: center;"> Output </td>
|
157 |
|
|
<td style="text-align: center;"> 1 </td>
|
158 |
|
|
<td style="vertical-align: top; text-align: center;">mclk<br>
|
159 |
|
|
</td>
|
160 |
|
|
<td> Main system reset </td>
|
161 |
50 |
olivier.gi |
</tr>
|
162 |
|
|
<tr>
|
163 |
135 |
olivier.gi |
<td> <a href="#3.%20Resets">reset_n</a> </td>
|
164 |
|
|
<td style="text-align: center;"> Input </td>
|
165 |
|
|
<td style="text-align: center;"> 1 </td>
|
166 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
167 |
|
|
</td>
|
168 |
|
|
<td><span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">Reset Pin (active low, asynchronous and non-glitchy)</span> </td>
|
169 |
50 |
olivier.gi |
</tr>
|
170 |
|
|
|
171 |
|
|
|
172 |
135 |
olivier.gi |
<tr> <td colspan="5" align="center"> <b><i>Program Memory interface</i></b> </td></tr>
|
173 |
50 |
olivier.gi |
<tr>
|
174 |
135 |
olivier.gi |
<td> <a href="#4.%20Program%20Memory">pmem_addr</a> </td>
|
175 |
|
|
<td style="text-align: center;"> Output </td>
|
176 |
|
|
<td style="text-align: center;"><small> `PMEM_AWIDTH</small><sup style="color: red; font-weight: bold;">1</sup> </td>
|
177 |
|
|
<td style="vertical-align: top; text-align: center;">mclk<br>
|
178 |
|
|
</td>
|
179 |
|
|
<td> Program Memory address </td>
|
180 |
50 |
olivier.gi |
</tr>
|
181 |
|
|
<tr>
|
182 |
135 |
olivier.gi |
<td> <a href="#4.%20Program%20Memory">pmem_cen</a> </td>
|
183 |
|
|
<td style="text-align: center;"> Output </td>
|
184 |
|
|
<td style="text-align: center;"> 1 </td>
|
185 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
186 |
|
|
<td> Program Memory chip enable (low active) </td>
|
187 |
50 |
olivier.gi |
</tr>
|
188 |
|
|
<tr>
|
189 |
135 |
olivier.gi |
<td> <a href="#4.%20Program%20Memory">pmem_din</a> </td>
|
190 |
|
|
<td style="text-align: center;"> Output </td>
|
191 |
|
|
<td style="text-align: center;"> 16 </td>
|
192 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
193 |
|
|
<td> Program Memory data input<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"> (optional<span class="Apple-converted-space"> </span><b><sup><font color="#ff0000">2</font></sup></b>)</span> </td>
|
194 |
50 |
olivier.gi |
</tr>
|
195 |
|
|
<tr>
|
196 |
135 |
olivier.gi |
<td> <a href="#4.%20Program%20Memory">pmem_dout</a> </td>
|
197 |
|
|
<td style="text-align: center;"> Input </td>
|
198 |
|
|
<td style="text-align: center;"> 16 </td>
|
199 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
200 |
|
|
<td> Program Memory data output </td>
|
201 |
50 |
olivier.gi |
</tr>
|
202 |
|
|
<tr>
|
203 |
135 |
olivier.gi |
<td> <a href="#4.%20Program%20Memory">pmem_wen</a> </td>
|
204 |
|
|
<td style="text-align: center;"> Output </td>
|
205 |
|
|
<td style="text-align: center;"> 2 </td>
|
206 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
207 |
|
|
<td> Program Memory write byte enable (low active) <span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;">(optional<span class="Apple-converted-space"> </span><b><sup><font color="#ff0000">2</font></sup></b>)</span> </td>
|
208 |
50 |
olivier.gi |
</tr>
|
209 |
|
|
|
210 |
135 |
olivier.gi |
<tr> <td colspan="5" align="center"> <b><i>Data Memory interface</i></b> </td></tr>
|
211 |
50 |
olivier.gi |
<tr>
|
212 |
135 |
olivier.gi |
<td> <a href="#5.%20Data%20Memory">dmem_addr</a> </td>
|
213 |
|
|
<td style="text-align: center;"> Output </td>
|
214 |
|
|
<td style="text-align: center;"><small> `DMEM_AWIDTH</small><sup style="font-weight: bold; color: red;">1</sup> </td>
|
215 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
216 |
|
|
<td> Data Memory address </td>
|
217 |
50 |
olivier.gi |
</tr>
|
218 |
|
|
<tr>
|
219 |
135 |
olivier.gi |
<td> <a href="#5.%20Data%20Memory">dmem_cen</a> </td>
|
220 |
|
|
<td style="text-align: center;"> Output </td>
|
221 |
|
|
<td style="text-align: center;"> 1 </td>
|
222 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
223 |
|
|
<td> Data Memory chip enable (low active) </td>
|
224 |
50 |
olivier.gi |
</tr>
|
225 |
|
|
<tr>
|
226 |
135 |
olivier.gi |
<td> <a href="#5.%20Data%20Memory">dmem_din</a> </td>
|
227 |
|
|
<td style="text-align: center;"> Output </td>
|
228 |
|
|
<td style="text-align: center;"> 16 </td>
|
229 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
230 |
|
|
<td> Data Memory data input </td>
|
231 |
50 |
olivier.gi |
</tr>
|
232 |
|
|
<tr>
|
233 |
135 |
olivier.gi |
<td> <a href="#5.%20Data%20Memory">dmem_dout</a> </td>
|
234 |
|
|
<td style="text-align: center;"> Input </td>
|
235 |
|
|
<td style="text-align: center;"> 16 </td>
|
236 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
237 |
|
|
<td> Data Memory data output </td>
|
238 |
50 |
olivier.gi |
</tr>
|
239 |
|
|
<tr>
|
240 |
135 |
olivier.gi |
<td> <a href="#5.%20Data%20Memory">dmem_wen</a> </td>
|
241 |
|
|
<td style="text-align: center;"> Output </td>
|
242 |
|
|
<td style="text-align: center;"> 2 </td>
|
243 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
244 |
|
|
<td> Data Memory write byte enable (low active) </td>
|
245 |
50 |
olivier.gi |
</tr>
|
246 |
|
|
|
247 |
135 |
olivier.gi |
<tr> <td colspan="5" align="center"> <b><i>External Peripherals interface</i></b> </td></tr>
|
248 |
50 |
olivier.gi |
<tr>
|
249 |
135 |
olivier.gi |
<td> <a href="#6.%20Peripherals">per_addr</a> </td>
|
250 |
|
|
<td style="text-align: center;"> Output </td>
|
251 |
|
|
<td style="text-align: center;"> 14 </td>
|
252 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
253 |
|
|
<td> Peripheral address </td>
|
254 |
50 |
olivier.gi |
</tr>
|
255 |
|
|
<tr>
|
256 |
135 |
olivier.gi |
<td> <a href="#6.%20Peripherals">per_din</a> </td>
|
257 |
|
|
<td style="text-align: center;"> Output </td>
|
258 |
|
|
<td style="text-align: center;"> 16 </td>
|
259 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
260 |
|
|
<td> Peripheral data input </td>
|
261 |
50 |
olivier.gi |
</tr>
|
262 |
|
|
<tr>
|
263 |
135 |
olivier.gi |
<td> <a href="#6.%20Peripherals">per_dout</a> </td>
|
264 |
|
|
<td style="text-align: center;"> Input </td>
|
265 |
|
|
<td style="text-align: center;"> 16 </td>
|
266 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
267 |
|
|
<td> Peripheral data output </td>
|
268 |
50 |
olivier.gi |
</tr>
|
269 |
|
|
<tr>
|
270 |
135 |
olivier.gi |
<td> <a href="#6.%20Peripherals">per_en</a> </td>
|
271 |
|
|
<td style="text-align: center;"> Output </td>
|
272 |
|
|
<td style="text-align: center;"> 1 </td>
|
273 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
274 |
|
|
<td> Peripheral enable (high active) </td>
|
275 |
50 |
olivier.gi |
</tr>
|
276 |
|
|
<tr>
|
277 |
135 |
olivier.gi |
<td> <a href="#6.%20Peripherals">per_we</a> </td>
|
278 |
|
|
<td style="text-align: center;"> Output </td>
|
279 |
|
|
<td style="text-align: center;"> 2 </td>
|
280 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
281 |
|
|
<td> Peripheral write byte enable (high active) </td>
|
282 |
50 |
olivier.gi |
</tr>
|
283 |
|
|
|
284 |
135 |
olivier.gi |
<tr> <td colspan="5" align="center"> <b><i>Interrupts</i></b> </td></tr>
|
285 |
50 |
olivier.gi |
<tr>
|
286 |
135 |
olivier.gi |
<td> <a href="#7.%20Interrupts">irq</a> </td>
|
287 |
|
|
<td style="text-align: center;"> Input </td>
|
288 |
195 |
olivier.gi |
<td style="text-align: center;"> <small>`IRQ_NR-2</small><sup style="font-weight: bold; color: red;">1</sup></td>
|
289 |
135 |
olivier.gi |
<td style="vertical-align: top; text-align: center;">mclk</td>
|
290 |
|
|
<td> Maskable interrupts (one-hot signal) </td>
|
291 |
50 |
olivier.gi |
</tr>
|
292 |
|
|
<tr>
|
293 |
135 |
olivier.gi |
<td> <a href="#7.%20Interrupts">nmi</a> </td>
|
294 |
|
|
<td style="text-align: center;"> Input </td>
|
295 |
|
|
<td style="text-align: center;"> 1 </td>
|
296 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
297 |
|
|
|
298 |
|
|
or mclk<b><sup><font color="#ff0000">4</font></sup></b></td>
|
299 |
|
|
<td> Non-maskable interrupt (asynchronous) </td>
|
300 |
50 |
olivier.gi |
</tr>
|
301 |
|
|
<tr>
|
302 |
135 |
olivier.gi |
<td> <a href="#7.%20Interrupts">irq_acc</a> </td>
|
303 |
|
|
<td style="text-align: center;"> Output </td>
|
304 |
195 |
olivier.gi |
<td style="text-align: center;"> <small>`IRQ_NR-2</small><sup style="font-weight: bold; color: red;">1</sup></td>
|
305 |
135 |
olivier.gi |
<td style="vertical-align: top; text-align: center;">mclk</td>
|
306 |
|
|
<td> Interrupt request accepted (one-hot signal) </td>
|
307 |
50 |
olivier.gi |
</tr>
|
308 |
|
|
|
309 |
135 |
olivier.gi |
<tr> <td colspan="5" align="center"> <b><i>Serial Debug interface</i></b> </td></tr>
|
310 |
50 |
olivier.gi |
<tr>
|
311 |
135 |
olivier.gi |
<td> <a href="#8.%20Serial%20Debug%20Interface">dbg_en</a> </td>
|
312 |
|
|
<td style="text-align: center;"> Input </td>
|
313 |
|
|
<td style="text-align: center;"> 1 </td>
|
314 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
315 |
|
|
|
316 |
|
|
or mclk<b><sup><font color="#ff0000">4</font></sup></b></td>
|
317 |
|
|
<td> Debug interface enable (asynchronous)<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-converted-space"> </span><b><sup><font color="#ff0000">3</font></sup></b></span> </td>
|
318 |
116 |
olivier.gi |
</tr>
|
319 |
|
|
<tr>
|
320 |
135 |
olivier.gi |
<td> <a href="#8.%20Serial%20Debug%20Interface">dbg_freeze</a> </td>
|
321 |
|
|
<td style="text-align: center;"> Output </td>
|
322 |
|
|
<td style="text-align: center;"> 1 </td>
|
323 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
324 |
|
|
<td> Freeze peripherals </td>
|
325 |
50 |
olivier.gi |
</tr>
|
326 |
|
|
<tr>
|
327 |
166 |
olivier.gi |
<td> <a href="#8.1%20UART">dbg_uart_txd</a> </td>
|
328 |
135 |
olivier.gi |
<td style="text-align: center;"> Output </td>
|
329 |
|
|
<td style="text-align: center;"> 1 </td>
|
330 |
|
|
<td style="vertical-align: top; text-align: center;">mclk</td>
|
331 |
|
|
<td> Debug interface: UART TXD </td>
|
332 |
50 |
olivier.gi |
</tr>
|
333 |
|
|
<tr>
|
334 |
166 |
olivier.gi |
<td> <a href="#8.1%20UART">dbg_uart_rxd</a> </td>
|
335 |
135 |
olivier.gi |
<td style="text-align: center;"> Input </td>
|
336 |
|
|
<td style="text-align: center;"> 1 </td>
|
337 |
|
|
<td style="vertical-align: top; text-align: center;"><async><br>
|
338 |
|
|
</td>
|
339 |
|
|
<td> Debug interface: UART RXD (asynchronous) </td>
|
340 |
166 |
olivier.gi |
</tr><tr>
|
341 |
|
|
<td><a href="#8.2%20I2C">dbg_i2c_addr</a></td>
|
342 |
|
|
<td style="text-align: center;">Input</td>
|
343 |
|
|
<td style="text-align: center;"> 1</td>
|
344 |
|
|
<td style="vertical-align: top; text-align: center;">mclk<br>
|
345 |
|
|
</td>
|
346 |
|
|
<td> Debug interface: I2C Address </td>
|
347 |
|
|
</tr>
|
348 |
|
|
<tr>
|
349 |
|
|
<td><a href="#8.2%20I2C">dbg_i2c_broadcast</a></td>
|
350 |
|
|
<td style="text-align: center;">Input</td>
|
351 |
|
|
<td style="text-align: center;"> 1</td>
|
352 |
|
|
<td style="vertical-align: top; text-align: center;">mclk<br>
|
353 |
|
|
</td>
|
354 |
|
|
<td> Debug interface: I2C Broadcast Address (for multicore only) </td>
|
355 |
|
|
</tr>
|
356 |
|
|
<tr>
|
357 |
|
|
<td><a href="#8.2%20I2C">dbg_i2c_scl</a></td>
|
358 |
|
|
<td style="text-align: center;">Input</td>
|
359 |
|
|
<td style="text-align: center;"> 1</td>
|
360 |
|
|
<td style="vertical-align: top; text-align: center;"><async></td>
|
361 |
|
|
<td> Debug interface: I2C SCL </td>
|
362 |
|
|
</tr>
|
363 |
|
|
<tr>
|
364 |
|
|
<td><a href="#8.2%20I2C">dbg_i2c_sda_in</a></td>
|
365 |
|
|
<td style="text-align: center;">Input</td>
|
366 |
|
|
<td style="text-align: center;"> 1</td>
|
367 |
|
|
<td style="vertical-align: top; text-align: center;"><async></td>
|
368 |
|
|
<td> Debug interface: I2C SDA input </td>
|
369 |
|
|
</tr>
|
370 |
|
|
<tr>
|
371 |
|
|
<td><a href="#8.2%20I2C">dbg_i2c_sda_out</a></td>
|
372 |
|
|
<td style="text-align: center;">Output</td>
|
373 |
|
|
<td style="text-align: center;"> 1</td>
|
374 |
|
|
<td style="vertical-align: top; text-align: center;">mclk<br>
|
375 |
|
|
</td>
|
376 |
|
|
<td> Debug interface: I2C SDA output </td>
|
377 |
|
|
</tr>
|
378 |
|
|
<tr align="center">
|
379 |
135 |
olivier.gi |
<td colspan="5" rowspan="1" style="vertical-align: top;"><b><i>Scan</i></b></td>
|
380 |
|
|
</tr>
|
381 |
|
|
<tr>
|
382 |
|
|
<td style="vertical-align: top;">scan_enable<br>
|
383 |
|
|
</td>
|
384 |
|
|
<td style="vertical-align: top; text-align: center;">Input<br>
|
385 |
|
|
</td>
|
386 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
387 |
|
|
</td>
|
388 |
|
|
<td style="vertical-align: top; text-align: center;">dco_clk<br>
|
389 |
|
|
</td>
|
390 |
|
|
<td style="vertical-align: top;">ASIC ONLY: Scan enable (active during scan shifting)</td>
|
391 |
|
|
</tr>
|
392 |
|
|
<tr>
|
393 |
|
|
<td style="vertical-align: top;">scan_mode<br>
|
394 |
|
|
</td>
|
395 |
|
|
<td style="vertical-align: top; text-align: center;">Input<br>
|
396 |
|
|
</td>
|
397 |
|
|
<td style="vertical-align: top; text-align: center;">1<br>
|
398 |
|
|
</td>
|
399 |
|
|
<td style="vertical-align: top; text-align: center;"><stable><br>
|
400 |
|
|
</td>
|
401 |
|
|
<td style="vertical-align: top;">ASIC ONLY: Scan mode</td>
|
402 |
|
|
</tr>
|
403 |
50 |
olivier.gi |
|
404 |
135 |
olivier.gi |
</tbody></table>
|
405 |
|
|
<br>
|
406 |
195 |
olivier.gi |
<span class="Apple-style-span" style="color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><b><sup><font color="#ff0000">1</font></sup></b>: This parameter is declared in the "openMSP430_defines.v" file and defines the RAM/ROM size or the number of interrupts vectors (16, 32 or 64).<br><b><sup><font color="#ff0000">2</font></sup></b>:
|
407 |
135 |
olivier.gi |
These two optional ports can be connected whenever the program memory
|
408 |
|
|
is a RAM. This will allow the user to load a program through the serial
|
409 |
|
|
debug interface and to use software breakpoints.<br><b><sup><font color="#ff0000">3</font></sup></b>: When disabled, the debug interface is hold into reset (and clock gated in ASIC mode). As a consequence, the<span class="Apple-converted-space"> </span><b><i>dbg_en</i></b><span class="Apple-converted-space"> </span>port can be used to reset the debug interface without disrupting the CPU execution.<br><b><sup><font color="#ff0000">4</font></sup></b>: Clock domain is selectable through configuration in the "openMSP430_defines.v" file (see Advanced System Configuration).</span><sup></sup><br>
|
410 |
|
|
<br>
|
411 |
50 |
olivier.gi |
|
412 |
135 |
olivier.gi |
|
413 |
50 |
olivier.gi |
<a name="2. Clocks"></a>
|
414 |
135 |
olivier.gi |
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
415 |
50 |
olivier.gi |
<h1>2. Clocks</h1>
|
416 |
|
|
|
417 |
135 |
olivier.gi |
The different clocks in the design are managed by the Basic Clock Module as following in the FPGA configuration:
|
418 |
|
|
<br><br>
|
419 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1319831724" alt="Clock structure diagram" title="Clock structure diagram" width="75%">
|
420 |
135 |
olivier.gi |
<br>
|
421 |
|
|
<br>
|
422 |
|
|
or as following in the ASIC configuration:<br>
|
423 |
|
|
<br>
|
424 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1319832480" alt="Clock structure diagram" title="Clock structure diagram" width="75%">
|
425 |
135 |
olivier.gi |
<br>
|
426 |
50 |
olivier.gi |
<ul>
|
427 |
116 |
olivier.gi |
<li>
|
428 |
135 |
olivier.gi |
<b><font color="#0000b0">CPU_EN</font></b>: this input port provides a hardware mean to stop or resume CPU execution. When unused, this port should be set to 1.
|
429 |
|
|
<br><br>
|
430 |
116 |
olivier.gi |
</li>
|
431 |
|
|
<li>
|
432 |
135 |
olivier.gi |
<b><font color="#0000b0">DCO_CLK</font></b>: this input port is typically connected to a PLL, RC oscillator or any clock resource the target FPGA/ASIC might provide.<br>For the FPGA configuration, from a synthesis tool perspective (ISE, Quartus, Libero, Design
|
433 |
|
|
Compiler...), this the only port where a clock needs to be declared. <br><br>
|
434 |
50 |
olivier.gi |
</li>
|
435 |
135 |
olivier.gi |
|
436 |
|
|
<li>
|
437 |
|
|
<b><font color="#0000b0">LFXT_CLK</font></b>:
|
438 |
|
|
in an FPGA system, if ACLK_EN or SMCLK_EN are going to be used in the project (for example
|
439 |
|
|
through the Watchdog or TimerA peripherals), then this port needs to be
|
440 |
|
|
connected to a clock running at least two time slower as DCO_CLK
|
441 |
|
|
(typically 32kHz). It can be connected to 0 or 1 otherwise.<br>
|
442 |
166 |
olivier.gi |
|
443 |
135 |
olivier.gi |
In an ASIC, if ACLK or SMCLK are used and if the clock muxes are
|
444 |
|
|
included, then this port can be connected to any kind of clock source
|
445 |
|
|
(it doesn't need to be low-frequency. The name was just
|
446 |
|
|
kept to be consistent with TI's documentation).<br><br>
|
447 |
50 |
olivier.gi |
</li>
|
448 |
135 |
olivier.gi |
|
449 |
50 |
olivier.gi |
<li>
|
450 |
135 |
olivier.gi |
<b><font color="#00b000">MCLK</font></b>:
|
451 |
|
|
the main system clock drives the complete openMSP430 clock domain,
|
452 |
|
|
including program/data memories and the peripheral interfaces. <br><br>
|
453 |
50 |
olivier.gi |
</li>
|
454 |
|
|
<li>
|
455 |
135 |
olivier.gi |
<b><font color="#00b000">ACLK_EN / SMCLK_EN</font></b>:
|
456 |
|
|
these two clock enable signals can be used in order to emulate the
|
457 |
|
|
original ACLK and SMCLK from the MSP430 specification when the core is
|
458 |
|
|
targeting an FPGA.<br>
|
459 |
|
|
An example of this can be found in the Watchdog and TimerA modules, where it is implemented as following:<br><br>
|
460 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1246434793" alt="Clock implementation example" title="Clock implementation example"><br>
|
461 |
135 |
olivier.gi |
</li>
|
462 |
50 |
olivier.gi |
</ul>
|
463 |
135 |
olivier.gi |
<ul>
|
464 |
|
|
<li>
|
465 |
|
|
<b><font color="#00b000">ACLK / SMCLK</font></b>: ACLK and MCLK are available through these two ports when targeting an ASIC.<br> </li>
|
466 |
|
|
<li>
|
467 |
|
|
<b><font color="#00b000">DCO_ENABLE / DCO_WKUP</font></b>: ASIC specific signals controlling the fast clock generator for low power mode support (SCG0 bit in the status register).<br><br></li>
|
468 |
|
|
<li>
|
469 |
|
|
<b><font color="#00b000">LFXT_ENABLE / LFXT_WKUP</font></b>:
|
470 |
|
|
ASIC specific signals controlling the low frequency clock generator for
|
471 |
|
|
low power mode support (OSCOFF bit in the status register).<br> </li>
|
472 |
|
|
<li><b><font color="#0000b0">WKUP</font></b>:
|
473 |
|
|
When activated, this signal allows a peripheral to restore all CPU
|
474 |
|
|
clocks (i.e. wakeup the cpu) prior IRQ generation. Note that IRQs
|
475 |
|
|
MUST always be generated from the MCLK clock domain. </li>
|
476 |
|
|
</ul>
|
477 |
50 |
olivier.gi |
|
478 |
135 |
olivier.gi |
As an FPGA system illustration, the following waveform shows the different
|
479 |
|
|
clocks where the software running on the openMSP430 configures the
|
480 |
|
|
BCSCTL1 and BCSCTL2 registers so that <i>ACLK_EN</i> and <i>SMCLK_EN</i> are respectively running at <i>LFXT_CLK/2</i> and <i>DCO_CLK/4</i>.<br><br>
|
481 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1263320613" alt="Waveforms: Clocks - Jan 12. 2010" title="Waveforms: Clocks - Jan 12. 2010" width="100%">
|
482 |
135 |
olivier.gi |
<br><br>
|
483 |
|
|
|
484 |
50 |
olivier.gi |
<a name="3. Resets"></a>
|
485 |
135 |
olivier.gi |
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
486 |
50 |
olivier.gi |
<h1>3. Resets</h1>
|
487 |
|
|
|
488 |
|
|
<ul>
|
489 |
|
|
<li><b><font color="#0000b0">RESET_N</font></b>: this input port is typically connected to a board push button and is generally combined with the system power-on-reset.
|
490 |
135 |
olivier.gi |
<br><br>
|
491 |
50 |
olivier.gi |
</li>
|
492 |
|
|
<li>
|
493 |
135 |
olivier.gi |
<b><font color="#00b000">PUC_RST</font></b>: the Power-Up-Clear signal is asynchronously set with the reset pin (<i>RESET_N</i>),
|
494 |
|
|
the watchdog reset or the serial debug interface reset. In order to get
|
495 |
|
|
clean timings, it is synchronously cleared with MCLK. As
|
496 |
|
|
a general rule, this signal should be used as the reset of the <i>MCLK</i> clock domain.
|
497 |
|
|
<br><br>
|
498 |
50 |
olivier.gi |
</li>
|
499 |
|
|
</ul>
|
500 |
135 |
olivier.gi |
The following waveform illustrates this:<br><br>
|
501 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1263320655" alt="Waveforms: Resets - Jan 12. 2010" title="Waveforms: Resets - Jan 12. 2010" width="100%">
|
502 |
135 |
olivier.gi |
<br><br>
|
503 |
50 |
olivier.gi |
|
504 |
|
|
<a name="4. Program Memory"></a>
|
505 |
135 |
olivier.gi |
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
506 |
50 |
olivier.gi |
<h1>4. Program Memory</h1>
|
507 |
|
|
|
508 |
135 |
olivier.gi |
Depending on the project needs, the program memory can be either implemented as a ROM or RAM.<br>
|
509 |
|
|
<br>
|
510 |
|
|
If a ROM is selected then the <i>PMEM_DIN</i> and <i>PMEM_WEN</i>
|
511 |
|
|
ports won't be connected. In that case, the software debug capabilities
|
512 |
|
|
are limited because the serial debug interface can only use hardware
|
513 |
|
|
breakpoints in order to stop the program execution. In addition,
|
514 |
|
|
updating the software will require a reprogramming of the FPGA... or a new ROM mask for an ASIC.<br>
|
515 |
|
|
<br>
|
516 |
|
|
If the program memory is a RAM, the developer gets full flexibility
|
517 |
|
|
regarding software debugging. The serial debug interface can be used to
|
518 |
|
|
update the program memory and software breakpoints can be used.<br>
|
519 |
|
|
<br><br>
|
520 |
50 |
olivier.gi |
That said, the protocol between the openMSP430 and the program memory is quite standard. Signal description goes as following:
|
521 |
|
|
<ul>
|
522 |
|
|
<li><b><font color="#00b000">PMEM_CEN</font></b>: when this signal is active, the read/write access will be executed with the next <i>MCLK</i> rising edge. Note that this signal is LOW ACTIVE.
|
523 |
135 |
olivier.gi |
<br><br>
|
524 |
50 |
olivier.gi |
</li>
|
525 |
|
|
<li>
|
526 |
135 |
olivier.gi |
<b><font color="#00b000">PMEM_ADDR</font></b>: Memory address of the 16 bit word which is going to be accessed.<br>
|
527 |
50 |
olivier.gi |
<b>Note:</b> in order to calculate the core logical address from the program memory physical address, the formula goes as following: <i>LOGICAL@=2*PHYSICAL@+0x10000-PMEM_SIZE</i>
|
528 |
135 |
olivier.gi |
<br><br>
|
529 |
50 |
olivier.gi |
</li>
|
530 |
|
|
<li>
|
531 |
|
|
<b><font color="#0000b0">PMEM_DOUT</font></b>: the memory output word will be updated with every valid read/write access (i.e. <i>PMEM_DOUT</i> is not updated if <i>PMEM_CEN</i>=1).
|
532 |
135 |
olivier.gi |
<br><br>
|
533 |
50 |
olivier.gi |
</li>
|
534 |
|
|
<li>
|
535 |
135 |
olivier.gi |
<b><font color="#00b000">PMEM_WEN</font></b>:
|
536 |
|
|
this signal selects which byte should be written during a valid access.
|
537 |
|
|
PMEM_WEN[0] will activate a write on the lower byte, PMEM_WEN[1] a
|
538 |
|
|
write on the upper byte. Note that these signals are LOW ACTIVE. <br><br>
|
539 |
50 |
olivier.gi |
</li>
|
540 |
|
|
<li>
|
541 |
|
|
<b><font color="#00b000">PMEM_DIN</font></b>: the memory input word will be written with the valid write access according to the <i>PMEM_WEN</i> value.
|
542 |
135 |
olivier.gi |
<br><br>
|
543 |
50 |
olivier.gi |
</li>
|
544 |
|
|
</ul>
|
545 |
135 |
olivier.gi |
The following waveform illustrates some read accesses of the program
|
546 |
|
|
memory (write access are illustrated in the data memory section):<br><br>
|
547 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1263320706" alt="Waveforms: Program memory - Jan " title="Waveforms: Program memory - Jan " width="100%">
|
548 |
135 |
olivier.gi |
<br><br>
|
549 |
50 |
olivier.gi |
<a name="5. Data Memory"></a>
|
550 |
135 |
olivier.gi |
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
551 |
50 |
olivier.gi |
<h1>5. Data Memory</h1>
|
552 |
|
|
|
553 |
135 |
olivier.gi |
The data memory is always implemented as a RAM.<br>
|
554 |
|
|
<br>
|
555 |
|
|
The protocol between the openMSP430 and the data memory is the same as
|
556 |
|
|
the one of the program memory. Therefore, the signal description is the
|
557 |
|
|
same:
|
558 |
50 |
olivier.gi |
<ul>
|
559 |
|
|
<li><b><font color="#00b000">DMEM_CEN</font></b>: when this signal is active, the read/write access will be executed with the next <i>MCLK</i> rising edge. Note that this signal is LOW ACTIVE.
|
560 |
135 |
olivier.gi |
<br><br>
|
561 |
50 |
olivier.gi |
</li>
|
562 |
|
|
<li>
|
563 |
135 |
olivier.gi |
<b><font color="#00b000">DMEM_ADDR</font></b>: Memory address of the 16 bit word which is going to be accessed.<br>
|
564 |
50 |
olivier.gi |
<b>Note:</b> in order to calculate the core logical address from the data memory physical address, the formula goes as following: <i>LOGICAL@=2*PHYSICAL@+0x200</i>
|
565 |
135 |
olivier.gi |
<br><br>
|
566 |
50 |
olivier.gi |
</li>
|
567 |
|
|
<li>
|
568 |
|
|
<b><font color="#0000b0">DMEM_DOUT</font></b>: the memory output word will be updated with every valid read/write access (i.e. <i>DMEM_DOUT</i> is not updated if <i>DMEM_CEN</i>=1).
|
569 |
135 |
olivier.gi |
<br><br>
|
570 |
50 |
olivier.gi |
</li>
|
571 |
|
|
<li>
|
572 |
135 |
olivier.gi |
<b><font color="#00b000">DMEM_WEN</font></b>:
|
573 |
|
|
this signal selects which byte should be written during a valid access.
|
574 |
|
|
DMEM_WEN[0] will activate a write on the lower byte, DMEM_WEN[1] a
|
575 |
|
|
write on the upper byte. Note that these signals are LOW ACTIVE. <br><br>
|
576 |
50 |
olivier.gi |
</li>
|
577 |
|
|
<li>
|
578 |
|
|
<b><font color="#00b000">DMEM_DIN</font></b>: the memory input word will be written with the valid write access according to the <i>DMEM_WEN</i> value.
|
579 |
135 |
olivier.gi |
<br><br>
|
580 |
50 |
olivier.gi |
</li>
|
581 |
|
|
</ul>
|
582 |
135 |
olivier.gi |
The following waveform illustrates some read/write access to the data memory:<br><br>
|
583 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1263320770" alt="Waveforms: Data memory - Jan 12." title="Waveforms: Data memory - Jan 12." width="100%">
|
584 |
135 |
olivier.gi |
<br><br>
|
585 |
50 |
olivier.gi |
|
586 |
|
|
<a name="6. Peripherals"></a>
|
587 |
135 |
olivier.gi |
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
588 |
50 |
olivier.gi |
<h1>6. Peripherals</h1>
|
589 |
135 |
olivier.gi |
The protocol between the openMSP430 core and its peripherals is the
|
590 |
|
|
exactly same as the one with the data and program memories in regard
|
591 |
|
|
to write access and differs slightly for read access.<br>
|
592 |
|
|
<br>
|
593 |
|
|
On the connectivity side, the specificity is that the read data bus of
|
594 |
|
|
all peripherals should be ORed together before being connected to the
|
595 |
|
|
core, as showed in the diagram of the <a href="#1.%20Overview">Overview</a> section.<br>
|
596 |
|
|
From the logical point of view, during a read access, each peripheral
|
597 |
|
|
outputs the combinatorial value of its read mux and returns 0 if it
|
598 |
|
|
doesn't contain the addressed register. On the waveforms, this
|
599 |
|
|
translates by seeing the register value on <i>PER_DOUT</i> while <i>PER_EN</i> is valid and not one clock cycle afterward as it is the case with the program and data memories.<br>
|
600 |
|
|
In any case, it is recommended to use the templates provided with the core in order to develop your own custom peripherals.<br>
|
601 |
50 |
olivier.gi |
The signal description therefore goes as following:
|
602 |
|
|
<ul>
|
603 |
|
|
<li><b><font color="#00b000">PER_EN</font></b>: when this signal is active, read access are executed during the current <i>MCLK</i> cycle while write access will be executed with the next <i>MCLK</i> rising edge. Note that this signal is HIGH ACTIVE.
|
604 |
135 |
olivier.gi |
<br><br>
|
605 |
50 |
olivier.gi |
</li>
|
606 |
|
|
<li>
|
607 |
135 |
olivier.gi |
<b><font color="#00b000">PER_ADDR</font></b>:
|
608 |
|
|
peripheral register address of the 16 bit word which is currently
|
609 |
|
|
accessed. It is to be noted that a 14 bit address will always be
|
610 |
|
|
provided from the openMSP430 to the peripheral in order to accommodate
|
611 |
|
|
the biggest possible PER_SIZE Verilog configuration option (i.e. 32kB
|
612 |
|
|
as opposed to 512B by default).<br>
|
613 |
50 |
olivier.gi |
<b>Note:</b> in order to calculate the core logical address from the peripheral register physical address, the formula goes as following: <i>LOGICAL@=2*PHYSICAL@</i>
|
614 |
135 |
olivier.gi |
<br><br>
|
615 |
50 |
olivier.gi |
</li>
|
616 |
|
|
<li>
|
617 |
|
|
<b><font color="#0000b0">PER_DOUT</font></b>: the peripheral output word will be updated with every valid read/write access, it will be set to 0 otherwise.
|
618 |
135 |
olivier.gi |
<br><br>
|
619 |
50 |
olivier.gi |
</li>
|
620 |
|
|
<li>
|
621 |
135 |
olivier.gi |
<b><font color="#00b000">PER_WE</font></b>:
|
622 |
|
|
this signal selects which byte should be written during a valid access.
|
623 |
|
|
PER_WE[0] will activate a write on the lower byte, PER_WE[1] a write on
|
624 |
|
|
the upper byte. Note that these signals are HIGH ACTIVE. <br><br>
|
625 |
50 |
olivier.gi |
</li>
|
626 |
|
|
<li>
|
627 |
|
|
<b><font color="#00b000">PER_DIN</font></b>: the peripheral input word will be written with the valid write access according to the <i>PER_WEN</i> value.
|
628 |
135 |
olivier.gi |
<br><br>
|
629 |
50 |
olivier.gi |
</li>
|
630 |
|
|
</ul>
|
631 |
135 |
olivier.gi |
The following waveform illustrates some read/write access to the peripheral registers:<br><br>
|
632 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1263320825" alt="Waveforms: Peripherals - Jan 12." title="Waveforms: Peripherals - Jan 12." width="100%">
|
633 |
135 |
olivier.gi |
<br><br>
|
634 |
50 |
olivier.gi |
|
635 |
|
|
|
636 |
|
|
<a name="7. Interrupts"></a>
|
637 |
135 |
olivier.gi |
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
638 |
|
|
<h1>7. Interrupts</h1> As with the original MSP430, the interrupt
|
639 |
|
|
priorities of the openMSP430 are fixed in hardware accordingly to the
|
640 |
|
|
connectivity of the <i>NMI</i> and <i>IRQ</i> ports.<br>
|
641 |
|
|
If two interrupts are pending simultaneously, the higher priority interrupt will be serviced first.<br>
|
642 |
|
|
The following table summarize this:<br><br>
|
643 |
50 |
olivier.gi |
<table border="1">
|
644 |
135 |
olivier.gi |
<tbody><tr>
|
645 |
50 |
olivier.gi |
<td align="center"><b> Interrupt Port </b></td>
|
646 |
|
|
<td align="center"><b> Vector address </b></td>
|
647 |
|
|
<td align="center"><b> Priority </b></td>
|
648 |
|
|
</tr>
|
649 |
|
|
<tr>
|
650 |
|
|
<td align="center">RESET_N</td>
|
651 |
|
|
<td align="center">0xFFFE</td>
|
652 |
|
|
<td align="center">15 (highest)</td>
|
653 |
|
|
</tr>
|
654 |
|
|
<tr>
|
655 |
|
|
<td align="center">NMI</td>
|
656 |
|
|
<td align="center">0xFFFC</td>
|
657 |
|
|
<td align="center">14</td>
|
658 |
|
|
</tr>
|
659 |
|
|
<tr>
|
660 |
|
|
<td align="center">IRQ[13]</td>
|
661 |
|
|
<td align="center">0xFFFA</td>
|
662 |
|
|
<td align="center">13</td>
|
663 |
|
|
</tr>
|
664 |
|
|
<tr>
|
665 |
|
|
<td align="center">IRQ[12]</td>
|
666 |
|
|
<td align="center">0xFFF8</td>
|
667 |
|
|
<td align="center">12</td>
|
668 |
|
|
</tr>
|
669 |
|
|
<tr>
|
670 |
|
|
<td align="center">IRQ[11]</td>
|
671 |
|
|
<td align="center">0xFFF6</td>
|
672 |
|
|
<td align="center">11</td>
|
673 |
|
|
</tr>
|
674 |
|
|
<tr>
|
675 |
|
|
<td align="center">IRQ[10]</td>
|
676 |
|
|
<td align="center">0xFFF4</td>
|
677 |
|
|
<td align="center">10</td>
|
678 |
|
|
</tr>
|
679 |
|
|
<tr>
|
680 |
|
|
<td align="center">IRQ[9]</td>
|
681 |
|
|
<td align="center">0xFFF2</td>
|
682 |
|
|
<td align="center">9</td>
|
683 |
|
|
</tr>
|
684 |
|
|
<tr>
|
685 |
|
|
<td align="center">IRQ[8]</td>
|
686 |
|
|
<td align="center">0xFFF0</td>
|
687 |
|
|
<td align="center">8</td>
|
688 |
|
|
</tr>
|
689 |
|
|
<tr>
|
690 |
|
|
<td align="center">IRQ[7]</td>
|
691 |
|
|
<td align="center">0xFFEE</td>
|
692 |
|
|
<td align="center">7</td>
|
693 |
|
|
</tr>
|
694 |
|
|
<tr>
|
695 |
|
|
<td align="center">IRQ[6]</td>
|
696 |
|
|
<td align="center">0xFFEC</td>
|
697 |
|
|
<td align="center">6</td>
|
698 |
|
|
</tr>
|
699 |
|
|
<tr>
|
700 |
|
|
<td align="center">IRQ[5]</td>
|
701 |
|
|
<td align="center">0xFFEA</td>
|
702 |
|
|
<td align="center">5</td>
|
703 |
|
|
</tr>
|
704 |
|
|
<tr>
|
705 |
|
|
<td align="center">IRQ[4]</td>
|
706 |
|
|
<td align="center">0xFFE8</td>
|
707 |
|
|
<td align="center">4</td>
|
708 |
|
|
</tr>
|
709 |
|
|
<tr>
|
710 |
|
|
<td align="center">IRQ[3]</td>
|
711 |
|
|
<td align="center">0xFFE6</td>
|
712 |
|
|
<td align="center">3</td>
|
713 |
|
|
</tr>
|
714 |
|
|
<tr>
|
715 |
|
|
<td align="center">IRQ[2]</td>
|
716 |
|
|
<td align="center">0xFFE4</td>
|
717 |
|
|
<td align="center">2</td>
|
718 |
|
|
</tr>
|
719 |
|
|
<tr>
|
720 |
|
|
<td align="center">IRQ[1]</td>
|
721 |
|
|
<td align="center">0xFFE2</td>
|
722 |
|
|
<td align="center">1</td>
|
723 |
|
|
</tr>
|
724 |
|
|
<tr>
|
725 |
|
|
<td align="center">IRQ[0]</td>
|
726 |
|
|
<td align="center">0xFFE0</td>
|
727 |
|
|
<td align="center">0 (lowest)</td>
|
728 |
|
|
</tr>
|
729 |
135 |
olivier.gi |
</tbody></table>
|
730 |
|
|
<br><br>
|
731 |
50 |
olivier.gi |
The signal description goes as following:
|
732 |
|
|
<ul>
|
733 |
|
|
<li>
|
734 |
135 |
olivier.gi |
<b><font color="#0000b0">NMI</font></b>: The <b>N</b>on-<b>M</b>askable <b>I</b>nterrupt has higher priority than other IRQs and is masked by the NMIIE bit instead of GIE.<br>
|
735 |
|
|
It is internally synchronized to the <i>MCLK</i>
|
736 |
|
|
domain and can therefore be connected to any asynchronous signal of the
|
737 |
|
|
chip (which could for example be a pin of the FPGA). If unused, this
|
738 |
|
|
signal should be connected to 0. <br><br>
|
739 |
50 |
olivier.gi |
</li>
|
740 |
|
|
<li>
|
741 |
135 |
olivier.gi |
<b><font color="#0000b0">IRQ</font></b>: The standard interrupts can be connected to any signal coming from the <i>MCLK</i> domain (typically a peripheral). Priorities can be chosen by selecting the proper bit of the <i>IRQ</i> bus as shown in the table above. Unused interrupts should be connected to 0.<br>
|
742 |
|
|
<b>Note</b>: <i>IRQ[10]</i> is internally connected to the Watchdog
|
743 |
|
|
interrupt. If this bit is also used by an external peripheral, they
|
744 |
|
|
will both share the same interrupt vector. <br><br>
|
745 |
50 |
olivier.gi |
</li>
|
746 |
|
|
<li>
|
747 |
135 |
olivier.gi |
<b><font color="#00b000">IRQ_ACC</font></b>:
|
748 |
|
|
Whenever an interrupt request is serviced, some peripheral
|
749 |
|
|
automatically clear their pending flag in hardware. In order to do so,
|
750 |
|
|
the <i>IRQ_ACC</i> bus can be used by using the bit matching the corresponding <i>IRQ</i> bit. An example of this is shown in the implementation of the TACCR0 Timer A interrupt.
|
751 |
|
|
<br><br>
|
752 |
50 |
olivier.gi |
</li>
|
753 |
|
|
</ul>
|
754 |
135 |
olivier.gi |
The following waveform illustrates a TAIV interrupt issued by the Timer-A, which is connected to <i>IRQ[8]</i> :<br><br>
|
755 |
166 |
olivier.gi |
<img src="http://opencores.org/usercontent,img,1263320861" alt="Waveforms: Interrupts - Jan 12. " title="Waveforms: Interrupts - Jan 12. " width="100%">
|
756 |
50 |
olivier.gi |
|
757 |
135 |
olivier.gi |
<br><br>
|
758 |
50 |
olivier.gi |
|
759 |
|
|
|
760 |
|
|
<a name="8. Serial Debug Interface"></a>
|
761 |
135 |
olivier.gi |
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
762 |
50 |
olivier.gi |
<h1>8. Serial Debug Interface</h1>
|
763 |
135 |
olivier.gi |
The serial debug interface module provides a two-wires communication
|
764 |
166 |
olivier.gi |
bus (UART or I2C) for remote debugging and an additional freeze signal which might be
|
765 |
135 |
olivier.gi |
useful for some peripherals (typically timers).<br>
|
766 |
|
|
<br>
|
767 |
50 |
olivier.gi |
<ul>
|
768 |
|
|
<li>
|
769 |
135 |
olivier.gi |
<b><font color="#0000b0">DBG_EN</font></b>: this signal
|
770 |
|
|
allows the user to enable or disable the serial debug interface without
|
771 |
|
|
interfering with the CPU execution. It is to be noted that when
|
772 |
|
|
disabled (i.e. DBG_EN=0), the debug interface is held into reset. <br><br>
|
773 |
116 |
olivier.gi |
</li>
|
774 |
|
|
<li>
|
775 |
135 |
olivier.gi |
<b><font color="#00b000">DBG_FREEZE</font></b>: this signal will be set whenever the debug interface stops the CPU (and if the <i>FRZ_BRK_EN</i> field of the <a href="http://www.opencores.org/project,openmsp430,serial%20debug%20interface#2.2.2%20CPU_CTL">CPU_CTL</a> debug register is set). As its name implies, the purpose of <i>DBG_FREEZE</i> is to freeze a peripheral whenever the CPU is stopped by the software debugger.<br>
|
776 |
|
|
For example, it is used by the Watchdog timer in order to stop its
|
777 |
|
|
free-running counter. This prevents the CPU from being reseted by the
|
778 |
|
|
watchdog every times the user stops the CPU during a debugging session.
|
779 |
|
|
<br><br>
|
780 |
50 |
olivier.gi |
</li>
|
781 |
166 |
olivier.gi |
</ul>
|
782 |
|
|
<a name="8.1 UART"></a>
|
783 |
|
|
<h2>8.1 UART Configuration</h2>
|
784 |
|
|
<ul>
|
785 |
50 |
olivier.gi |
<li>
|
786 |
|
|
<b><font color="#00b000">DBG_UART_TXD</font> / <font color="#0000b0">DBG_UART_RXD</font></b>: these signals are typically connected to an RS-232 transceiver and will allow a PC to communicate with the openMSP430 core.
|
787 |
135 |
olivier.gi |
<br><br>
|
788 |
50 |
olivier.gi |
</li>
|
789 |
|
|
</ul>
|
790 |
166 |
olivier.gi |
The following waveform shows some communication traffic on the UART serial bus :<br><br>
|
791 |
|
|
<img src="http://opencores.org/usercontent,img,1263320887" alt="Waveforms: SDI - Jan 12. 2010" title="Waveforms: SDI - Jan 12. 2010" width="100%">
|
792 |
135 |
olivier.gi |
<br><br>
|
793 |
166 |
olivier.gi |
<a name="8.2 I2C"></a>
|
794 |
|
|
<h2>8.2 I2C Configuration</h2>
|
795 |
|
|
<ul>
|
796 |
|
|
<li>
|
797 |
|
|
<b><font color="#0000b0">DBG_I2C_ADDR</font></b>: I2C Device address of the oMSP core (between 8 and 119). In a multi-core configuration each core has its own address.
|
798 |
|
|
<br><br>
|
799 |
|
|
</li>
|
800 |
|
|
<li>
|
801 |
|
|
<b><font color="#0000b0">DBG_I2C_BROADCAST</font></b>:
|
802 |
|
|
I2C Device broadcast address of the oMSP core (between 8 and 119). In a
|
803 |
|
|
multi-core configuration all cores have the same broadcast address. <br><br>
|
804 |
|
|
</li>
|
805 |
|
|
<li>
|
806 |
|
|
<b><font color="#0000b0">DBG_I2C_SCL</font></b>: I2C bus clock input (SCL).
|
807 |
|
|
<br><br>
|
808 |
|
|
</li>
|
809 |
|
|
<li>
|
810 |
|
|
<b><font color="#00b000">DBG_I2C_SDA_OUT</font> / <font color="#0000b0">DBG_I2C_SDA_IN</font></b>: these signals are connected to the SDA I/O cell as following:<br><br>
|
811 |
|
|
<div style="text-align: center;"><img src="http://opencores.org/usercontent,img,1353268717" alt="I2C SDA IO Connect" title="I2C SDA IO Connect" width="50%">
|
812 |
|
|
<br>
|
813 |
|
|
</div>
|
814 |
|
|
<br>
|
815 |
|
|
</li>
|
816 |
|
|
</ul>
|
817 |
|
|
|
818 |
|
|
The following waveform shows some communication traffic on the I2C serial bus :<br><br>
|
819 |
|
|
<img src="http://opencores.org/usercontent,img,1353272928" alt="Waveforms: SDI I2C" title="Waveforms: SDI I2C" width="100%">
|
820 |
|
|
<br><br>
|
821 |
|
|
<div style="text-align: right;"><a href="#TOC">Top</a></div>
|
822 |
|
|
|
823 |
135 |
olivier.gi |
</body></html>
|