Line 21... |
Line 21... |
<h1>1. Overview</h1>
|
<h1>1. Overview</h1>
|
|
|
This chapter aims to give a comprehensive description of all openMSP430 core interfaces in order to facilitates its integration within an ASIC or FPGA.<br /><br />
|
This chapter aims to give a comprehensive description of all openMSP430 core interfaces in order to facilitates its integration within an ASIC or FPGA.<br /><br />
|
|
|
The following diagram shows an overview of the openMSP430 core connectivity:<br /><br />
|
The following diagram shows an overview of the openMSP430 core connectivity:<br /><br />
|
<img src="getimg.php?1264010073" width="100%" alt="Core Integration - 23 Jan 2010" title="Core Integration - 23 Jan 2010" />
|
<img src="usercontent,img,1306268589" width="100%" alt="Core Integration - 24 May 2011" title="Core Integration - 24 May 2011" />
|
<br /><br />
|
<br /><br />
|
The full pinout of the core is summarized in the following table.<br />
|
The full pinout of the core is summarized in the following table.<br />
|
<br />
|
<br />
|
<table border="1">
|
<table border="1">
|
<tr> <td align="center"><b>Port Name</b></td> <td align="center"><b>Direction</b></td> <td align="center"><b>Width</b> </td> <td align="center"><b>Description</b></td> </tr>
|
<tr> <td align="center"><b>Port Name</b></td> <td align="center"><b>Direction</b></td> <td align="center"><b>Width</b> </td> <td align="center"><b>Description</b></td> </tr>
|
|
|
<tr> <td colspan="4" align="center"> <b><i>Clocks</i></b> </td></tr>
|
<tr> <td colspan="4" align="center"> <b><i>Clocks</i></b> </td></tr>
|
<tr>
|
<tr>
|
|
<td> <a href="#2. Clocks">cpu_en</a> </td>
|
|
<td> Input </td>
|
|
<td> 1 </td>
|
|
<td> Enable CPU code execution (asynchronous) </td>
|
|
</tr>
|
|
<tr>
|
<td> <a href="#2. Clocks">dco_clk</a> </td>
|
<td> <a href="#2. Clocks">dco_clk</a> </td>
|
<td> Input </td>
|
<td> Input </td>
|
<td> 1 </td>
|
<td> 1 </td>
|
<td> Fast oscillator (fast clock), CPU clock </td>
|
<td> Fast oscillator (fast clock), CPU clock </td>
|
</tr>
|
</tr>
|
Line 62... |
Line 68... |
<td> SMCLK enable </td>
|
<td> SMCLK enable </td>
|
</tr>
|
</tr>
|
|
|
<tr> <td colspan="4" align="center"> <b><i>Resets</i></b> </td></tr>
|
<tr> <td colspan="4" align="center"> <b><i>Resets</i></b> </td></tr>
|
<tr>
|
<tr>
|
<td> <a href="#3. Resets">puc</a> </td>
|
<td> <a href="#3. Resets">puc_rst</a> </td>
|
<td> Output </td>
|
<td> Output </td>
|
<td> 1 </td>
|
<td> 1 </td>
|
<td> Main system reset </td>
|
<td> Main system reset </td>
|
</tr>
|
</tr>
|
<tr>
|
<tr>
|
<td> <a href="#3. Resets">reset_n</a> </td>
|
<td> <a href="#3. Resets">reset_n</a> </td>
|
<td> Input </td>
|
<td> Input </td>
|
<td> 1 </td>
|
<td> 1 </td>
|
<td> Reset Pin (low active) </td>
|
<td> Reset Pin (low active, asynchronous) </td>
|
</tr>
|
</tr>
|
|
|
|
|
<tr> <td colspan="4" align="center"> <b><i>Program Memory interface</i></b> </td></tr>
|
<tr> <td colspan="4" align="center"> <b><i>Program Memory interface</i></b> </td></tr>
|
<tr>
|
<tr>
|
Line 104... |
Line 110... |
</tr>
|
</tr>
|
<tr>
|
<tr>
|
<td> <a href="#4. Program Memory">pmem_wen</a> </td>
|
<td> <a href="#4. Program Memory">pmem_wen</a> </td>
|
<td> Output </td>
|
<td> Output </td>
|
<td> 2 </td>
|
<td> 2 </td>
|
<td> Program Memory write enable (low active) </td>
|
<td> Program Memory write byte enable (low active) </td>
|
</tr>
|
</tr>
|
|
|
<tr> <td colspan="4" align="center"> <b><i>Data Memory interface</i></b> </td></tr>
|
<tr> <td colspan="4" align="center"> <b><i>Data Memory interface</i></b> </td></tr>
|
<tr>
|
<tr>
|
<td> <a href="#5. Data Memory">dmem_addr</a> </td>
|
<td> <a href="#5. Data Memory">dmem_addr</a> </td>
|
Line 136... |
Line 142... |
</tr>
|
</tr>
|
<tr>
|
<tr>
|
<td> <a href="#5. Data Memory">dmem_wen</a> </td>
|
<td> <a href="#5. Data Memory">dmem_wen</a> </td>
|
<td> Output </td>
|
<td> Output </td>
|
<td> 2 </td>
|
<td> 2 </td>
|
<td> Data Memory write enable (low active) </td>
|
<td> Data Memory write byte enable (low active) </td>
|
</tr>
|
</tr>
|
|
|
<tr> <td colspan="4" align="center"> <b><i>External Peripherals interface</i></b> </td></tr>
|
<tr> <td colspan="4" align="center"> <b><i>External Peripherals interface</i></b> </td></tr>
|
<tr>
|
<tr>
|
<td> <a href="#6. Peripherals">per_addr</a> </td>
|
<td> <a href="#6. Peripherals">per_addr</a> </td>
|
<td> Output </td>
|
<td> Output </td>
|
<td> 8 </td>
|
<td> 14 </td>
|
<td> Peripheral address </td>
|
<td> Peripheral address </td>
|
</tr>
|
</tr>
|
<tr>
|
<tr>
|
<td> <a href="#6. Peripherals">per_din</a> </td>
|
<td> <a href="#6. Peripherals">per_din</a> </td>
|
<td> Output </td>
|
<td> Output </td>
|
Line 165... |
Line 171... |
<td> Output </td>
|
<td> Output </td>
|
<td> 1 </td>
|
<td> 1 </td>
|
<td> Peripheral enable (high active) </td>
|
<td> Peripheral enable (high active) </td>
|
</tr>
|
</tr>
|
<tr>
|
<tr>
|
<td> <a href="#6. Peripherals">per_wen</a> </td>
|
<td> <a href="#6. Peripherals">per_we</a> </td>
|
<td> Output </td>
|
<td> Output </td>
|
<td> 2 </td>
|
<td> 2 </td>
|
<td> Peripheral write enable (high active) </td>
|
<td> Peripheral write byte enable (high active) </td>
|
</tr>
|
</tr>
|
|
|
<tr> <td colspan="4" align="center"> <b><i>Interrupts</i></b> </td></tr>
|
<tr> <td colspan="4" align="center"> <b><i>Interrupts</i></b> </td></tr>
|
<tr>
|
<tr>
|
<td> <a href="#7. Interrupts">irq</a> </td>
|
<td> <a href="#7. Interrupts">irq</a> </td>
|
Line 193... |
Line 199... |
<td> Interrupt request accepted (one-hot signal) </td>
|
<td> Interrupt request accepted (one-hot signal) </td>
|
</tr>
|
</tr>
|
|
|
<tr> <td colspan="4" align="center"> <b><i>Serial Debug interface</i></b> </td></tr>
|
<tr> <td colspan="4" align="center"> <b><i>Serial Debug interface</i></b> </td></tr>
|
<tr>
|
<tr>
|
|
<td> <a href="#8. Serial Debug Interface">dbg_en</a> </td>
|
|
<td> Input </td>
|
|
<td> 1 </td>
|
|
<td> Debug interface enable (asynchronous) </td>
|
|
</tr>
|
|
<tr>
|
<td> <a href="#8. Serial Debug Interface">dbg_freeze</a> </td>
|
<td> <a href="#8. Serial Debug Interface">dbg_freeze</a> </td>
|
<td> Output </td>
|
<td> Output </td>
|
<td> 1 </td>
|
<td> 1 </td>
|
<td> Freeze peripherals </td>
|
<td> Freeze peripherals </td>
|
</tr>
|
</tr>
|
Line 208... |
Line 220... |
</tr>
|
</tr>
|
<tr>
|
<tr>
|
<td> <a href="#8. Serial Debug Interface">dbg_uart_rxd</a> </td>
|
<td> <a href="#8. Serial Debug Interface">dbg_uart_rxd</a> </td>
|
<td> Input </td>
|
<td> Input </td>
|
<td> 1 </td>
|
<td> 1 </td>
|
<td> Debug interface: UART RXD </td>
|
<td> Debug interface: UART RXD (asynchronous) </td>
|
</tr>
|
</tr>
|
</table>
|
</table>
|
<br />
|
<br />
|
<sup>1</sup>: This parameter is declared in the "openMSP430_defines.v" file and defines the RAM/ROM size.<br />
|
<sup>1</sup>: This parameter is declared in the "openMSP430_defines.v" file and defines the RAM/ROM size.<br />
|
<br />
|
<br />
|
Line 225... |
Line 237... |
The different clocks in the design are managed by the Basic Clock Module:
|
The different clocks in the design are managed by the Basic Clock Module:
|
<br /><br />
|
<br /><br />
|
<img src="getimg.php?1246434498" width="75%" alt="Clock structure diagram" title="Clock structure diagram" />
|
<img src="getimg.php?1246434498" width="75%" alt="Clock structure diagram" title="Clock structure diagram" />
|
<br />
|
<br />
|
<ul>
|
<ul>
|
<li><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 might provide.<br />
|
<li>
|
|
<b><font color="#0000b0">CPU_EN</font></b>: this input port provide a hardware mean to stop or resume CPU execution. When unused, this port should be set to 1.
|
|
<br /><br />
|
|
</li>
|
|
<li>
|
|
<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 might provide.<br />
|
From a synthesis tool perspective (ISE, Quartus, Libero, Design Compiler...), this the only port where a clock needs to be declared.
|
From a synthesis tool perspective (ISE, Quartus, Libero, Design Compiler...), this the only port where a clock needs to be declared.
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
<li>
|
<li>
|
<b><font color="#0000b0">LFXT_CLK</font></b>: if ACLK_EN or SMCLK_EN are going to be used in the project (for example through the Watchdog or TimerA peripherals), then this port needs to be connected to a clock running at least two time slower as DCO_CLK (typically 32kHz). It can be connected to 0 or 1 otherwise.
|
<b><font color="#0000b0">LFXT_CLK</font></b>: if ACLK_EN or SMCLK_EN are going to be used in the project (for example through the Watchdog or TimerA peripherals), then this port needs to be connected to a clock running at least two time slower as DCO_CLK (typically 32kHz). It can be connected to 0 or 1 otherwise.
|
Line 258... |
Line 275... |
<ul>
|
<ul>
|
<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.
|
<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.
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
<li>
|
<li>
|
<b><font color="#00b000">PUC</font></b>: the Power-Up-Clear signal is asynchronously set with the reset pin (<i>RESET_N</i>), the watchdog reset or the serial debug interface reset. In order to get clean timings, it is synchronously cleared with MCLK's falling edge. As a general rule, this signal should be used as the reset of the <i>MCLK</i> clock domain.
|
<b><font color="#00b000">PUC_RST</font></b>: the Power-Up-Clear signal is asynchronously set with the reset pin (<i>RESET_N</i>), the watchdog reset or the serial debug interface reset. In order to get clean timings, it is synchronously cleared with MCLK's falling edge. As a general rule, this signal should be used as the reset of the <i>MCLK</i> clock domain.
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
</ul>
|
</ul>
|
The following waveform illustrates this:<br /><br />
|
The following waveform illustrates this:<br /><br />
|
<img src="getimg.php?1263320655" width="100%" alt="Waveforms: Resets - Jan 12. 2010" title="Waveforms: Resets - Jan 12. 2010" />
|
<img src="getimg.php?1263320655" width="100%" alt="Waveforms: Resets - Jan 12. 2010" title="Waveforms: Resets - Jan 12. 2010" />
|
Line 350... |
Line 367... |
<ul>
|
<ul>
|
<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.
|
<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.
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
<li>
|
<li>
|
<b><font color="#00b000">PER_ADDR</font></b>: peripheral register address of the 16 bit word which is going to be accessed.<br />
|
<b><font color="#00b000">PER_ADDR</font></b>: peripheral register address of the 16 bit word which is currently accessed. It is to be noted that a 14 bit address will always be provided from the openMSP430 to the peripheral in order to accommodate the biggest possible PER_SIZE Verilog configuration option (i.e. 32kB as opposed to 512B by default).<br />
|
<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>
|
<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>
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
<li>
|
<li>
|
<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.
|
<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.
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
<li>
|
<li>
|
<b><font color="#00b000">PER_WE</font></b>: this signal selects which byte should be written during a valid access. PER_WEN[0] will activate a write on the lower byte, PER_WEN[1] a write on the upper byte. Note that these signals are HIGH ACTIVE.
|
<b><font color="#00b000">PER_WE</font></b>: this signal selects which byte should be written during a valid access. PER_WE[0] will activate a write on the lower byte, PER_WE[1] a write on the upper byte. Note that these signals are HIGH ACTIVE.
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
<li>
|
<li>
|
<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.
|
<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.
|
<br /><br />
|
<br /><br />
|
Line 498... |
Line 515... |
|
|
The serial debug interface module provides a two-wires communication bus for remote debugging and an additional freeze signal which might be useful for some peripherals.<br />
|
The serial debug interface module provides a two-wires communication bus for remote debugging and an additional freeze signal which might be useful for some peripherals.<br />
|
<br />
|
<br />
|
<ul>
|
<ul>
|
<li>
|
<li>
|
|
<b><font color="#0000b0">DBG_EN</font></b>: this signal allows the user to enable or disable the serial debug interface without interfering with the CPU execution. It is to be noted that when disabled (i.e. DBG_EN=0), the debug interface is held into reset.
|
|
<br /><br />
|
|
</li>
|
|
<li>
|
<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 />
|
<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 />
|
For example, it is used by the Watchdog timer in order to stop its free-running counter. This prevents the CPU from being reseted by the watchdog every times the user stops the CPU during a debugging session.
|
For example, it is used by the Watchdog timer in order to stop its free-running counter. This prevents the CPU from being reseted by the watchdog every times the user stops the CPU during a debugging session.
|
<br /><br />
|
<br /><br />
|
</li>
|
</li>
|
<li>
|
<li>
|