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

Subversion Repositories openmsp430

[/] [openmsp430/] [trunk/] [doc/] [html/] [serial_debug_interface.html] - Blame information for rev 74

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 50 olivier.gi
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2
<html>
3
<head>
4
<title>openMSP430 Serial Debug Interface</title>
5
</head>
6
<body>
7
<a name="TOC"></a>
8
<h3>Table of content</h3>
9
<ul>
10
        <li><a href="#1. Introduction">                          1. Introduction</a></li>
11
        <li><a href="#2. Debug Unit">                            2. Debug Unit</a>
12
        <ul>
13
      <li><a href="#2.1 Register Mapping">                  2.1 Register Mapping</a></li>
14
      <li><a href="#2.2 CPU Control/Status Registers">      2.2 CPU Control/Status Registers</a></li>
15
                <ul>
16
           <li><a href="#2.2.1 CPU_ID">                       2.2.1 CPU_ID</a></li>
17
        <li><a href="#2.2.2 CPU_CTL">                      2.2.2 CPU_CTL</a></li>
18
        <li><a href="#2.2.3 CPU_STAT">                     2.2.3 CPU_STAT</a></li>
19
                </ul>
20
      <li><a href="#2.3 Memory Access Registers">           2.3 Memory Access Registers</a></li>
21
                <ul>
22
           <li><a href="#2.3.1 MEM_CTL">                      2.3.1 MEM_CTL</a></li>
23
        <li><a href="#2.3.2 MEM_ADDR">                     2.3.2 MEM_ADDR</a></li>
24
        <li><a href="#2.3.3 MEM_DATA">                     2.3.3 MEM_DATA</a></li>
25
        <li><a href="#2.3.4 MEM_CNT">                      2.3.4 MEM_CNT</a></li>
26
                </ul>
27
      <li><a href="#2.4 Hardware Breakpoint Unit Registers">2.4 Hardware Breakpoint Unit Registers</a></li>
28
                <ul>
29
           <li><a href="#2.4.1 BRKx_CTL">                     2.4.1 BRKx_CTL</a></li>
30
        <li><a href="#2.4.2 BRKx_STAT">                    2.4.2 BRKx_STAT</a></li>
31
        <li><a href="#2.4.3 BRKx_ADDR0">                   2.4.3 BRKx_ADDR0</a></li>
32
        <li><a href="#2.4.4 BRKx_ADDR1">                   2.4.4 BRKx_ADDR1</a></li>
33
                </ul>
34
        </ul>
35
        </li>
36
        <li><a href="#3. Debug Communication Interface: UART">   3. Debug Communication Interface: UART</a>
37
                <ul>
38
           <li><a href="#3.1 Serial communication protocol: 8N1">       3.1 Serial communication protocol: 8N1</a></li>
39
        <li><a href="#3.2 Synchronization frame">                    3.2 Synchronization frame</a></li>
40
        <li><a href="#3.3 Read/Write access to the debug registers"> 3.3 Read/Write access to the debug registers</a></li>
41
                        <ul>
42
                <li><a href="#3.3.1 Command Frame">                       3.3.1 Command Frame</a></li>
43
                <li><a href="#3.3.2 Write access">                        3.3.2 Write access</a></li>
44
                <li><a href="#3.3.3 Read access">                         3.3.3 Read access</a></li>
45
                        </ul>
46
        <li><a href="#3.4 Read/Write burst implementation for the CPU Memory access">3.4 Read/Write burst implementation for the CPU Memory access</a></li>
47
                        <ul>
48
                <li><a href="#3.4.1 Write Burst access">                  3.4.1 Write Burst access</a></li>
49
                <li><a href="#3.4.2 Read Burst access">                   3.4.2 Read Burst access</a></li>
50
                        </ul>
51
                </ul>
52
</ul>
53
 
54
<a name="1. Introduction"></a>
55
<h1>1. Introduction</h1>
56
 
57
The original MSP430 from TI provides a serial debug interface to give a simple path to software development. In that case, the communication with the host computer is typically build on a JTAG or Spy-Bi-Wire serial protocol. However, the global debug architecture from the MSP430 is unfortunately poorly documented on the web (and is also probably tightly linked with the internal core architecture).
58
<br /><br />
59
A custom module has therefore been implemented for the openMSP430. The communication with the host is done with a simple RS232 cable (8N1 serial protocol) and the debug unit provides all the required features for Nexus Class 3 debugging (beside trace), namely:
60
<ul>
61
        <li>CPU control (run, stop, step, reset).</li>
62
        <li>Software & hardware breakpoint support.</li>
63
        <li>Memory read/write on-the-fly (no need to halt execution).</li>
64
        <li>CPU registers read/write on-the-fly (no need to halt execution).</li>
65
</ul>
66
 
67
<a name="2. Debug Unit"></a>
68
<div style="text-align: right"><a href="#TOC">Top</a></div>
69
<h1>2. Debug Unit</h1>
70
 
71
<a name="2.1 Register Mapping"></a>
72
<h2>2.1 Register Mapping</h2>
73
 
74
The following table summarize the complete debug register set accessible through the debug communication interface:
75
<br /><br />
76
<table border="1">
77
<tr align="center">
78
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
79
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
80
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
81
</tr>
82
<tr align="center">
83
<td><font size="-1">15</font></td><td><font size="-1">14</font></td>
84
<td><font size="-1">13</font></td><td><font size="-1">12</font></td>
85
<td><font size="-1">11</font></td><td><font size="-1">10</font></td>
86
<td><font size="-1"> 9</font></td><td><font size="-1"> 8</font></td>
87
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
88
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
89
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
90
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
91
</tr>
92
<tr align="center">
93
<td><font size="-1"><a href="#2.2.1 CPU_ID">CPU_ID_LO</a></font></td>
94
<td><font size="-1">0x00</font></td>
95 74 olivier.gi
<td colspan="16"><font size="-5">DMEM_AWIDTH</font></td>
96 50 olivier.gi
</tr>
97
<tr align="center">
98
<td><font size="-1"><a href="#2.2.1 CPU_ID">CPU_ID_HI</a></font></td>
99
<td><font size="-1">0x01</font></td>
100 74 olivier.gi
<td colspan="16"><font size="-5">PMEM_AWIDTH</font></td>
101 50 olivier.gi
</tr>
102
<tr align="center">
103
<td><font size="-1"><a href="#2.2.2 CPU_CTL">CPU_CTL</a></font></td>
104
<td><font size="-1">0x02</font></td>
105
<td colspan="9"><font size="-5">Reserved</font></td>
106
<td><font size="-5">CPU_RST</font></td>
107
<td><font size="-5">RST_BRK_EN</font></td>
108
<td><font size="-5">FRZ_BRK_EN</font></td>
109
<td><font size="-5">SW_BRK_EN</font></td>
110
<td><font size="-5">ISTEP</font></td>
111
<td><font size="-5">RUN</font></td>
112
<td><font size="-5">HALT</font></td>
113
</tr>
114
<tr align="center">
115
<td><font size="-1"><a href="#2.2.3 CPU_STAT">CPU_STAT</a></font></td>
116
<td><font size="-1">0x03</font></td>
117
<td colspan="8"><font size="-5">Reserved</font></td>
118
<td><font size="-5">HWBRK3_PND</font></td>
119
<td><font size="-5">HWBRK2_PND</font></td>
120
<td><font size="-5">HWBRK1_PND</font></td>
121
<td><font size="-5">HWBRK0_PND</font></td>
122
<td><font size="-5">SWBRK_PND</font></td>
123
<td><font size="-5">PUC_PND</font></td>
124
<td><font size="-5">Res.</font></td>
125
<td><font size="-5">HALT_RUN</font></td>
126
</tr>
127
<tr align="center">
128
<td><font size="-1"><a href="#2.3.1 MEM_CTL">MEM_CTL</a></font></td>
129
<td><font size="-1">0x04</font></td>
130
<td colspan="12"><font size="-5">Reserved</font></td>
131
<td><font size="-5">B/W</font></td>
132
<td><font size="-5">MEM/REG</font></td>
133
<td><font size="-5">RD/WR</font></td>
134
<td><font size="-5">START</font></td>
135
</tr>
136
<tr align="center">
137
<td><font size="-1"><a href="#2.3.2 MEM_ADDR">MEM_ADDR</a></font></td>
138
<td><font size="-1">0x05</font></td>
139
<td colspan="16"><font size="-5">MEM_ADDR[15:0]</font></td>
140
</tr>
141
<tr align="center">
142
<td><font size="-1"><a href="#2.3.3 MEM_DATA">MEM_DATA</a></font></td>
143
<td><font size="-1">0x06</font></td>
144
<td colspan="16"><font size="-5">MEM_DATA[15:0]</font></td>
145
</tr>
146
<tr align="center">
147
<td><font size="-1"><a href="#2.3.4 MEM_CNT">MEM_CNT</a></font></td>
148
<td><font size="-1">0x07</font></td>
149
<td colspan="16"><font size="-5">MEM_CNT[15:0]</font></td>
150
</tr>
151
<tr align="center">
152
<td><font size="-1"><a href="#2.4.1 BRKx_CTL">BRK0_CTL</a></font></td>
153
<td><font size="-1">0x08</font></td>
154
<td colspan="11"><font size="-5">Reserved</font></td>
155
<td><font size="-5">RANGE_MODE</font></td>
156
<td><font size="-5">INST_EN</font></td>
157
<td><font size="-5">BREAK_EN</font></td>
158
<td colspan="2"><font size="-5">ACCESS_MODE</font></td>
159
</tr>
160
<tr align="center">
161
<td><font size="-1"><a href="#2.4.2 BRKx_STAT">BRK0_STAT</a></font></td>
162
<td><font size="-1">0x09</font></td>
163
<td colspan="10"><font size="-5">Reserved</font></td>
164
<td><font size="-5">RANGE_WR</font></td>
165
<td><font size="-5">RANGE_RD</font></td>
166
<td><font size="-5">ADDR1_WR</font></td>
167
<td><font size="-5">ADDR1_RD</font></td>
168
<td><font size="-5">ADDR0_WR</font></td>
169
<td><font size="-5">ADDR0_RD</font></td>
170
</tr>
171
<tr align="center">
172
<td><font size="-1"><a href="#2.4.3 BRKx_ADDR0">BRK0_ADDR0</a></font></td>
173
<td><font size="-1">0x0A</font></td>
174
<td colspan="16"><font size="-5">BRK_ADDR0[15:0]</font></td>
175
</tr>
176
<tr align="center">
177
<td><font size="-1"><a href="#2.4.4 BRKx_ADDR1">BRK0_ADDR1</a></font></td>
178
<td><font size="-1">0x0B</font></td>
179
<td colspan="16"><font size="-5">BRK_ADDR1[15:0]</font></td>
180
</tr>
181
<tr align="center">
182
<td><font size="-1"><a href="#2.4.1 BRKx_CTL">BRK1_CTL</a></font></td>
183
<td><font size="-1">0x0C</font></td>
184
<td colspan="11"><font size="-5">Reserved</font></td>
185
<td><font size="-5">RANGE_MODE</font></td>
186
<td><font size="-5">INST_EN</font></td>
187
<td><font size="-5">BREAK_EN</font></td>
188
<td colspan="2"><font size="-5">ACCESS_MODE</font></td>
189
</tr>
190
<tr align="center">
191
<td><font size="-1"><a href="#2.4.2 BRKx_STAT">BRK1_STAT</a></font></td>
192
<td><font size="-1">0x0D</font></td>
193
<td colspan="10"><font size="-5">Reserved</font></td>
194
<td><font size="-5">RANGE_WR</font></td>
195
<td><font size="-5">RANGE_RD</font></td>
196
<td><font size="-5">ADDR1_WR</font></td>
197
<td><font size="-5">ADDR1_RD</font></td>
198
<td><font size="-5">ADDR0_WR</font></td>
199
<td><font size="-5">ADDR0_RD</font></td>
200
</tr>
201
<tr align="center">
202
<td><font size="-1"><a href="#2.4.3 BRKx_ADDR0">BRK1_ADDR0</a></font></td>
203
<td><font size="-1">0x0E</font></td>
204
<td colspan="16"><font size="-5">BRK_ADDR0[15:0]</font></td>
205
</tr>
206
<tr align="center">
207
<td><font size="-1"><a href="#2.4.4 BRKx_ADDR1">BRK1_ADDR1</a></font></td>
208
<td><font size="-1">0x0F</font></td>
209
<td colspan="16"><font size="-5">BRK_ADDR1[15:0]</font></td>
210
</tr>
211
<tr align="center">
212
<td><font size="-1"><a href="#2.4.1 BRKx_CTL">BRK2_CTL</a></font></td>
213
<td><font size="-1">0x10</font></td>
214
<td colspan="11"><font size="-5">Reserved</font></td>
215
<td><font size="-5">RANGE_MODE</font></td>
216
<td><font size="-5">INST_EN</font></td>
217
<td><font size="-5">BREAK_EN</font></td>
218
<td colspan="2"><font size="-5">ACCESS_MODE</font></td>
219
</tr>
220
<tr align="center">
221
<td><font size="-1"><a href="#2.4.2 BRKx_STAT">BRK2_STAT</a></font></td>
222
<td><font size="-1">0x11</font></td>
223
<td colspan="10"><font size="-5">Reserved</font></td>
224
<td><font size="-5">RANGE_WR</font></td>
225
<td><font size="-5">RANGE_RD</font></td>
226
<td><font size="-5">ADDR1_WR</font></td>
227
<td><font size="-5">ADDR1_RD</font></td>
228
<td><font size="-5">ADDR0_WR</font></td>
229
<td><font size="-5">ADDR0_RD</font></td>
230
</tr>
231
<tr align="center">
232
<td><font size="-1"><a href="#2.4.3 BRKx_ADDR0">BRK2_ADDR0</a></font></td>
233
<td><font size="-1">0x12</font></td>
234
<td colspan="16"><font size="-5">BRK_ADDR0[15:0]</font></td>
235
</tr>
236
<tr align="center">
237
<td><font size="-1"><a href="#2.4.4 BRKx_ADDR1">BRK2_ADDR1</a></font></td>
238
<td><font size="-1">0x13</font></td>
239
<td colspan="16"><font size="-5">BRK_ADDR1[15:0]</font></td>
240
</tr>
241
<tr align="center">
242
<td><font size="-1"><a href="#2.4.1 BRKx_CTL">BRK3_CTL</a></font></td>
243
<td><font size="-1">0x14</font></td>
244
<td colspan="11"><font size="-5">Reserved</font></td>
245
<td><font size="-5">RANGE_MODE</font></td>
246
<td><font size="-5">INST_EN</font></td>
247
<td><font size="-5">BREAK_EN</font></td>
248
<td colspan="2"><font size="-5">ACCESS_MODE</font></td>
249
</tr>
250
<tr align="center">
251
<td><font size="-1"><a href="#2.4.2 BRKx_STAT">BRK3_STAT</a></font></td>
252
<td><font size="-1">0x15</font></td>
253
<td colspan="10"><font size="-5">Reserved</font></td>
254
<td><font size="-5">RANGE_WR</font></td>
255
<td><font size="-5">RANGE_RD</font></td>
256
<td><font size="-5">ADDR1_WR</font></td>
257
<td><font size="-5">ADDR1_RD</font></td>
258
<td><font size="-5">ADDR0_WR</font></td>
259
<td><font size="-5">ADDR0_RD</font></td>
260
</tr>
261
<tr align="center">
262
<td><font size="-1"><a href="#2.4.3 BRKx_ADDR0">BRK3_ADDR0</a></font></td>
263
<td><font size="-1">0x16</font></td>
264
<td colspan="16"><font size="-5">BRK_ADDR0[15:0]</font></td>
265
</tr>
266
<tr align="center">
267
<td><font size="-1"><a href="#2.4.4 BRKx_ADDR1">BRK3_ADDR1</a></font></td>
268
<td><font size="-1">0x17</font></td>
269
<td colspan="16"><font size="-5">BRK_ADDR1[15:0]</font></td>
270
</tr>
271
</table>
272
 
273
<a name="2.2 CPU Control/Status Registers"></a>
274
<div style="text-align: right"><a href="#TOC">Top</a></div>
275
<h2>2.2 CPU Control/Status Registers</h2>
276
 
277
<a name="2.2.1 CPU_ID"></a>
278
<h3>2.2.1 CPU_ID</h3>
279 74 olivier.gi
This 32 bit read-only register holds the program and data memory size information of the implemented openMSP430.
280 50 olivier.gi
<br /><br />
281
<table border="1">
282
<tr align="center">
283
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
284
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
285
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
286
</tr>
287
<tr align="center">
288
<td><font size="-1">15</font></td><td><font size="-1">14</font></td>
289
<td><font size="-1">13</font></td><td><font size="-1">12</font></td>
290
<td><font size="-1">11</font></td><td><font size="-1">10</font></td>
291
<td><font size="-1"> 9</font></td><td><font size="-1"> 8</font></td>
292
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
293
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
294
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
295
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
296
</tr>
297
<tr align="center">
298
<td><font size="-1">CPU_ID_LO</font></td>
299
<td><font size="-1">0x00</font></td>
300 74 olivier.gi
<td colspan="16"><font size="-5">DMEM_AWIDTH</font></td>
301 50 olivier.gi
</tr>
302
<tr align="center">
303
<td><font size="-1">CPU_ID_HI</font></td>
304
<td><font size="-1">0x01</font></td>
305 74 olivier.gi
<td colspan="16"><font size="-5">PMEM_AWIDTH</font></td>
306 50 olivier.gi
</tr>
307
</table>
308
<br />
309
<table border="0">
310
<tr>
311
   <td>&nbsp;</td><td valign="top"><li><b>PMEM_AWIDTH</b></li></td>
312 74 olivier.gi
   <td>: Program memory size in byte for the current implementation</td>
313 50 olivier.gi
</tr>
314
<tr>
315
   <td>&nbsp;</td><td valign="top"><li><b>DMEM_AWIDTH</b></li></td>
316 74 olivier.gi
   <td>: Data memory size in byte for the current implementation.</td>
317 50 olivier.gi
</tr>
318
</table>
319
 
320
<a name="2.2.2 CPU_CTL"></a>
321
<h3>2.2.2 CPU_CTL</h3>
322
 
323
This 8 bit read-write register is used to control the CPU and to configure some basic debug features. After a POR, this register is set to 0x00.
324
<br /><br />
325
<table border="1">
326
<tr align="center">
327
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
328
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
329
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
330
</tr>
331
<tr align="center">
332
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
333
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
334
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
335
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
336
</tr>
337
<tr align="center">
338
<td><font size="-1">CPU_CTL</font></td>
339
<td><font size="-1">0x02</font></td>
340
<td><font size="-5">Res.</font></td>
341
<td><font size="-5">CPU_RST</font></td>
342
<td><font size="-5">RST_BRK_EN</font></td>
343
<td><font size="-5">FRZ_BRK_EN</font></td>
344
<td><font size="-5">SW_BRK_EN</font></td>
345
<td><font size="-5">ISTEP</font></td>
346
<td><font size="-5">RUN</font></td>
347
<td><font size="-5">HALT</font></td>
348
</tr>
349
</table>
350
<br />
351
<table border="0">
352
<tr>
353
   <td>&nbsp;</td><td valign="top"><li><b>CPU_RST</b></li></td>
354
   <td>: Setting this bit to 1 will activate the PUC reset. Setting it back to 0 will release it.</td>
355
</tr>
356
<tr>
357
   <td>&nbsp;</td><td valign="top"><li><b>RST_BRK_EN</b></li></td>
358
   <td>: If set to 1, the CPU will automatically break after a PUC occurrence.</td>
359
</tr>
360
<tr>
361
   <td>&nbsp;</td><td valign="top"><li><b>FRZ_BRK_EN</b></li></td>
362
   <td>: If set to 1, the timers and watchdog are frozen when the CPU is halted.</td>
363
</tr>
364
<tr>
365
   <td>&nbsp;</td><td valign="top"><li><b>SW_BRK_EN</b></li></td>
366
   <td>: Enables the software breakpoint detection.</td>
367
</tr>
368
<tr>
369
   <td>&nbsp;</td><td valign="top"><li><b>ISTEP</b><sup>1</sup></li></td>
370
   <td>: Writing 1 to this bit will perform a single instruction step if the CPU is halted.</td>
371
</tr>
372
<tr>
373
   <td>&nbsp;</td><td valign="top"><li><b>RUN</b><sup>1</sup></li></td>
374
   <td>: Writing 1 to this bit will get the CPU out of halt state.</td>
375
</tr>
376
<tr>
377
   <td>&nbsp;</td><td valign="top"><li><b>HALT</b><sup>1</sup></li></td>
378
   <td>: Writing 1 to this bit will put the CPU in halt state.</td>
379
</tr>
380
</table>
381
<br /><sup>1</sup>:this field is write-only and always reads back 0.
382
<br />
383
<a name="2.2.3 CPU_STAT"></a>
384
<h3>2.2.3 CPU_STAT</h3>
385
 
386
This 8 bit read-write register gives the global status of the debug interface. After a POR, this register is set to 0x00.
387
<br /><br />
388
<table border="1">
389
<tr align="center">
390
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
391
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
392
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
393
</tr>
394
<tr align="center">
395
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
396
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
397
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
398
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
399
</tr>
400
<tr align="center">
401
<td><font size="-1">CPU_STAT</font></td>
402
<td><font size="-1">0x03</font></td>
403
<td><font size="-5">HWBRK3_PND</font></td>
404
<td><font size="-5">HWBRK2_PND</font></td>
405
<td><font size="-5">HWBRK1_PND</font></td>
406
<td><font size="-5">HWBRK0_PND</font></td>
407
<td><font size="-5">SWBRK_PND</font></td>
408
<td><font size="-5">PUC_PND</font></td>
409
<td><font size="-5">Res.</font></td>
410
<td><font size="-5">HALT_RUN</font></td>
411
</tr>
412
</table>
413
<br />
414
<table border="0">
415
<tr>
416
   <td>&nbsp;</td><td valign="top"><li><b>HWBRK3_PND</b></li></td>
417
   <td>: This bit reflects if one of the Hardware Breakpoint Unit 3 status bit is set (i.e. BRK3_STAT&ne;0).</td>
418
</tr>
419
<tr>
420
   <td>&nbsp;</td><td valign="top"><li><b>HWBRK2_PND</b></li></td>
421
   <td>: This bit reflects if one of the Hardware Breakpoint Unit 2 status bit is set (i.e. BRK2_STAT&ne;0).</td>
422
</tr>
423
<tr>
424
   <td>&nbsp;</td><td valign="top"><li><b>HWBRK1_PND</b></li></td>
425
   <td>: This bit reflects if one of the Hardware Breakpoint Unit 1 status bit is set (i.e. BRK1_STAT&ne;0).</td>
426
</tr>
427
<tr>
428
   <td>&nbsp;</td><td valign="top"><li><b>HWBRK0_PND</b></li></td>
429
   <td>: This bit reflects if one of the Hardware Breakpoint Unit 0 status bit is set (i.e. BRK0_STAT&ne;0).</td>
430
</tr>
431
<tr>
432
   <td>&nbsp;</td><td valign="top"><li><b>SWBRK_PND</b></li></td>
433
   <td>: This bit is set to 1 when a software breakpoint occurred. It can be cleared by writing 1 to it.</td>
434
</tr>
435
<tr>
436
   <td>&nbsp;</td><td valign="top"><li><b>PUC_PND</b></li></td>
437
   <td>: This bit is set to 1 when a PUC reset occured. It can be cleared by writing 1 to it.</td>
438
</tr>
439
<tr>
440
   <td>&nbsp;</td><td valign="top"><li><b>HALT_RUN</b></li></td>
441
   <td>: This read-only bit gives the current status of the CPU:
442
   </td>
443
</tr>
444
<tr>
445
   <td>&nbsp;</td><td>&nbsp;</td>
446
   <td>&nbsp;&nbsp;&nbsp;0 - CPU is running.
447
         <br />&nbsp;&nbsp;&nbsp;1 - CPU is stopped.
448
   </td>
449
</tr>
450
</table>
451
 
452
<a name="2.3 Memory Access Registers"></a>
453
<div style="text-align: right"><a href="#TOC">Top</a></div>
454
<h2>2.3 Memory Access Registers</h2>
455
 
456
The following four registers enable single and burst read/write access to both CPU-Registers and full memory address range.
457
<br />In order to perform an access, the following sequences are typically done:
458
<ul>
459
   <li>single read access (MEM_CNT=0):</li>
460
        <ol>
461
        <li>set MEM_ADDR with the memory address (or register number) to be read</li>
462
                <li>set MEM_CTL (in particular RD/WR=0 and START=1)</li>
463
                <li>read MEM_DATA</li>
464
        </ol>
465
        <li>single write access (MEM_CNT=0):</li>
466
        <ol>
467
        <li>set MEM_ADDR with the memory address (or register number) to be written</li>
468
                <li>set MEM_DATA with the data to be written</li>
469
                <li>set MEM_CTL (in particular RD/WR=1 and START=1)</li>
470
        </ol>
471
   <li>burst read/write access (MEM_CNT&ne;0):</li>
472
        <ul>
473
        <li>burst access are optimized for the communication interface used (i.e. for the UART).
474
        The burst sequence are therefore described in the corresponding section (<a href="#3.4 Read/Write burst implementation for the CPU Memory access">3.4 Read/Write burst implementation for the CPU Memory access</a>)</li>
475
        </ul>
476
</ul>
477
<a name="2.3.1 MEM_CTL"></a>
478
<h3>2.3.1 MEM_CTL</h3>
479
 
480
This 8 bit read-write register is used to control the Memory and CPU-Register read/write access. After a POR, this register is set to 0x00.
481
<br /><br />
482
<table border="1">
483
<tr align="center">
484
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
485
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
486
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
487
</tr>
488
<tr align="center">
489
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
490
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
491
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
492
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
493
</tr>
494
<tr align="center">
495
<td><font size="-1">MEM_CTL</font></td>
496
<td><font size="-1">0x04</font></td>
497
<td colspan="4"><font size="-5">Reserved</font></td>
498
<td><font size="-5">B/W</font></td>
499
<td><font size="-5">MEM/REG</font></td>
500
<td><font size="-5">RD/WR</font></td>
501
<td><font size="-5">START</font></td>
502
</tr>
503
</table>
504
<br />
505
<table border="0">
506
<tr>
507
   <td>&nbsp;</td><td valign="top"><li><b>B/W</b></li></td>
508
   <td>: 0 - 16 bit access.</td>
509
</tr>
510
<tr>
511
   <td>&nbsp;</td><td>&nbsp;</td>
512
   <td>&nbsp;&nbsp;1 - &nbsp;&nbsp;8 bit access (not valid for CPU-Registers).</td>
513
</tr>
514
<tr>
515
   <td>&nbsp;</td><td valign="top"><li><b>MEM/REG</b></li></td>
516
   <td>: 0 - Memory access.</td>
517
</tr>
518
<tr>
519
   <td>&nbsp;</td><td>&nbsp;</td>
520
   <td>&nbsp;&nbsp;1 - CPU-Register access.</td>
521
</tr>
522
<tr>
523
   <td>&nbsp;</td><td valign="top"><li><b>RD/WR</b></li></td>
524
   <td>: 0 - Read access.</td>
525
</tr>
526
<tr>
527
   <td>&nbsp;</td><td>&nbsp;</td>
528
   <td>&nbsp;&nbsp;1 - Write access.</td>
529
</tr>
530
<tr>
531
   <td>&nbsp;</td><td valign="top"><li><b>START</b></li></td>
532
   <td>: 0- Do nothing</td>
533
</tr>
534
<tr>
535
   <td>&nbsp;</td><td>&nbsp;</td>
536
   <td>&nbsp;&nbsp;1 - Initiate memory transfer.</td>
537
</tr>
538
</table>
539
 
540
<a name="2.3.2 MEM_ADDR"></a>
541
<h3>2.3.2 MEM_ADDR</h3>
542
 
543
This 16 bit read-write register specifies the Memory or CPU-Register address to be used for the next read/write transfer. After a POR, this register is set to 0x0000.
544
<br />
545
<strong>Note:</strong> in case of burst (i.e. MEM_CNT&ne;0), this register specifies the first address of the burst transfer and will be incremented automatically as the burst goes (by 1 for 8-bit access and by 2 for 16-bit access).
546
<br /><br />
547
<table border="1">
548
<tr align="center">
549
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
550
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
551
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
552
</tr>
553
<tr align="center">
554
<td><font size="-1">15</font></td><td><font size="-1">14</font></td>
555
<td><font size="-1">13</font></td><td><font size="-1">12</font></td>
556
<td><font size="-1">11</font></td><td><font size="-1">10</font></td>
557
<td><font size="-1"> 9</font></td><td><font size="-1"> 8</font></td>
558
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
559
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
560
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
561
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
562
</tr>
563
<tr align="center">
564
<td><font size="-1">MEM_ADDR</font></td>
565
<td><font size="-1">0x05</font></td>
566
<td colspan="16"><font size="-5">MEM_ADDR[15:0]</font></td>
567
</tr>
568
</table>
569
<br />
570
<table border="0">
571
<tr>
572
   <td>&nbsp;</td><td valign="top"><li><b>MEM_ADDR</b></li></td>
573
   <td>: Memory or CPU-Register address to be used for the next read/write transfer.</td>
574
</tr>
575
</table>
576
 
577
<a name="2.3.3 MEM_DATA"></a>
578
<h3>2.3.3 MEM_DATA</h3>
579
 
580
This 16 bit read-write register specifies (wr) or receive (rd) the Memory or CPU-Register data for the the next transfer. After a POR, this register is set to 0x0000.
581
<br /><br />
582
<table border="1">
583
<tr align="center">
584
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
585
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
586
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
587
</tr>
588
<tr align="center">
589
<td><font size="-1">15</font></td><td><font size="-1">14</font></td>
590
<td><font size="-1">13</font></td><td><font size="-1">12</font></td>
591
<td><font size="-1">11</font></td><td><font size="-1">10</font></td>
592
<td><font size="-1"> 9</font></td><td><font size="-1"> 8</font></td>
593
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
594
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
595
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
596
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
597
</tr>
598
<tr align="center">
599
<td><font size="-1">MEM_DATA</font></td>
600
<td><font size="-1">0x06</font></td>
601
<td colspan="16"><font size="-5">MEM_DATA[15:0]</font></td>
602
</tr>
603
</table>
604
<br />
605
<table border="0">
606
<tr>
607
   <td>&nbsp;</td><td valign="top"><li><b>MEM_DATA</b></li></td>
608
   <td>: if MEM_CTL.WR - data to be written during the next write transfer.</td>
609
</tr>
610
<tr>
611
   <td>&nbsp;</td><td>&nbsp;</td>
612
   <td>&nbsp;&nbsp;if MEM_CTL.RD - updated with the data from the read transfer</td>
613
</tr>
614
</table>
615
 
616
<a name="2.3.4 MEM_CNT"></a>
617
<h3>2.3.4 MEM_CNT</h3>
618
 
619
This 16 bit read-write register controls the burst access to the Memory or CPU-Registers. If set to 0, a single access will occur, otherwise, a burst will be performed. The burst being optimized for the communication interface, more details are given <a href="#3.4 Read/Write burst implementation for the CPU Memory access">there</a>. After a POR, this register is set to 0x0000.
620
<br /><br />
621
<table border="1">
622
<tr align="center">
623
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
624
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
625
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
626
</tr>
627
<tr align="center">
628
<td><font size="-1">15</font></td><td><font size="-1">14</font></td>
629
<td><font size="-1">13</font></td><td><font size="-1">12</font></td>
630
<td><font size="-1">11</font></td><td><font size="-1">10</font></td>
631
<td><font size="-1"> 9</font></td><td><font size="-1"> 8</font></td>
632
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
633
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
634
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
635
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
636
</tr>
637
<tr align="center">
638
<td><font size="-1">MEM_CNT</font></td>
639
<td><font size="-1">0x07</font></td>
640
<td colspan="16"><font size="-5">MEM_CNT[15:0]</font></td>
641
</tr>
642
</table>
643
<br />
644
<table border="0">
645
<tr>
646
   <td>&nbsp;</td><td valign="top"><li><b>MEM_CNT</b></li></td>
647
   <td>: =0 - a single access will be performed with the next transfer.</td>
648
</tr>
649
<tr>
650
   <td>&nbsp;</td><td>&nbsp;</td>
651
   <td>&nbsp;&nbsp;&ne;0 - specifies the burst size for the next transfer (i.e number of data access). This field will be automatically decremented as the burst goes.</td>
652
</tr>
653
</table>
654
 
655
<a name="2.4 Hardware Breakpoint Unit Registers"></a>
656
<div style="text-align: right"><a href="#TOC">Top</a></div>
657
<h2>2.4 Hardware Breakpoint Unit Registers</h2>
658
Depending on the <a href="http://www.opencores.org/project/openmsp430/core#2.1.3 Configuration">defines</a> located in the "openmsp430_defines.v" file, up to four hardware breakpoint units can be included in the design. These units can be individually controlled with the following registers.
659
<a name="2.4.1 BRKx_CTL"></a>
660
<h3>2.4.1 BRKx_CTL</h3>
661
 
662
This 8 bit read-write register controls the hardware breakpoint unit x. After a POR, this register is set to 0x00.
663
<br /><br />
664
<table border="1">
665
<tr align="center">
666
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
667
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
668
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
669
</tr>
670
<tr align="center">
671
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
672
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
673
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
674
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
675
</tr>
676
<tr align="center">
677
<td><font size="-1">BRKx_CTL</font></td>
678
<td><font size="-1">0x08, 0x0C, 0x10, 0x14</font></td>
679
<td colspan="3"><font size="-5">Reserved</font></td>
680
<td><font size="-5">RANGE_MODE</font></td>
681
<td><font size="-5">INST_EN</font></td>
682
<td><font size="-5">BREAK_EN</font></td>
683
<td colspan="2"><font size="-5">ACCESS_MODE</font></td>
684
</tr>
685
</table>
686
<br />
687
<table border="0">
688
<tr>
689
   <td>&nbsp;</td><td valign="top"><li><b>RANGE_MODE</b></li></td>
690
   <td>:  0 - Address match on BRK_ADDR0 or BRK_ADDR1 (normal mode)</td>
691
</tr>
692
<tr>
693
   <td>&nbsp;</td><td>&nbsp;</td>
694 58 olivier.gi
   <td>&nbsp;&nbsp;1 - Address match on BRK_ADDR0&rarr;BRK_ADDR1 range (range mode)
695
   <br /><font color="red"><b>Note</b>: range mode is not supported by the core unless the `HWBRK_RANGE define is set to 1'b1 in the <i>openMSP430_define.v</i> file.</font></td>
696
</td>
697 50 olivier.gi
</tr>
698
<tr>
699
   <td>&nbsp;</td><td valign="top"><li><b>INST_EN</b></li></td>
700
   <td>: 0 - Checks are done on the execution unit (data flow).</td>
701
</tr>
702
<tr>
703
   <td>&nbsp;</td><td>&nbsp;</td>
704
   <td>&nbsp;&nbsp;1 - Checks are done on the frontend (instruction flow).</td>
705
</tr>
706
 
707
<tr>
708
   <td>&nbsp;</td><td valign="top"><li><b>BREAK_EN</b></li></td>
709
   <td>: 0 - Watchpoint mode enable (don't stop on address match).</td>
710
</tr>
711
<tr>
712
   <td>&nbsp;</td><td>&nbsp;</td>
713
   <td>&nbsp;&nbsp;1 - Breakpoint mode enable (stop on address match).</td>
714
</tr>
715
 
716
<tr>
717
   <td>&nbsp;</td><td valign="top"><li><b>ACCESS_MODE</b></li></td>
718
   <td>: 00 - Disabled</td>
719
</tr>
720
<tr>
721
   <td>&nbsp;</td><td>&nbsp;</td>
722
   <td>  &nbsp;&nbsp;01 - Detect read access.
723
   <br />&nbsp;&nbsp;10 - Detect write access.
724
   <br />&nbsp;&nbsp;11 - Detect read/write access
725
   <br /><b>Note</b>: '10' & '11' modes are not supported on the instruction flow</td>
726
</tr>
727
</table>
728
 
729
<a name="2.4.2 BRKx_STAT"></a>
730
<h3>2.4.2 BRKx_STAT</h3>
731
 
732
This 8 bit read-write register gives the status of the hardware breakpoint unit x. Each status bit can be cleared by writing 1 to it. After a POR, this register is set to 0x00.
733
<br /><br />
734
<table border="1">
735
<tr align="center">
736
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
737
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
738
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
739
</tr>
740
<tr align="center">
741
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
742
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
743
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
744
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
745
</tr>
746
<tr align="center">
747
<td><font size="-1">BRKx_STAT</font></td>
748
<td><font size="-1">0x09, 0x0D, 0x11, 0x15</font></td>
749
<td colspan="2"><font size="-5">Reserved</font></td>
750
<td><font size="-5">RANGE_WR</font></td>
751
<td><font size="-5">RANGE_RD</font></td>
752
<td><font size="-5">ADDR1_WR</font></td>
753
<td><font size="-5">ADDR1_RD</font></td>
754
<td><font size="-5">ADDR0_WR</font></td>
755
<td><font size="-5">ADDR0_RD</font></td>
756
</tr>
757
</table>
758
<br />
759
<table border="0">
760
<tr>
761
   <td>&nbsp;</td><td valign="top"><li><b>RANGE_WR</b></li></td>
762
   <td>: This bit is set whenever the CPU performs a write access within the BRKx_ADDR0&rarr;BRKx_ADDR1 range (valid if RANGE_MODE=1 and ACCESS_MODE[1]=1).</td>
763
</tr>
764
<tr>
765
   <td>&nbsp;</td><td valign="top"><li><b>RANGE_RD</b></li></td>
766 58 olivier.gi
   <td>: This bit is set whenever the CPU performs a read access within the BRKx_ADDR0&rarr;BRKx_ADDR1 range (valid if RANGE_MODE=1 and ACCESS_MODE[0]=1).
767
   <br /><font color="red"><b>Note</b>: range mode is not supported by the core unless the `HWBRK_RANGE define is set to 1'b1 in the <i>openMSP430_define.v</i> file.</font></td>
768 50 olivier.gi
</tr>
769
<tr>
770
   <td>&nbsp;</td><td valign="top"><li><b>ADDR1_WR</b></li></td>
771
   <td>: This bit is set whenever the CPU performs a write access at the BRKx_ADDR1 address (valid if RANGE_MODE=0 and ACCESS_MODE[1]=1).</td>
772
</tr>
773
<tr>
774
   <td>&nbsp;</td><td valign="top"><li><b>ADDR1_RD</b></li></td>
775
   <td>: This bit is set whenever the CPU performs a read access at the BRKx_ADDR1 address (valid if RANGE_MODE=0 and ACCESS_MODE[0]=1).</td>
776
</tr>
777
<tr>
778
   <td>&nbsp;</td><td valign="top"><li><b>ADDR0_WR</b></li></td>
779
   <td>: This bit is set whenever the CPU performs a write access at the BRKx_ADDR0 address (valid if RANGE_MODE=0 and ACCESS_MODE[1]=1).</td>
780
</tr>
781
<tr>
782
   <td>&nbsp;</td><td valign="top"><li><b>ADDR0_RD</b></li></td>
783
   <td>: This bit is set whenever the CPU performs a read access at the BRKx_ADDR0 address (valid if RANGE_MODE=0 and ACCESS_MODE[0]=1).</td>
784
</tr>
785
</table>
786
 
787
<a name="2.4.3 BRKx_ADDR0"></a>
788
<h3>2.4.3 BRKx_ADDR0</h3>
789
 
790
This 16 bit read-write register holds the value which is compared against the address value currently present on the program or data address bus. After a POR, this register is set to 0x0000.
791
<br /><br />
792
<table border="1">
793
<tr align="center">
794
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
795
<td rowspan="2" ><b><font size="-1">Address</font></b></td>
796
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
797
</tr>
798
<tr align="center">
799
<td><font size="-1">15</font></td><td><font size="-1">14</font></td>
800
<td><font size="-1">13</font></td><td><font size="-1">12</font></td>
801
<td><font size="-1">11</font></td><td><font size="-1">10</font></td>
802
<td><font size="-1"> 9</font></td><td><font size="-1"> 8</font></td>
803
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
804
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
805
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
806
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
807
</tr>
808
<tr align="center">
809
<td><font size="-1">BRKx_ADDR0</font></td>
810
<td><font size="-1">0x0A, 0x0E, 0x12, 0x16</font></td>
811
<td colspan="16"><font size="-5">BRK_ADDR0[15:0]</font></td>
812
</tr>
813
</table>
814
<br />
815
<table border="0">
816
<tr>
817
   <td>&nbsp;</td><td valign="top"><li><b>BRK_ADDR0</b></li></td>
818
   <td>: Value compared against the address value currently present on the program or data address bus.</td>
819
</tr>
820
</table>
821
 
822
<a name="2.4.4 BRKx_ADDR1"></a>
823
<h3>2.4.4 BRKx_ADDR1</h3>
824
 
825
This 16 bit read-write register holds the value which is compared against the address value currently present on the program or data address bus. After a POR, this register is set to 0x0000.
826
<br /><br />
827
<table border="1">
828
<tr align="center">
829
<td rowspan="2" ><b><font size="-1">Register Name</font></b></td>
830
<td rowspan="2" ><b><font size="-1">Addresses</font></b></td>
831
<td colspan="16"><b><font size="-1">Bit Field</font></b></td>
832
</tr>
833
<tr align="center">
834
<td><font size="-1">15</font></td><td><font size="-1">14</font></td>
835
<td><font size="-1">13</font></td><td><font size="-1">12</font></td>
836
<td><font size="-1">11</font></td><td><font size="-1">10</font></td>
837
<td><font size="-1"> 9</font></td><td><font size="-1"> 8</font></td>
838
<td><font size="-1"> 7</font></td><td><font size="-1"> 6</font></td>
839
<td><font size="-1"> 5</font></td><td><font size="-1"> 4</font></td>
840
<td><font size="-1"> 3</font></td><td><font size="-1"> 2</font></td>
841
<td><font size="-1"> 1</font></td><td><font size="-1"> 0</font></td>
842
</tr>
843
<tr align="center">
844
<td><font size="-1">BRKx_ADDR1</font></td>
845
<td><font size="-1">0x0B, 0x0F, 0x13, 0x17</font></td>
846
<td colspan="16"><font size="-5">BRK_ADDR1[15:0]</font></td>
847
</tr>
848
</table>
849
<br />
850
<table border="0">
851
<tr>
852
   <td>&nbsp;</td><td valign="top"><li><b>BRK_ADDR1</b></li></td>
853
   <td>: Value compared against the address value currently present on the program or data address bus.</td>
854
</tr>
855
</table>
856
 
857
<a name="3. Debug Communication Interface: UART"></a>
858
<div style="text-align: right"><a href="#TOC">Top</a></div>
859
<h1>3. Debug Communication Interface: UART</h1>
860
With its UART interface, the openMSP430 debug unit can communicate with the host computer using a simple RS232 cable (connected to the <a href="http://www.opencores.org/project/openmsp430/core#2.1.4 Pinout">dbg_uart_txd</a> and <a href="http://www.opencores.org/project/openmsp430/core#2.1.4 Pinout">dbg_uart_rxd</a> ports of the IP).<br />
861
Using an standard <a href="http://www.google.com/search?q=usb+to+rs232+converter">USB to RS232 adaptor</a>, the interface provides a reliable communication link up to 1,5Mbps.
862
 
863
<a name="3.1 Serial communication protocol: 8N1"></a>
864
<h2>3.1 Serial communication protocol: 8N1</h2>
865
There are plenty tutorials on Internet regarding RS232 based protocols. However, here is quick recap about 8N1 (1 Start bit, 8 Data bits, No Parity, 1 Stop bit):<br />
866
<br />
867
<img src="getimg.php?1247419201" alt="8N1 Serial Protocol" title="8N1 Serial Protocol" />
868
<br />
869
As you can see in the above diagram, data transmission starts with a Start bit, followed by the data bits (LSB sent first and MSB sent last), and ends with a "Stop" bit.
870
 
871
<a name="3.2 Synchronization frame"></a>
872
<h2>3.2 Synchronization frame</h2>
873
After a POR, the Serial Debug Interface expects a synchronization frame from the host computer in order to determine the communication speed (i.e. the baud rate).<br />
874
The synchronization frame looks as following:
875
<br />
876
<img src="getimg.php?1247420610" alt="Debug Synchronization Frame" title="Debug Synchronization Frame" />
877
<br />
878
As you can see, the host simply sends the 0x80 value. The openMSP430 will then measure the time between the falling and rising edge, divide it by 8 and automatically deduce the baud rate it should use to properly communicate with the host.
879
<br /><br />
880
<b>Important note</b>: if you want to change the communication speed between two debugging sessions, the openMSP430 needs to go over a POR cycle and a new synchronization frame needs to be send.
881
 
882
<a name="3.3 Read/Write access to the debug registers"></a>
883
<h2>3.3 Read/Write access to the debug registers</h2>
884
In order to perform a read / write access to a debug register, the host needs to send a command frame to the openMSP430.<br />
885
In case of write access, this command frame will be followed by 1 or 2 data frames and in case of read access, the openMSP430 will send 1 or 2 data frames after receiving the command.
886
 
887
<a name="3.3.1 Command Frame"></a>
888
<h3>3.3.1 Command Frame</h3>
889
The command frame looks as following:
890
<br />
891
<img src="getimg.php?1247427400" alt="Debug Command Frame" title="Debug Command Frame" />
892
<br />
893
<table border="0">
894
<tr>
895
   <td>&nbsp;</td><td valign="top"><li><b>WR</b></li></td>
896
   <td>: Perform a Write access when set. Read otherwise.</td>
897
</tr>
898
<tr>
899
   <td>&nbsp;</td><td valign="top"><li><b>B/W</b></li></td>
900
   <td>: Perform a 8-bit data access when set (one data frame). 16-bit otherwise (two data frame).<tr>
901
</tr>
902
<tr>
903
   <td>&nbsp;</td><td valign="top"><li><b>Address</b></li></td>
904
   <td>: Debug register address.<tr>
905
</tr>
906
</table>
907
 
908
<a name="3.3.2 Write access"></a>
909
<h3>3.3.2 Write access</h3>
910
A write access transaction looks like this:
911
<br />
912
<img src="getimg.php?1247428987" alt="Debug Write Transaction" title="Debug Write Transaction" />
913
 
914
<a name="3.3.3 Read access"></a>
915
<h3>3.3.3 Read access</h3>
916
A read access transaction looks like this:
917
<br />
918
<img src="getimg.php?1247429086" alt="Debug Read Transaction" title="Debug Read Transaction" />
919
 
920
<a name="3.4 Read/Write burst implementation for the CPU Memory access"></a>
921
<h2>3.4 Read/Write burst implementation for the CPU Memory access</h2>
922
In order to optimize the data burst transactions for the UART, read/write access are not done by reading or writing the MEM_DATA register.<br />
923
Instead, the data transfer starts immediately after the MEM_CTL.START bit has been set.
924
 
925
<a name="3.4.1 Write Burst access"></a>
926
<h3>3.4.1 Write Burst access</h3>
927
A write burst transaction looks like this:
928
<br />
929
<img src="getimg.php?1247430408" alt="Debug Write Burst Transaction" title="Debug Write Burst Transaction" />
930
 
931
<a name="3.4.2 Read Burst access"></a>
932
<h3>3.4.2 Read Burst access</h3>
933
A read burst transaction looks like this:
934
<br />
935
<img src="getimg.php?1247430449" alt="Debug Read Burst Transaction" title="Debug Read Burst Transaction" />
936
 
937
<div style="text-align: right"><a href="#TOC">Top</a></div>
938
</body>
939
</html>

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.