<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://www.pic24.ru/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://www.pic24.ru/feed.php">
        <title>PIC24 en:osa:ref:appendix</title>
        <description></description>
        <link>http://www.pic24.ru/</link>
        <image rdf:resource="http://www.pic24.ru/lib/images/favicon.ico" />
       <dc:date>2023-02-10T09:10:23+03:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/3leds_pic10f?rev=1229681031"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration?rev=1285336252"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/errorlist?rev=1251881667"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/intro?rev=1243357195"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/leds28?rev=1286445502"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/optimization?rev=1286445503"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/quartet?rev=1229726922"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/resources?rev=1276502009"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/speed?rev=1295697781"/>
                <rdf:li rdf:resource="http://www.pic24.ru/doku.php/en/osa/ref/appendix/static_timers_old?rev=1225403023"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://www.pic24.ru/lib/images/favicon.ico">
        <title>PIC24</title>
        <link>http://www.pic24.ru/</link>
        <url>http://www.pic24.ru/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/3leds_pic10f?rev=1229681031">
        <dc:format>text/html</dc:format>
        <dc:date>2008-12-19T13:03:51+03:00</dc:date>
        <title>OSA : example for PIC10</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/3leds_pic10f?rev=1229681031</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_example_for_pic10&quot; id=&quot;osa_example_for_pic10&quot;&gt;OSA : example for PIC10&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : example for PIC10&quot; [1-46] --&gt;
&lt;h2&gt;&lt;a name=&quot;project&quot; id=&quot;project&quot;&gt;Project&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

This example demonstrates using RTOS OSA under 12-bit microcontroller. Unrar file &lt;a href=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/3leds.rar&quot; class=&quot;media mediafile mf_rar&quot; title=&quot;osa:3leds.rar&quot;&gt;3leds.rar&lt;/a&gt; into folder &amp;quot;C:\TEST\3LEDS&amp;quot;. This programm written under &lt;strong&gt;PIC10F222&lt;/strong&gt; (you can rebuild it under &lt;strong&gt;F202&lt;/strong&gt; or &lt;strong&gt;206&lt;/strong&gt;).
&lt;/p&gt;

&lt;p&gt;
This program forms PWM signals to drive 7-color LED. It slowly changes width of pulses for every LED. There are four speeds of color changing.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Project&quot; [47-445] --&gt;
&lt;h2&gt;&lt;a name=&quot;scheme&quot; id=&quot;scheme&quot;&gt;Scheme&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Here is scheme of device. Controller drives three n-p-n transistors. Every transistor controls LED. Notice that buttons and transistors are connected to same pins.
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/3leds_pic10f.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:3leds_pic10f.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/3leds_pic10f.jpg&quot; class=&quot;media&quot; title=&quot;3leds_pic10f.jpg&quot; alt=&quot;3leds_pic10f.jpg&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Button &lt;span class=&quot;important&quot;&gt;S1&lt;/span&gt; makes red LED active.&lt;br/&gt;
 
Button &lt;span class=&quot;important&quot;&gt;S2&lt;/span&gt; makes green LED active.&lt;br/&gt;
 
Button &lt;span class=&quot;important&quot;&gt;S3&lt;/span&gt; makes blue LED active.&lt;br/&gt;
 
Button &lt;span class=&quot;important&quot;&gt;S4&lt;/span&gt; canges work speed.&lt;br/&gt;
 
&lt;/p&gt;

&lt;p&gt;

&lt;strong&gt;Note.&lt;/strong&gt; Values of resistors &lt;strong&gt;R11&lt;/strong&gt;, &lt;strong&gt;R12&lt;/strong&gt; and &lt;strong&gt;R13&lt;/strong&gt; are selected according to used LEDs.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Scheme&quot; [446-924] --&gt;
&lt;h2&gt;&lt;a name=&quot;work_description&quot; id=&quot;work_description&quot;&gt;Work description&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Program contains three tasks:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;Task_Leds&lt;/span&gt; - forming pulses to drive LEDs.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;Task_Work&lt;/span&gt; - forming values of length for each LED.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;span class=&quot;important&quot;&gt;Task_Buttons&lt;/span&gt; - sans buttons.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Work description&quot; [925-1137] --&gt;
&lt;h3&gt;&lt;a name=&quot;task_leds&quot; id=&quot;task_leds&quot;&gt;Task_Leds&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

This task waits for TMR0 overflow. When overflow occures, all active LEDs are switchs on. Then task waits for TMR0 becames greater than intensity value of each LED and switch corresponding LED off. Program has three variables holding intensity values for each LED. When all LEDs becames switched off, other tasks can get control.
&lt;/p&gt;

&lt;p&gt;
Two other tasks (&lt;span class=&quot;important&quot;&gt;Task_Work&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;Task_Button&lt;/span&gt;) waits for setting bits &lt;strong&gt;&lt;em&gt;bRunTaskWork&lt;/em&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;em&gt;bRunTaskButtons&lt;/em&gt;&lt;/strong&gt; respectively. This bits are set by &lt;span class=&quot;important&quot;&gt;Task_Leds&lt;/span&gt; after all LEDs switchs off.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task_Leds&quot; [1138-1692] --&gt;
&lt;h3&gt;&lt;a name=&quot;task_work&quot; id=&quot;task_work&quot;&gt;Task_Work&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

When task gets control, it checks is it time to change intenesity variables. There is a variable &lt;strong&gt;&lt;em&gt;Speed&lt;/em&gt;&lt;/strong&gt;. It&amp;#039;s value changes every time when task get control. Speed of increasing (speed of intensity changing) are set by two MSB bits of variable &lt;strong&gt;&lt;em&gt;Speed&lt;/em&gt;&lt;/strong&gt; (Speed.cSpeed). When 5 lowes bits of variable &lt;strong&gt;&lt;em&gt;Speed&lt;/em&gt;&lt;/strong&gt; (Speed.cPrs) overflows, bit Speed.bTimeout becames set and function &lt;span class=&quot;important&quot;&gt;ChangeIntensity()&lt;/span&gt; called. This functions changes intensity values of all LEDs (variables &lt;strong&gt;&lt;em&gt;Red&lt;/em&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;em&gt;Green&lt;/em&gt;&lt;/strong&gt; and &lt;em&gt;&lt;strong&gt;Blue&lt;/strong&gt;&lt;/em&gt;). 
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteclassic&quot;&gt;
Function &lt;span class=&quot;important&quot;&gt;ChangeIntensity()&lt;/span&gt; is not a part of RTOS, thus you can to modify it as you wish to make your own intensity changing style.

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task_Work&quot; [1693-2400] --&gt;
&lt;h3&gt;&lt;a name=&quot;task_button&quot; id=&quot;task_button&quot;&gt;Task_Button&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

This task gets control one time in every 16 milliseconds, when bit &lt;strong&gt;&lt;em&gt;bRunTaskButtons&lt;/em&gt;&lt;/strong&gt; becames set. First all pins set as inputs. Then program checks state of pins: if any pin eq. to &amp;quot;0&amp;quot;, then corresponding button is pressed. Buttons &lt;span class=&quot;important&quot;&gt;SW1&lt;/span&gt;, &lt;span class=&quot;important&quot;&gt;SW2&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;SW3&lt;/span&gt; set intensity of red, green or blue at maximum, respectively (two other LEDs will be switched off). Button &lt;span class=&quot;important&quot;&gt;SW4&lt;/span&gt; increases value of Speed.cSpeed by 1. After all buttons checked, task waits for button release. Before exit from task, all pins set as output. 
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Task_Button&quot; [2401-2951] --&gt;
&lt;h2&gt;&lt;a name=&quot;photos&quot; id=&quot;photos&quot;&gt;Photos&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color2.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color2.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color2.jpg&quot; class=&quot;media&quot; title=&quot;color2.jpg&quot; alt=&quot;color2.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color5.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color5.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color5.jpg&quot; class=&quot;media&quot; title=&quot;color5.jpg&quot; alt=&quot;color5.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color7.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color7.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color7.jpg&quot; class=&quot;media&quot; title=&quot;color7.jpg&quot; alt=&quot;color7.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color8.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color8.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color8.jpg&quot; class=&quot;media&quot; title=&quot;color8.jpg&quot; alt=&quot;color8.jpg&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color9.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color9.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color9.jpg&quot; class=&quot;media&quot; title=&quot;color9.jpg&quot; alt=&quot;color9.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color10.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color10.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color10.jpg&quot; class=&quot;media&quot; title=&quot;color10.jpg&quot; alt=&quot;color10.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color11.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color11.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color11.jpg&quot; class=&quot;media&quot; title=&quot;color11.jpg&quot; alt=&quot;color11.jpg&quot; /&gt;&lt;/a&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/color12.jpg?id=en%3Aosa%3Aref%3Aappendix%3A3leds_pic10f&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:color12.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/color12.jpg&quot; class=&quot;media&quot; title=&quot;color12.jpg&quot; alt=&quot;color12.jpg&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Photos&quot; [2952-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration?rev=1285336252">
        <dc:format>text/html</dc:format>
        <dc:date>2010-09-24T17:50:52+03:00</dc:date>
        <title>Configuration file OSAcfg.h</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration?rev=1285336252</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;configuration_file_osacfg.h&quot; id=&quot;configuration_file_osacfg.h&quot;&gt;Configuration file OSAcfg.h&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

The file OSAcfg.h must be created for each project. (It is recommended that you place this file in the project folder.) This file is automatically included by the file osa.h. It contains operating system setup data.
&lt;/p&gt;

&lt;p&gt;
In the simplest case this file can be empty.
&lt;/p&gt;

&lt;p&gt;
&lt;p&gt;&lt;div class=&quot;noteimportant&quot;&gt;
To simplify creating/modifying OSAcfg.h, you can use the program &lt;strong&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/osacfg_tool_setup.rar&quot; class=&quot;media mediafile mf_rar&quot; title=&quot;osa:osacfg_tool_setup.rar&quot;&gt;OSAcfg_Tool&lt;/a&gt;&lt;/strong&gt;

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Configuration file OSAcfg.h&quot; [1-443] --&gt;
&lt;h2&gt;&lt;a name=&quot;system_constants&quot; id=&quot;system_constants&quot;&gt;System constants&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Constant name &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Description &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_ALL&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Includes all services and all system types except user timers (see below) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_CSEM&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables counting semaphores &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_QUEUE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables queues of pointers to messages &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_SQUEUE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables queues of simple messages &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_QUEUE_SQUEUE_IDENTICAL&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; This constant can be defined to reduce memory usage when sizes of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_smsg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SMSG&lt;/a&gt;&lt;/span&gt; are identical. This can be useful for PIC10, PIC12 and PIC16 &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_CRITICAL_SECTION&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Includes codes for using critical sections  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;System constants&quot; [444-1152] --&gt;
&lt;h2&gt;&lt;a name=&quot;priority_control_constants&quot; id=&quot;priority_control_constants&quot;&gt;Priority control constants&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Имя константы &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Допустимые значения &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; Описание &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_PRIORITY_LEVEL&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_PRIORITY_NORMAL&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; (defaul) Normal priority mode with checking tasks in order of creation  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_PRIORITY_DISABLED&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; Disables task priorities. This reduces RAM and ROM usage  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_PRIORITY_EXTENDED&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; In this mode all task will get the control according to their priority  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; &lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_DISABLE_PRIORITY&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; old style consant &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Same as &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_PRIORITY_DISABLE &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Priority control constants&quot; [1153-1709] --&gt;
&lt;h2&gt;&lt;a name=&quot;timers_control_constants&quot; id=&quot;timers_control_constants&quot;&gt;Timers control constants&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Constant name &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Description &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_TTIMERS&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables task timers and functions to use them &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_DTIMERS&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables functions to use dynamic timers &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_QTIMERS&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables functions to use queue of timers &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_STIMERS&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Number of static timers. Enables array of static timers  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_STIMERS_ENABLE_ALLOCATION&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables functions to assign static timers at run time &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_STIMERS_OPTIMIZATION_SIZE&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Optimizes size of code for processing static timers in &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_Timer (by default it is optimized for speed) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TTIMERS_OPTIMIZATION_SIZE&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Optimizes size of code for processing task timers in &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_Timer (by default it is optimized for speed) &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Timers control constants&quot; [1710-2443] --&gt;
&lt;h2&gt;&lt;a name=&quot;services_in_interrupts&quot; id=&quot;services_in_interrupts&quot;&gt;Services in interrupts&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Constant name &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Description &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_INT_CSEM&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Allows the use of binary semaphore services within interrupts &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_INT_CSEM&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Allows the use of counting semaphore services within interrupts &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_INT_FLAGS&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Allows the use of flags within interrupts &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_INT_MSG&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Allows the use of pointer to message services within interrupts &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_INT_SMSG&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Allows the use of simple message services within interrupts &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_INT_QUEUE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Allows the use of queue services within interrupts &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_INT_ALL&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Enables all constants above &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Services in interrupts&quot; [2444-3088] --&gt;
&lt;h2&gt;&lt;a name=&quot;data_contents&quot; id=&quot;data_contents&quot;&gt;Data contents&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Constant name &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Description &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; RAM usage &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TASKS&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Maximum number of active tasks &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt; &lt;strong&gt;2&lt;/strong&gt; bytes per task for &lt;strong&gt;PIC12&lt;/strong&gt; and &lt;strong&gt;PIC10&lt;/strong&gt;&lt;br/&gt;
  &lt;strong&gt;3&lt;/strong&gt; bytes per task for &lt;strong&gt;PIC16&lt;/strong&gt;&lt;br/&gt;
  &lt;strong&gt;4&lt;/strong&gt; bytes per task for &lt;strong&gt;PIC18&lt;/strong&gt;&lt;br/&gt;
 &lt;strong&gt;20&lt;/strong&gt; bytes per task for &lt;strong&gt;PIC24&lt;/strong&gt; and &lt;strong&gt;dsPIC&lt;/strong&gt;&lt;br/&gt;
 &lt;strong&gt;5&lt;/strong&gt; bytes per task for &lt;strong&gt;AVR&lt;/strong&gt;&lt;br/&gt;
 The number of bytes per task will be increased when &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ENABLE_TTIMERS is defined.  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BSEMS&lt;/span&gt;    &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; Number of binary semaphores  &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; One byte per eight semaphores (for 8-bit controllers); two bytes per 16 semaphores (for 16-bit controllers) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMERS8&lt;/span&gt; (old style)*  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Number of 8-bit static timers &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 1 byte per timer &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMERS16&lt;/span&gt; (old style)* &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Number of 16-bit static timers &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 2 bytes per timer &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMERS24&lt;/span&gt; (old style)* &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Number of 24-bit static timers &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 2 bytes per timer &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMERS32&lt;/span&gt; (old style)* &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; Number of 32-bit static timers &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; 4 bytes per timer &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

* - this type of timer is &lt;strong&gt;not&lt;/strong&gt; recommended for use
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Data contents&quot; [3089-4155] --&gt;
&lt;h2&gt;&lt;a name=&quot;data_types&quot; id=&quot;data_types&quot;&gt;Data types&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Constant name &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Default value &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; Description &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMER_SIZE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 2 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Number of bytes per timer (can be 1, 2 or 4) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_STIMER_SIZE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMER_SIZE &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Number of bytes per static timer (can be 1, 2 or 4) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TTIMER_SIZE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMER_SIZE &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Number of bytes per task timer (can be 1, 2 or 4) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_DTIMER_SIZE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMER_SIZE &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Number of bytes per dynamic timer (can be 1, 2 or 4) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_QTIMER_SIZE&lt;/span&gt; &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_TIMER_SIZE &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Number of bytes per timer in queue of timers (can be 1, 2 or 4) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_CSEM_SIZE&lt;/span&gt;  &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; 1 &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Number of bytes per counting semaphore (can be 1, 2 or 4) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_SMSG_TYPE&lt;/span&gt;*      &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; unsigned char &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Type of simple message &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_MSG_TYPE&lt;/span&gt;*       &lt;/td&gt;&lt;td class=&quot;col1&quot;&gt; void * &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt; Type of message &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

* - these types can&amp;#039;t be redefined for PIC12.
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Data types&quot; [4156-4940] --&gt;
&lt;h2&gt;&lt;a name=&quot;data_allocation_for_pic10_pic12_pic16_and_pic18&quot; id=&quot;data_allocation_for_pic10_pic12_pic16_and_pic18&quot;&gt;Data allocation for PIC10, PIC12, PIC16 and PIC18&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Allowed &lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_xxx values:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; for PIC10, PIC12, PIC16: 0, 1, 2 or 3 - to select bank0, bank1, bank2, bank3.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; for PIC18: 0 - &amp;quot;access RAM&amp;quot;, not 0 - other RAM.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; for PIC24: 0 - &amp;quot;near&amp;quot;, not 0 - any RAM&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; for STM8:  0 - &amp;quot;near&amp;quot;, not 0 - any RAM&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt; Constant name &lt;/th&gt;&lt;th class=&quot;col1&quot;&gt; Default value &lt;/th&gt;&lt;th class=&quot;col2&quot;&gt; Description &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;&lt;/span&gt;(1)         &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;0                  &lt;/td&gt;&lt;td class=&quot;col2&quot;&gt;To allocate all system varables except those individually allocated (see below) &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_BSEMS&lt;/span&gt;(1)      &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;         &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate binary semaphores  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TASKS&lt;/span&gt;(1)      &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;         &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate task descriptors   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_STIMERS&lt;/span&gt;(1)    &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate new style static timers  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_ADDRESS_TASK&lt;/span&gt;    &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;-     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;For mikroC PRO for PIC16: Used to allocate task descriptors at specified address (e.g. 0x120, or 0x190)   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS&lt;/span&gt; (old style)(1),(2)    &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;         &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate all static timers (old style and new style)  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS8&lt;/span&gt; (old style)(1),(2)   &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate 8-bit timers   &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS16&lt;/span&gt; (old style)(1),(2)  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate 16-bit timers  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS24&lt;/span&gt; (old style)(1),(2)  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate 24-bit timers  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS32&lt;/span&gt; (old style)(1),(2)  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate 32-bit timers  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt;&lt;span style='color:lightblue; '&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMEOUTS&lt;/span&gt; (old style)(1),(2)  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt;&lt;acronym title=&quot;Operating System&quot;&gt;OS&lt;/acronym&gt;_BANK_TIMERS     &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;To allocate timeout bits for old style static timers  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

(1) - has no effect when using CCS, mikroC PRO, or AVR&lt;br/&gt;
 
(2) - this type of timer is &lt;strong&gt;not&lt;/strong&gt; recommended for use
&lt;/p&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Data allocation for PIC10, PIC12, PIC16 and PIC18&quot; [4941-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/errorlist?rev=1251881667">
        <dc:format>text/html</dc:format>
        <dc:date>2009-09-02T12:54:27+03:00</dc:date>
        <title>OSA : Error list</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/errorlist?rev=1251881667</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_error_list&quot; id=&quot;osa_error_list&quot;&gt;OSA : Error list&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Error list&quot; [11-42] --&gt;
&lt;h3&gt;&lt;a name=&quot;unknown_compiler&quot; id=&quot;unknown_compiler&quot;&gt;#1 : Unknown compiler!&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

OSA can be built only under comilers:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; HI-TECH PICC STD&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; HI-TECH PICC18 STD&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Microchip C18&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Microchip C30&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; CCS PICC&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; microC PRO for PIC&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

Other compilers are not supported yet.

&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;#1 : Unknown compiler!&quot; [43-277] --&gt;
&lt;h3&gt;&lt;a name=&quot;constants_os_xxx_bank_are_not_allowed_now_use_os_bank_xxx_instead&quot; id=&quot;constants_os_xxx_bank_are_not_allowed_now_use_os_bank_xxx_instead&quot;&gt;#2 : Constants OS_xxx_BANK are not allowed now (use OS_BANK_xxx instead)&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

This means that you defined old-style constant for allocation OSA variables in file &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h.&lt;/a&gt;&lt;/span&gt; New-style names are prefixed by &amp;quot;&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_BANK_&lt;/a&gt;&lt;/span&gt;&amp;quot;. See &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration#data_allocation_for_pic10_pic12_pic16_and_pic18&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;configuration&lt;/a&gt;.

&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;#2 : Constants OS_xxx_BANK are not allowed now (use OS_BANK_xxx instead)&quot; [278-697] --&gt;
&lt;h3&gt;&lt;a name=&quot;incorrect_os_bank_xxx_value_should_be_0_1_2_or_3&quot; id=&quot;incorrect_os_bank_xxx_value_should_be_0_1_2_or_3&quot;&gt;#3 .. #12 : Incorrect OS_BANK_xxx value (should be 0, 1, 2 or 3)&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

You define one or several &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_BANK_xxx&lt;/a&gt;&lt;/span&gt; constants in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt; with incorrect value. Allowed values 0, 1, 2 and 3 only.

&lt;/p&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;#3 .. #12 : Incorrect OS_BANK_xxx value (should be 0, 1, 2 or 3)&quot; [698-981] --&gt;
&lt;h3&gt;&lt;a name=&quot;ost_timer_is_not_supported_use_os_timer_size_instead&quot; id=&quot;ost_timer_is_not_supported_use_os_timer_size_instead&quot;&gt;#13 : OST_TIMER is not supported! Use OS_TIMER_SIZE instead&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

This means that you defined old-style constant. &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_timer&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_TIMER&lt;/a&gt;&lt;/span&gt; is not supported now. In old OSA versions this constant could be used to redefine type of timers, where type was given directly (e.g. &lt;strong&gt;char&lt;/strong&gt;, &lt;strong&gt;unsigned long&lt;/strong&gt;). Now you can redefine timer&amp;#039;s type by setting it&amp;#039;s size. For example:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OS_TIMER_SIZE    4      // Timer's type will be unsigned long&lt;/span&gt;&lt;/pre&gt;&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;#13 : OST_TIMER is not supported! Use OS_TIMER_SIZE instead&quot; [982-1492] --&gt;
&lt;h3&gt;&lt;a name=&quot;can_t_redefine_name_ost_xxx_in_osacfg.h_._use_os_xxx_type_instead&quot; id=&quot;can_t_redefine_name_ost_xxx_in_osacfg.h_._use_os_xxx_type_instead&quot;&gt;#14 .. #15 : Can&amp;#039;t redefine name OST_xxx in &amp;#039;OSAcfg.h&amp;#039;. Use OS_xxx_TYPE instead.&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Since 90200 types of &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_smsg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_SMSG&lt;/a&gt;&lt;/span&gt; can be redefined only trougth new constants &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_MSG_TYPE&lt;/a&gt;&lt;/span&gt; and &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_SMSG_TYPE.&lt;/a&gt;&lt;/span&gt; The reason is below:
&lt;/p&gt;

&lt;p&gt;
&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG&lt;/a&gt;&lt;/span&gt; was defined as:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OST_MSG    void *&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
When you define several variables of this type:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;OST_MSG msg1, msg2, msg3;&lt;/pre&gt;
&lt;p&gt;
compiler makes substitute:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; msg1, msg2, msg3;&lt;/pre&gt;
&lt;p&gt;
As you see, only &lt;strong&gt;msg1&lt;/strong&gt; will be pointer to void, while &lt;strong&gt;msg2&lt;/strong&gt; and &lt;strong&gt;msg3&lt;/strong&gt; will be just void.
&lt;/p&gt;

&lt;p&gt;
Situation could be corrected by relacing type definition by:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;sy2&quot;&gt;*&lt;/span&gt; OST_MSG;&lt;/pre&gt;
&lt;p&gt;
But in this case user can&amp;#039;t to redefine this type. At this reason type of MSG is redefined in &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt; not directly, but througth constant:

&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;co2&quot;&gt;#define OS_MSG_TYPE     int *&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;
and then &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/description/data_types#ost_msg&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:description:data_types&quot;&gt;OST_MSG&lt;/a&gt;&lt;/span&gt; defined in OSA.h:
&lt;/p&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;typedef&lt;/span&gt; OS_MSG_TYPE   OST_MSG;&lt;/pre&gt;&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;#14 .. #15 : Can't redefine name OST_xxx in 'OSAcfg.h'. Use OS_xxx_TYPE instead.&quot; [1493-2774] --&gt;
&lt;h3&gt;&lt;a name=&quot;incorrect_os_csem_size_value_m.b._only_1_2_or_4_see_osacfg.h&quot; id=&quot;incorrect_os_csem_size_value_m.b._only_1_2_or_4_see_osacfg.h&quot;&gt;#16 : Incorrect OS_CSEM_SIZE value (m.b. only 1, 2 or 4)! (see OSAcfg.h)&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

You entered incorrect size for variables of counting semaphore type. Allowed values:

&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 1 - for unsigned char&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 2 - for unsigned int&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 4 - for unsigned long&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;#16 : Incorrect OS_CSEM_SIZE value (m.b. only 1, 2 or 4)! (see OSAcfg.h)&quot; [2775-3029] --&gt;
&lt;h3&gt;&lt;a name=&quot;bad_os_xxx_size_must_be_1_2_or_4&quot; id=&quot;bad_os_xxx_size_must_be_1_2_or_4&quot;&gt;#17 .. #20 : Bad OS_xxx size (must be 1, 2 or 4)&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

You entered incorrect size for timer variables. Allowed values:

&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 1 - for unsigned char&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 2 - for unsigned int&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 4 - for unsigned long&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;#17 .. #20 : Bad OS_xxx size (must be 1, 2 or 4)&quot; [3030-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/intro?rev=1243357195">
        <dc:format>text/html</dc:format>
        <dc:date>2009-05-26T20:59:55+03:00</dc:date>
        <title>OSA : Appendix</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/intro?rev=1243357195</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_appendix&quot; id=&quot;osa_appendix&quot;&gt;OSA : Appendix&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/services/alphabetical&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:services:alphabetical&quot;&gt;Alphabetical&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/services/brieflist&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:services:brieflist&quot;&gt;All services&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;Configuration OSAcfg.H&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/resources&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:resources&quot;&gt;Memory usage&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/speed&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:speed&quot;&gt;Speed&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/leds28?rev=1286445502">
        <dc:format>text/html</dc:format>
        <dc:date>2010-10-07T13:58:22+03:00</dc:date>
        <title></title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/leds28?rev=1286445502</link>
        <description></description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/optimization?rev=1286445503">
        <dc:format>text/html</dc:format>
        <dc:date>2010-10-07T13:58:23+03:00</dc:date>
        <title>OSA : (UNDER_CONSTRUCTION)</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/optimization?rev=1286445503</link>
        <description></description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/quartet?rev=1229726922">
        <dc:format>text/html</dc:format>
        <dc:date>2008-12-20T01:48:42+03:00</dc:date>
        <title>OSA usage example: QUARTET</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/quartet?rev=1229726922</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_usage_examplequartet&quot; id=&quot;osa_usage_examplequartet&quot;&gt;OSA usage example: QUARTET&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA usage example: QUARTET&quot; [1-47] --&gt;
&lt;h2&gt;&lt;a name=&quot;project&quot; id=&quot;project&quot;&gt;Project&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Program &lt;strong&gt;quartet&lt;/strong&gt; synthesizes melody by given notes (it plays part of J.S.Bach N1067). Unpack file &lt;a href=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/quartet4.rar&quot; class=&quot;media mediafile mf_rar&quot; title=&quot;osa:quartet4.rar&quot;&gt;quartet4.rar&lt;/a&gt; into foulder &amp;quot;C:\TEST\QUARTET&amp;quot;. This project is written for PIC16F628A.
&lt;/p&gt;

&lt;p&gt;
This program generates 4-channel melody, using 8-bit PWM at 78 KHz. Music is played with four samples: bass, violin and two guitars (of course, my samples are very different from reality). Each channel can be switched ON or OFF by switches.
&lt;/p&gt;

&lt;p&gt;
Here is &lt;span class=&quot;important&quot;&gt;&lt;acronym title=&quot;Motion Picture Experts Group Layer 3&quot;&gt;MP3&lt;/acronym&gt;&lt;/span&gt; (&lt;a href=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/quartet_mp3.rar&quot; class=&quot;media mediafile mf_rar&quot; title=&quot;osa:quartet_mp3.rar&quot;&gt;download&lt;/a&gt;), recorded from device&amp;#039;s output.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Project&quot; [48-603] --&gt;
&lt;h2&gt;&lt;a name=&quot;scheme&quot; id=&quot;scheme&quot;&gt;Scheme&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

The scheme of device is below. 8-bit digital signal from PWM through RC-filter R22-C3 and volume regulator R24 goes to headphones.
&lt;/p&gt;

&lt;p&gt;

&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/appendix/quartet_pwm.jpg?id=en%3Aosa%3Aref%3Aappendix%3Aquartet&quot; class=&quot;media&quot; title=&quot;osa:ref:appendix:quartet_pwm.jpg&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/appendix/quartet_pwm.jpg&quot; class=&quot;media&quot; title=&quot;quartet_pwm.jpg&quot; alt=&quot;quartet_pwm.jpg&quot; /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Switch &lt;span class=&quot;important&quot;&gt;SW1&lt;/span&gt; switchs bass ON/OFF.&lt;br/&gt;
 
Switch &lt;span class=&quot;important&quot;&gt;SW2&lt;/span&gt; switchs voilin ON/OFF.&lt;br/&gt;
 
Switch &lt;span class=&quot;important&quot;&gt;SW3&lt;/span&gt; switchs first guitar ON/OFF.&lt;br/&gt;
 
Switch &lt;span class=&quot;important&quot;&gt;SW4&lt;/span&gt; switchs second guitar ON/OFF.&lt;br/&gt;
 
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Scheme&quot; [604-971] --&gt;
&lt;h2&gt;&lt;a name=&quot;description&quot; id=&quot;description&quot;&gt;Description&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Program consists of four files:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;quartet_main.c&lt;/strong&gt; - main program: tasks and notes working functions.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;music.c&lt;/strong&gt; - contains frequencies table and notelists for each channel.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;sinus.c&lt;/strong&gt; - contains three arrays with sinus data for each instrument (bass, violin, guitar).&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;interrupt.c&lt;/strong&gt; - interrupt function. It contains code of synthesizer (called every 100 us).&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

&lt;strong&gt;quartet_main.c&lt;/strong&gt; described below.
&lt;/p&gt;

&lt;p&gt;
Program consists of 5 tasks. Four of them are &amp;quot;musicants&amp;quot;, and fifth is &amp;quot;conductor&amp;quot; that sinchronize first four tasks.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Description&quot; [972-1534] --&gt;
&lt;h3&gt;&lt;a name=&quot;sound_control&quot; id=&quot;sound_control&quot;&gt;Sound control&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

To control sound type &lt;strong&gt;TSound&lt;/strong&gt; defined in &lt;strong&gt;quartet_main.c&lt;/strong&gt;. Variables of this type contains all sound information for &amp;quot;musicant&amp;quot;:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; current note;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; notelist;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; is &amp;quot;musicant&amp;quot; in pause;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; is &amp;quot;musicant&amp;quot; repeats fragment;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
for &amp;quot;conductor&amp;quot;:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; when it must give next command to &amp;quot;musicant&amp;quot;;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; did &amp;quot;musicant&amp;quot; stop playing (reach end of nitelist)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
for synthesiser:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; current sound frequency;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; time of playing current note (to form envelope for signal).&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Sound control&quot; [1535-2023] --&gt;
&lt;h3&gt;&lt;a name=&quot;musicants&quot; id=&quot;musicants&quot;&gt;&amp;quot;Musicants&amp;quot;&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

There are four &amp;quot;musicants&amp;quot; in program: Task_BASS, Task_VIOLIN, Task_GUITAR1, Task_GUITAR2. All time &amp;quot;musicants&amp;quot; wait for command from &amp;quot;conductor&amp;quot; (binary semaphore). When getting command, &amp;quot;musicant&amp;quot; reads next note from his notelist, plays it (task forms data for synthesizer).
&lt;/p&gt;

&lt;p&gt;
Note produced in &lt;strong&gt;NoteWork()&lt;/strong&gt; function, witch gets variable of sound control TSound in parameters. Using data of this variable function reads next note (or instruction: repeat, pause, ect.) and makes several operations to form parameters to synthesizer, in addition this function forms duration varianble. This variable decreases on every command from &amp;quot;conductor&amp;quot;.
&lt;/p&gt;

&lt;p&gt;
When &amp;quot;musicant&amp;quot; reaches the end of notelist, he informs &amp;quot;conductor&amp;quot; about it (task clears corresponding bit in flag variable &lt;strong&gt;flags_Playing&lt;/strong&gt;). After that &amp;quot;musicant&amp;quot; begins to wait for &amp;quot;conductor&amp;#039;s&amp;quot; command to restart music (binary semaphore BS_START). When &amp;quot;musicant&amp;quot; gets it, he goes to begin of notelist (sound control variable re-initializates) and sends &amp;quot;conductor&amp;#039;s&amp;quot; command to next&amp;quot;musicant&amp;quot;.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Musicants&quot; [2024-3096] --&gt;
&lt;h3&gt;&lt;a name=&quot;conductor&quot; id=&quot;conductor&quot;&gt;&amp;quot;Conductor&amp;quot;&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Taks_CONDUCTOR (&amp;quot;conductor&amp;quot;) has priority lower then &amp;quot;musicants&amp;quot;. &amp;quot;Conductor&amp;quot; counts ticks like metronome and looks to ensure that all &amp;quot;musicants&amp;quot; get commands at correct time. Task_CONDUCTOR gets control every 150 ms. On every execution it checks for music state. When &amp;quot;conductor&amp;quot; determines that all &amp;quot;musicants&amp;quot; stopped to play (all bits in flag variable &lt;strong&gt;flag_Playing&lt;/strong&gt; are cleared), he sends command to &amp;quot;musicants&amp;quot; to restart musig from the begin.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Conductor&quot; [3097-3574] --&gt;
&lt;h3&gt;&lt;a name=&quot;two_words_about_synthesizer&quot; id=&quot;two_words_about_synthesizer&quot;&gt;Two words about synthesizer&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Sinthesizer is placed into interrupt routine if file &lt;strong&gt;interrupt.c&lt;/strong&gt;. Interrupt takes all sound control variables and forms digital signal. To make this work it has:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; three tables of sound patterns for each sample: bass[], violin[], guitar[] (see sinus.c). This arrays contains one sinus period per each sample.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; envelope formulas (see comments FORMING_SIGNAL_xxx): attack, release, ect.&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; macro for fast multiplication (char) = high( (signed char)*(unsigned char) ), to multiply sinus value by enveloping amplitude.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

All four current values of sound are summed up, and then result is divided by four. After that result copies into m_cDAC variable. On next start of interrupt routine this variable will be copied into PWM buffer register CCPR1L (two least significant bits are copied into bits CCP1X and CCP1Y of CCP1CON register).
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Two words about synthesizer&quot; [3575-4454] --&gt;
&lt;h3&gt;&lt;a name=&quot;about_notelists&quot; id=&quot;about_notelists&quot;&gt;About notelists&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

Few information about notelist will help you to create your music.
&lt;/p&gt;

&lt;p&gt;
File &lt;strong&gt;music.c&lt;/strong&gt; contains definitions for notes: C0, C0_, D0, D0_, ect. There are definitons for 57 frequencies (four with half octaves). When we create note in notelist (arrays &lt;strong&gt;notelist_xxx&lt;/strong&gt;) using macro &lt;strong&gt;play()&lt;/strong&gt;, we can to set note only with 5 bits (32 notes). Therefore there is possibleness to set base octave (macro &lt;strong&gt;setbase()&lt;/strong&gt;). Note duration is selected using only 2 bits, so only four durations can be set. If you need note with longest duration, you can use either macro &lt;strong&gt;pause()&lt;/strong&gt; (pauses sound by several ticks) or macro &lt;strong&gt;playmore()&lt;/strong&gt; (continue playing sound for several ticks).
&lt;/p&gt;

&lt;p&gt;
Notelist must be ended with macro &lt;strong&gt;stop()&lt;/strong&gt; to avoid reading unitializes memory cells.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;About notelists&quot; [4455-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/resources?rev=1276502009">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-14T11:53:29+03:00</dc:date>
        <title>OSA : Memory usage</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/resources?rev=1276502009</link>
        <description>




&lt;h1&gt;&lt;a name=&quot;osa_memory_usage&quot; id=&quot;osa_memory_usage&quot;&gt;OSA : Memory usage&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

These tables allow you to predict average ROM and RAM usage so that you can choose an appropriate microcontroller for your project. 
&lt;/p&gt;

&lt;p&gt;
The test program OSA\TEST\TEST_SIZE was used.

&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Compiler           &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;          min           &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;          normal           &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;          full          &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;Hi-tech PICC&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC12 (PIC10)       &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   153 / 11   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   250 / 14    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;   363 / 14           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC16 (PIC12)       &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   152 / 8    &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   258 / 11    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;   396 / 13           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC18               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   336 / 7    &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   548 / 10    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;   982 / 16           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;Hi-tech PICC PRO&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC16 (enhanced)    &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   169 / 6   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;    291 / 10    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;   385 / 10           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;Microchip C&lt;/strong&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC18               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   598 / 7    &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   862 / 10    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  1214 / 16           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC24 (dsPIC)       &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   846 / 10   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  1065 / 16    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  1305 / 16           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;MikroC&lt;/strong&gt;       &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC16               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   180 / 14   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   307 / 17    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;   474 / 17           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC18               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   426 / 11   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   746 / 16    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  1136 / 17           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;CCS PICC&lt;/strong&gt;     &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC16               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   254 / ..   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   399 / ..    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;   573 / ..           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; PIC18               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   436 / ..   &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   696 / ..    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  1046 / ..           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;WinAVR&lt;/strong&gt;       &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; AVR                 &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   602 / 8    &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;  1030 / 13    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  1348 / 15           &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;IAR&lt;/strong&gt;          &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; AVR                 &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;   550 / 8    &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;   958 / 13    &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;  1108 / 15           &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;
Test modes:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;min&lt;/strong&gt; (minimal services set)&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; priorities are OFF&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; allowed: binary semaphores, flags, messages&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;normal&lt;/strong&gt; (most usual services set)&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; priorities are ON&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; task timers are enabled&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; allowed: binary semaphores, flags, messages&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; waiting with exit on timeout services are enabled&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;strong&gt;full&lt;/strong&gt; (full services set, except user timers)&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; priorities are ON&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; task timers are enabled&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; allowed: binary semaphores, counting semaphores, flags, messages, queues&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; waiting with exit on timeout services are enabled&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; critical sections enabled&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;

(All modes support services for switching context, waiting for events, controlling tasks, enabling/disabling interrupts)
&lt;/p&gt;

&lt;p&gt;

&lt;strong&gt;Notes&lt;/strong&gt;:
&lt;/p&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; size of ROM shown in machine words for PIC10, PIC12 and PIC16 and in bytes for other;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; for MCC18 initialization code is included;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; for MCC30 initialization code is included;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; all test were compiled with maximum optimization;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; task size is not included:&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 2 bytes (+timer) for PICC12&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 3 bytes (+timer) for PICC16&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 3 bytes (+timer) for PICC16F1xxx&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 4 bytes (+timer) for PICC18&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 4 bytes (+timer) for MCC18&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 20 bytes (+timer) for MCC30&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 10 bytes (+timer) for WinAVR&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; 5 bytes (+timer) for IAR for AVR&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; memory usage can be reduced by disabling priority and by using one byte timers (see &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OSAcfg.h&lt;/a&gt;&lt;/span&gt;).&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;OSA : Memory usage&quot; [12-] --&gt;</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/speed?rev=1295697781">
        <dc:format>text/html</dc:format>
        <dc:date>2011-01-22T15:03:01+03:00</dc:date>
        <title>OSA : Speed characteristics</title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/speed?rev=1295697781</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;osa_speed_characteristics&quot; id=&quot;osa_speed_characteristics&quot;&gt;OSA : Speed characteristics&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

Here is an information to determine the time required by OSA to switch from one task to another for different chips under different compilers and priority modes. 
&lt;/p&gt;

&lt;p&gt;
How to use this table? First you have to find your compiler and your priority mode in table and get the value. Then this value should be multiplied by nomber of active tasks and then multiplied by time per instruction cycle.
&lt;/p&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  Compiler  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  PRIORITY_DISABLED  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  PRIORITY_NORMAL  &lt;/th&gt;&lt;th class=&quot;col3 centeralign&quot;&gt;  PRIORITY_EXTENDED  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;PIC10 (PIC12)&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row2&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; Hi-tech PICC            &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     54*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     84*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;        -         &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row3&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;PIC16 (PIC12)&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row4&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; HT-PICC STD             &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     49*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     80*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     123*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row5&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt; HT-PICC PRO (PIC1xF1xxx)&lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     39*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     64*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;      80*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row6&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; microC PRO              &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     74*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;    119*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     224*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row7&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; CCS PICC                &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     62*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;    107*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     167*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row8&quot;&gt;
		&lt;td class=&quot;col0&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;PIC18&lt;/strong&gt; &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row9&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; HT-PICC18 STD           &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     45*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     70*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;      85*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row10&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; MPLAB C18               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     55*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     96*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     117*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row11&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; microC PRO              &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     73*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     99*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     187*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row12&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; CCS PICC                &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     49*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     88*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     101*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row13&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;PIC24 (dsPIC)&lt;/strong&gt;  &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row14&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; MPLAB C30               &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     60*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     87*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     113*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row15&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;AVR&lt;/strong&gt;       &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row16&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; WinAVR                  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;    108*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;    172*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     190*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row17&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; IAR                     &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;    100*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;    148*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     177*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row18&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot; colspan=&quot;5&quot;&gt; &lt;br/&gt;
 &lt;strong&gt;STM8&lt;/strong&gt;      &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row19&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; Cosmic                  &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     35*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     58*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;      71*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row20&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; IAR                     &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     93*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;    118*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     238*N        &lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row21&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; Raisonance              &lt;/td&gt;&lt;td class=&quot;col1 centeralign&quot;&gt;     61*N     &lt;/td&gt;&lt;td class=&quot;col2 centeralign&quot;&gt;     80*N      &lt;/td&gt;&lt;td class=&quot;col3 centeralign&quot;&gt;     120*N        &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;p&gt;

N - namber of active tasks
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;An example 1 of determination&lt;/strong&gt;
Source data:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Microcontroller PIC16F628&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Compiler HT PICC STD&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 4 tasks (N = 4)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Extended priority level (&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_PRIORITY_EXTENDED&lt;/a&gt;&lt;/span&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Frequency 20 &lt;acronym title=&quot;Megahertz&quot;&gt;MHz&lt;/acronym&gt; (time of instruction cycle = 200 ns)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

The needed value for our compiler, priority mode and compiler is 123*N. The average time of switching between tasks (time from &lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/allservices/os_yield&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:allservices:os_yield&quot;&gt;OS_Yield&lt;/a&gt;&lt;/span&gt;() execution in one task to other task get the control) is:
&lt;/p&gt;

&lt;p&gt;
t = 123 * 4 * 200ns = 492 * 200ns = &lt;strong&gt;98.4 us&lt;/strong&gt;
&lt;/p&gt;

&lt;p&gt;

&lt;strong&gt;An example 2 of determination&lt;/strong&gt;
Source data:
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Microcontroller STM8S105C6&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Compiler Cosmic&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; 8 tasks (N = 8)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Normal priority level (&lt;span class=&quot;important&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/doku.php/en/osa/ref/appendix/configuration&quot; class=&quot;wikilink1&quot; title=&quot;en:osa:ref:appendix:configuration&quot;&gt;OS_PRIORITY_NORMAL&lt;/a&gt;&lt;/span&gt;)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; Frequency 16 &lt;acronym title=&quot;Megahertz&quot;&gt;MHz&lt;/acronym&gt; (time of instruction cycle = 62.5 ns)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

The needed value for our compiler, priority mode and compiler is 58*N. The average time of switching between tasks is:
&lt;/p&gt;

&lt;p&gt;
t = 58 * 8 * 62.5ns = 464 * 62.5ns = &lt;strong&gt; 29 us&lt;/strong&gt;
&lt;/p&gt;

&lt;/div&gt;
</description>
    </item>
    <item rdf:about="http://www.pic24.ru/doku.php/en/osa/ref/appendix/static_timers_old?rev=1225403023">
        <dc:format>text/html</dc:format>
        <dc:date>2008-10-31T00:43:43+03:00</dc:date>
        <title></title>
        <link>http://www.pic24.ru/doku.php/en/osa/ref/appendix/static_timers_old?rev=1225403023</link>
        <description>


&lt;h2&gt;&lt;a name=&quot;h0&quot; id=&quot;h0&quot;&gt;H0&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;H0&quot; [1-15] --&gt;
&lt;h3&gt;&lt;a name=&quot;h1&quot; id=&quot;h1&quot;&gt;H1&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;H1&quot; [16-28] --&gt;
&lt;h3&gt;&lt;a name=&quot;h2&quot; id=&quot;h2&quot;&gt;H2&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;H2&quot; [29-43] --&gt;
&lt;h3&gt;&lt;a name=&quot;h11&quot; id=&quot;h11&quot;&gt;H1&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;


&lt;dl&gt;
&lt;dt&gt;&lt;span class='term'&gt; &lt;code&gt;task_stack_size&lt;/code&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;размер стека задачи в машинных словах (количество элементов в массиве стека)&lt;/dd&gt;
&lt;dt&gt;&lt;span class='term'&gt; &lt;code&gt;param&lt;/code&gt;&lt;/span&gt;&lt;/dt&gt;
&lt;dd&gt;параметр передаваемый в функцию задачи&lt;/dd&gt;
&lt;/dl&gt;

&lt;div class=&quot;plugin_uparrow&quot;&gt;
  &lt;a href=&quot;#&quot; title=&quot;Наверх&quot;&gt;
    &lt;img src=&quot;http://www.pic24.ru/lib/plugins/uparrow/images/blue_arrow.png&quot; alt=&quot;Наверх&quot;/&gt;
  &lt;/a&gt;
&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;H1&quot; [44-322] --&gt;
&lt;h3&gt;&lt;a name=&quot;h21&quot; id=&quot;h21&quot;&gt;H2&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;

&lt;p&gt;&lt;div class=&quot;notewarning&quot;&gt;
qwer qwer qwer

&lt;/div&gt;&lt;/p&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;H2&quot; [323-376] --&gt;
&lt;h3&gt;&lt;a name=&quot;h3&quot; id=&quot;h3&quot;&gt;H3&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;pre class=&quot;cpp code cpp&quot; style=&quot;font-family:monospace;&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; main &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    OS_Init&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    OS_CreateTask&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;nu19&quot;&gt;0&lt;/span&gt;, Task1&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
    &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;;;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; OS_Sched&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;!-- SECTION &quot;H3&quot; [377-504] --&gt;
&lt;h3&gt;&lt;a name=&quot;h4&quot; id=&quot;h4&quot;&gt;H4&lt;/a&gt;&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;
&lt;hr /&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; aaa&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; bbb&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; ccc&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; caa&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; cbb&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; ddd&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; aaa&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; bbb&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; ccc&lt;/div&gt;
&lt;ul&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; caa&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level2&quot;&gt;&lt;div class=&quot;li&quot;&gt; cbb&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; ddd&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;table class=&quot;fpl&quot;&gt;
	&lt;tr&gt;
		&lt;td&gt;
&lt;strong&gt;a&lt;/strong&gt;		&lt;/td&gt;
		&lt;td&gt;
b		&lt;/td&gt;
		&lt;td&gt;
c		&lt;/td&gt;
	&lt;/tr&gt;
	&lt;tr&gt;
		&lt;td&gt;
aaa		&lt;/td&gt;
		&lt;td&gt;
&lt;strong&gt;bbb&lt;/strong&gt;		&lt;/td&gt;
		&lt;td&gt;
&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aappendix%3Astatic_timers_old&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;		&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0&quot;&gt;A&lt;/th&gt;&lt;th class=&quot;col1&quot;&gt;B&lt;/th&gt;&lt;th class=&quot;col2&quot;&gt;C&lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0&quot;&gt;aa&lt;/td&gt;&lt;td class=&quot;col1&quot; colspan=&quot;2&quot;&gt;bb&lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;
&lt;table class=&quot;inline&quot;&gt;
	&lt;tr class=&quot;row0&quot;&gt;
		&lt;th class=&quot;col0 centeralign&quot;&gt;  A  &lt;/th&gt;&lt;th class=&quot;col1 centeralign&quot;&gt;  B  &lt;/th&gt;&lt;th class=&quot;col2 centeralign&quot;&gt;  C  &lt;/th&gt;
	&lt;/tr&gt;
	&lt;tr class=&quot;row1&quot;&gt;
		&lt;td class=&quot;col0 leftalign&quot;&gt; aa  &lt;/td&gt;&lt;td class=&quot;col1 leftalign&quot;&gt; bb  &lt;/td&gt;&lt;td class=&quot;col2 leftalign&quot;&gt;&lt;a href=&quot;http://www.pic24.ru/lib/exe/detail.php/osa/ref/attr_call_not_int.png?id=en%3Aosa%3Aref%3Aappendix%3Astatic_timers_old&quot; class=&quot;media&quot; title=&quot;osa:ref:attr_call_not_int.png&quot;&gt;&lt;img src=&quot;http://www.pic24.ru/lib/exe/fetch.php/osa/ref/attr_call_not_int.png&quot; class=&quot;media&quot; title=&quot;Not allowed in interrupt&quot; alt=&quot;Not allowed in interrupt&quot; /&gt;&lt;/a&gt;  &lt;/td&gt;
	&lt;/tr&gt;
&lt;/table&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;H4&quot; [505-] --&gt;</description>
    </item>
</rdf:RDF>
