⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 index.html

📁 scmRTOS is real-time preemptive operating system and supports up to 31 user processes (and one syste
💻 HTML
字号:
<html><head>
<META NAME="ROBOTS" CONTENT="INDEX,FOLLOW">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>scmRTOS - Port for MSP430</title>
<link rel="icon" href="../../favicon.ico" type="ico">
<link rel="stylesheet" type="text/css" href="../../description.css" media="all" 
title="Burly Wood Style">
</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" 
leftmargin="0" rightmargin="0">

<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">

<tr id="banner" valign="top" height="75px"><td>
    <table border="0" cellpadding="0" cellspacing="0"><tr>
        <td height="72" width="60"><img src="../../scmrtos.png" hspace="4"></td>
        <td><h11><nobr>Single-Chip Microcontroller</nobr></h11><br>
        <div id="subtitle"><nobr>Real-Time Operating System</nobr></div></td>
    </tr></table>
</td></tr>

<tr><td valign="top">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr valign="top">
        <td class="menu2"><table align="left" border="0" cellpadding="4" cellspacing="8" class="gridmenu" width="100%">
<colgroup>
<col width="100%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">PORTs</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>MSP430</td>
</tr>
<tr><td><a class="reference" href="../avr/index.html">AVR</a></td>
</tr>
<tr><td><a class="reference" href="../bf/index.html">Blackfin</a></td>
</tr>
<tr><td><a class="reference" href="../arm7/index.html">ARM7</a></td>
</tr>
<tr><td><a class="reference" href="../fr/index.html">FR</a></td>
</tr>
<tr><td />
</tr>
<tr><td><a class="reference" href="../../releases/index.html">Releases</a></td>
</tr>
</tbody>
</table></td>
        <td id="main">
        <div id="breadcrumbs"><a href="../../index.html">Main page</a>&nbsp;> <a href="../index.html">PORTs</a>&nbsp;> MSP430</div>
        <div id="text">
        <h1>Port for MSP430 (Texas Instruments)</h1><p><strong>IAR Embedded Workbench</strong></p>
<div class="contents topic">
<p class="topic-title first"><a id="table-of-contents" name="table-of-contents">Table of Contents</a></p>
<ul class="simple">
<li><a class="reference" href="#general" id="id1" name="id1">General</a></li>
<li><a class="reference" href="#program-control-flow-transfer" id="id2" name="id2">Program Control Flow Transfer</a></li>
<li><a class="reference" href="#interrupts" id="id3" name="id3">Interrupts</a></li>
<li><a class="reference" href="#system-timer" id="id4" name="id4">System Timer</a></li>
<li><a class="reference" href="#summary" id="id5" name="id5">Summary</a></li>
</ul>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id1" id="general" name="general">General</a></h1>
<p>MSP430 is 16-bit RISC von Neumann processor and has 16 main registers:</p>
<table border="1" class="borderless marklist docutils">
<colgroup>
<col width="69%" />
<col width="31%" />
</colgroup>
<tbody valign="top">
<tr><td><ul class="first last simple">
<li>1 register is Program Counter</li>
</ul>
</td>
<td>-  <strong>PC</strong>;</td>
</tr>
<tr><td><ul class="first last simple">
<li>1 register is Status Register</li>
</ul>
</td>
<td>-  <strong>SR</strong>;</td>
</tr>
<tr><td><ul class="first last simple">
<li>1 register is Stack Pointer</li>
</ul>
</td>
<td>-  <strong>SP</strong>;</td>
</tr>
<tr><td><ul class="first last simple">
<li>1 register Constant Generator</li>
</ul>
</td>
<td>-  <strong>CG</strong>;</td>
</tr>
<tr><td><ul class="first last simple">
<li>12 general purpose registers</li>
</ul>
</td>
<td>-  <strong>GPR</strong>.</td>
</tr>
</tbody>
</table>
<p>Therefore, context in the processor consists of:</p>
<blockquote>
12 (GPR) + 1 (SR) + 1 (SP) = 14 registers or 14*2 = 28 bytes.</blockquote>
<p>This means that each user's process must have stack greater at least
context size (28 bytes) + call depth multiplied by 2.</p>
<p>The Port uses one common stack for data and return addresses.</p>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id2" id="program-control-flow-transfer" name="program-control-flow-transfer">Program Control Flow Transfer</a></h1>
<p>Both methods - direct and software interrupt - are supported in the port.</p>
<p>In case of direct program control flow transfer there are no any peculiarities.</p>
<p>In case of software interrupt program control flow transfer a situation is the
following: unfortunately,  MSP430 has no special software interrupt, therefore,
one of hardware interrupts has been used. Any scmRTOS release has default
Software Context Switch interrupt assignment. The user can leave this default
assignment or change the assignment by analogy with defaults according to his
project requirements. This assignment is defined in project-dependent part of
the RTOS - <tt class="docutils literal"><span class="pre">scmRTOS_TARGET_CFG.h</span></tt> header file.</p>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id3" id="interrupts" name="interrupts">Interrupts</a></h1>
<p>The using of interrupts with scmRTOS does not make any special demands. The
user should keep in mind two things:</p>
<ul class="plain simple">
<li>interrupt service routine (ISR) function must be qualified with
<tt class="docutils literal"><span class="pre">OS_INTERRUPT</span></tt> macro;</li>
<li><tt class="docutils literal"><span class="pre">TISRW</span></tt> or <tt class="docutils literal"><span class="pre">TISRW_SS</span></tt> object must be declared at the beginning of the ISR. This
object involves constructor and destructor that play very important role in
the RTOS rescheduling mechanism and integrity. There are two scenarios
when entering ISR: switch to separate ISR stack by software or work in
current stack. In case of current stack <tt class="docutils literal"><span class="pre">TISRW</span></tt> object must be used, otherwise,
in case of separate ISR stack - <tt class="docutils literal"><span class="pre">TISRW_SS</span></tt> object.</li>
</ul>
<p>When <tt class="docutils literal"><span class="pre">TISRW_SS</span></tt> object is used, interrupt body executed in separate ISR stack.
This stack occupies the the space that was used by processor's stack before
the RTOS starts. Therefore, this stack depth is defined in linker script by
directive:</p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">-D_STACK_SIZE=#N</span></tt></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">#N</span></tt> - size of the stack.</p>
<p>The user can set the value of the stack using this directive or
IDE options (in case of using of IAR Embedded Workbench).</p>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id4" id="system-timer" name="system-timer">System Timer</a></h1>
<p>scmRTOS v3 allows for user to choose any available hardware timer, fully setup
the timer and setup interrupt vector of the timer. As Software Context Switch
interrupt assignment, any scmRTOS release has default timer assignment. The user
can leave this default assignment or change the assignment by analogy with defaults
according to his project requirements. All project-dependent definitions of System
Timer hardware implementation (setting, interrupt vector, etc.) resided in
project-dependent part of the RTOS - <tt class="docutils literal"><span class="pre">scmRTOS_TARGET_CFG.h</span></tt> header file.</p>
</div>
<hr class="docutils" />
<div class="section">
<h1><a class="toc-backref" href="#id5" id="summary" name="summary">Summary</a></h1>
<p>See <a class="reference" href="../../releases/index.html">Release info</a>
for more details about port features and using examples.</p>
<p>As usual, see <a class="reference" href="../../doc/index.html">User's Manual</a> for more details
about RTOS contents, structure, functionality and features.</p>
</div>

        </div>
        </td>
    </tr></table>
</td></tr>

<tr><td valign="bottom">
    <table border="0" cellspacing="0" cellpadding="6" width="100%">
    <tr id="footer">
        <td><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=181958&amp;type=3" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a></td>
        <td align="right">Copyright 漏 scmRTOS Team 2006-2008</td>
    </tr></table>
</td></tr>
</table>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -