https://erika.tuxfamily.org/wiki/index.php?title=Special:Contributions/Salva&feed=atom&limit=50&target=Salva&year=&month=ErikaWiki - User contributions [en]2024-03-29T11:01:15ZFrom ErikaWikiMediaWiki 1.16.4https://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_Installing_scicoslab_and_generating_code_from_a_Scicos_diagramTutorial: Installing scicoslab and generating code from a Scicos diagram2012-02-01T13:50:16Z<p>Salva: /* Creating the Scicos example files */</p>
<hr />
<div>This is the Wiki page dedicated to the Scicos code generator originally developed by Roberto Bucher from SUPSI Lugano.<br />
<br />
The code of the code generator is distributed under GPL2. The project is currently lead by Roberto Bucher, from SUPSI Lugano, and is hosted on the Evidence web site.<br />
<br />
<br />
<br />
= Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX and EasyLab boards<br />
# Download and install Cygwin from the [http://www.cygwin.com/ Cygwin site]. Here is a [http://download.tuxfamily.org/erika/webdownload/eeCygwin_1_7_9.zip minimal installation pack]. Cygwin is required to compile the code generated from your Scicos diagram.<br />
# Download Microsoft Visual C++ 2008 from the [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download ScicosLab 4.4.1 from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. <br />
# Download Microchip MPLAB IDE from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board or EasyLab board. Then download a C30 compiler, for example from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC on the Flex board you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]. While for the EasyLab board the programmer is not required because it is equipped with one on board.<br />
# Download the latest Scicoslab pack from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab pack download page]. Unzip the pack and install it. To install the pack execute the installer.sce script file in ScicosLab (File -> Exec...). (If needed, run ScicosLab with administrator privileges). At the end of the installation restart ScicosLab for the changes to take effect.<br />
# Create and compile your first Scicos diagram (as shown here: [http://erika.tuxfamily.org/wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication An example of code-generation]), flash the microcontroller, test your application and ... enjoy! <br />
<br />
Please note, this version of the ScicosLab pack includes a stand-alone version of RT-Druid and a full version of Erika Enterprise.<br />
If you have any problem please contact us using the [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
<br />
<br />
= Your first Scicos application =<br />
<br />
This Chapter will guide you to the creation, compilation and execution<br />
of a first simple Scicos example on a FLEX Demo board (or EasyLab board). The example<br />
created in this tutorial can be found in the directory<br />
<tt>scicos_ee/examples/scicos_flex/Led_sin</tt><br />
<tt>(scicos_ee/examples/scicos_easylab/Led_sin)</tt>.<br />
<br />
inside scicos pack base directory.<br />
<br />
If you are looking for a pre-built example, go directly to the next Section.<br />
<br />
== Creating the Scicos example files ==<br />
<br />
(Note the screenshow may refer to old versions of ScicosLab or Scilab 4.1.2).<br />
<br />
# Please start ScicosLab from the Start menu. The ScicosLab window appears.<br />
# Type <tt>scicos();</tt> as showed below in the Figure, and press Enter.<br />
#: [[File:scilab_splash.png|center|thumb|200px|The Scilab splash screen. Type <tt>scicos();</tt> to start Scicos.]]<br />
# The Scicos windows appears, as showed in Figure<br />
#: [[File:scicos_splash.png|center|thumb|200px|The Scicos splash screen.]]<br />
# You need to compile the Scicos blocks, if you didn't do it yet, in order to get the system working. To do that type these commands in ScicosLab window:<br />
#:cd ("%SCICOSLAB_HOME%\contrib\dspic"); // (%SCICOSLAB_HOME% means the installation path of ScicosLab...)<br />
#:exec ("builder.sce");<br />
#::'''IMPORTANT NOTE''': please check the correctness of this path. Newer Scicos Packs are installed under <tt>...\scicoslab-4.4.1\contrib\scicos_ee\scicos_flex\dspic</tt> <tt>(...\scicoslab-4.4.1\contrib\scicos_ee\scicos_easylab\dspic)</tt><br />
# Select ''Palettes'' from the ''Palette'' menu, as showed in Figure<br />
#: [[File:palette_menu.png|center|thumb|200px|The Palettes.]]<br />
# A little list appear in place of the menu. Select ''FLEX'' (''Easylab''), as showed in Figure<br />
#: [[File:palette_menu2.png|center|thumb|200px|The Palette list.]]<br />
# A windows appears, with some sink blocks specific for the FLEX boards (EasyLab board)<br />
#: [[File:palette.png|center|thumb|200px|The dsPIC Palette.]]<br />
# Single click on the FLEX-LED (EASYLAB-LED) block. The window selection moves to the Scicos window. The mouse now becomes a white rectangle of the dimension of the LED block. Single click somewhere in the white part of the window. A LED block is dropped in the diagram, like in Figure<br />
#: [[File:led.png|center|thumb|200px|The LED block is dropped in the design window.]]<br />
#* '''Note''': If you need to move a block, go over it with the mouse, press ''m'', then move the block and click on the new position!<br />
#* '''Note''': If you need to delete a block or a line, go over it with the mouse, then press ''d''!<br />
#* '''Note''': If some garbage appears on the diagram windos, don't panic! Just press ''r''!<br />
# Open the MCHP16-Sources palette, and repeat the same with the Sine block, placing it on the left of the LED block, as in Figure <br />
#: [[File:sineled.png|center|thumb|200px|Place the Sine block to the left of the LED block.]]<br />
# Link the black triangle of the Sine block to the black triangle of the LED block. To do that, press ''l'', then single click on the triangle of the Sine block (the ''source''), then click again on the triangle of the LED block (the ''sink''). See Figure<br />
#: [[File:link.png|center|thumb|200px|Sine and LED are now linked.]]<br />
# From the MCHP16-Sources Palette, which can be found il the palette list, choose the red clock, and put it on the diagram as shown in Figure<br />
#: [[File:clock.png|center|thumb|200px|Put the Clock block over the Sine and LED blocks.]]<br />
# Now connect the clock signal to the two blocks. To do that, single click on the red triangle of the <tt>clock</tt> block, then single click below it, then single click over the <tt>Sine</tt> block, then click on the red triangle of the <tt>Sine</tt> block. After that, single click on the line below the <tt>clock</tt> block, hit the key 'L' of keyboard, then over the <tt>LED</tt> block, then on the red triangle of the <tt>LED</tt> block. The result is shown in Figure<br />
#: [[File:redlink.png|center|thumb|200px|The Clock block is connected to the Sine and LED blocks.]]<br />
# Single click on the Clock block. Its properties window appears. Leave them untouched, and press OK. You can do the same on the Sine block. The two Figures below show these windows.<br />
#: [[File:clockproperties.png|center|thumb|200px|The Clock block properties.]]<br />
#: [[File:sineproperties.png|center|thumb|200px|The Sine block properties.]]<br />
# The code generator can produce code which only comes from a special block named ''Super Block''. For this reason, we need to create a Super Block enclosing the <tt>Sine</tt> and the <tt>LED</tt> blocks. To do that, select the ''Region to Super Block'' menu item from the ''Diagram'' menu (see Figure below).<br />
#: [[File:region2sb.png|center|thumb|200px|The Region to Super Block menu item.]]<br />
# Then, draw a selection which includes the <tt>Sine</tt>, the <tt>LED</tt>, and the red lines in a way that only ''one'' red line exits the selection, as shown in Figure<br />
#: [[File:sb.png|center|thumb|200px|The selection made to create a Super Block.]]<br />
# As a result, a Super Block is created (see Figure)<br />
#: [[File:sb1.png|center|thumb|200px|The Super Block.]]<br />
#: Which contains the Sine and LED blocks. To see these blocks, just single click on the Super Block, and another window will appear (see Figure). <br />
#: [[File:sb2.png|center|thumb|200px|The contents of the Super Block.]]<br />
# Please note that this window is very similar to the previous one except that the clock object is substituted by a placeholder signed with the number 1.<br />
#* '''Note''': The Diagram containing the Super Block is disabled when the Super Block diagram is displayed. Only one window can be enabled at a time in Scicos. The limitation will be removed in the next version of Scicos.<br />
# It is now time to save the two diagrams. From the ''File'' menu, choose ''Save as''. Save the diagram containing the Super Block as <tt>led_sin.cos</tt>.<br />
<br />
== Generating dsPIC code from a Scicos Diagram ==<br />
<br />
It is now time to generate the code for the example we just created.<br />
<br />
'''Note''': A copy of the file created in the previous steps is included inside the <tt>scicos_examples/led_sin</tt> directory. To open it, double click on the <tt>scicos_examples/led_sin/led_sin.cos</tt> file.<br />
<br />
# Select ''Set Target'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen0.png|center|thumb|200px|The CodeGen menu - Set target.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen3.png|center|thumb|200px|The SetTarget dialog box.]]<br />
# You can specify the target board (board_flex or board_easylab) using the second textbox. Please leave the other options unchanged.<br />
# Select ''FlexCodeGen'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen1.png|center|thumb|200px|The CodeGen menu - Flex code generator.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen2.png|center|thumb|200px|The FlexCodeGen dialog box.]]<br />
# You can specify the block name by modifying the <tt>New block's name</tt> textbox and the directory where all the files will be created by modifying the <tt>Created files Path</tt> textbox. <br />
#* '''IMPORTANT NOTE FOR WINDOWS USERS''': Choose a location where you have write permission. If you start 'ScicosLab' with administrator privileges there are no limitations in the choice of the destination folder.<br />
# Press ''Ok''. As a result, a set of files are generated in the output directory.<br />
# Then, Scicos automatically opens a console window, running in it the following commands:<br />
#* the RT-Druid template generator to instantiate the Scicos template application;<br />
#* the RT-Druid standalone code generator to produce the ERIKA Enterprise configuration files from the generated OIL file;<br />
#* the ''make'' application to compile the code.<br />
# The result of the code generation process is depicted in Figure \ref{fig:console}. <br />
#: [[File:console.png|center|thumb|200px|The compilation console.]]<br />
# The executable file is named <tt>pic30.elf</tt> and it is located inside the <tt>Debug</tt> directory as usual for all the ERIKA Enterprise applications.<br />
# You can now program your application on your FLEX board. To do that, you need to open MPLABIDE as you usually do to program other ERIKA Enterprise applications. Please refer to the ERIKA Enterprise tutorial for dsPIC for more information.<br />
# Running the code on your FLEX board has the following behavior: the system led on the board flashes with a period of 20 seconds, and a duty cycle of around 6 seconds over 20. The explanation is the following: <br />
#* The system works like a synchronous control system, with a sampling frequency of 0.1 secs<br />
#* The ''Sine'' block output is a sinus with a frequency of 0.05, which correspond to a period of 20 s<br />
#* The LED block is directly linked to the system led, and is programmed to put on the system led when its input is greater than 0.5.<br />
#* Looking at the Figure below, it is clear that the sinus has a value greater than 0.5 for around a third of its period. Given that, the system led is on for around 6 seconds over 20.<br />
#: [[File:graphic.png|center|thumb|200px|A graphic of a Sine and of a constant value 0.5.]]<br />
<br />
= Internals of the genareted code =<br />
<br />
== Templates and customization of the generated application ==<br />
<br />
The default application wich is generated by the Scicos embedded code generator for dsPIC generates a basic application which uses ERIKA Enterprise with the FP kernel, a periodic task and an Alarm triggered by a timer interrupt to activate it.<br />
<br />
In general, it is likely that advanced users would like to customize the application which is generated by the code generator, to add other activities to be executed concurrently with the code generated from the Scicos design. Examples of this activities could be for example background activities for reporting, supervision, display, debug, and so on.<br />
<br />
Implementing such variations is very easy, because the application scheleton used by the code generator is contained inside a RT-Druid template. In particular, the default template is the <tt>pic30_empty_scicos</tt> template stored inside the <tt>examples/pic30/pic30_scicos</tt> directory under the dsPIC examples plugin in the Eclipse installation. The user can add a new template using the following steps:<br />
<br />
# Copy the <tt>examples/pic30/pic30_scicos</tt> directory in another location under the <tt>examples</tt> directory;<br />
# Change the <tt>ID</tt> of the template by modifying the <tt>template.xml</tt> file contained inside the directory. The <tt>ID</tt> is specified in the second line of the XML file as follows: <pre> <evidence_example version="1" ID="pic30_empty_scicos"></pre><br />
# Change the files included in the new template. If you need to add a new file, please remember to add it in the corresponding list in the <tt>template.xml</tt> file.<br />
<br />
Finally, specify the new template when generating the code in the Template textbox.<br />
<br />
== Assumptions of the default template ==<br />
The code generated by the Scilab/Scicos code generator for FLEX uses the template named <tt>pic30_empty_scicos</tt>, and has the following symplifing assumptions:<br />
<br />
# There is a single sampling time T_s in the system;<br />
# T_s is forced to 1 ms;<br />
# Every sampling time specified by the user under the Scicos design will be rounded to a multiple of a millisecond;<br />
# An ERIKA Enterprise counter is linked to the a periodic timer;<br />
# The periodic timer used in the dsPIC hardware is set to raise an interrupt every 1 ms;<br />
# An ERIKA Enterprise alarm is attached to the counter, to periodically activate a task;<br />
# The task body just calls the routines generated by the Scicos code generator. Which executes the functions you specified in the design;<br />
# The PWM object has a fixed period of 1 ms. This means that if the sampling period is a multiple of T_s, then the PWM will repeat the same duty cycle until the PWN value is changed;<br />
# The A/D converter always works ''on demand'', meaning it always executes the following steps:<br />
#* selects a channel;<br />
#* starts the conversion;<br />
#* waits for the end of the conversion (typically max 10 usec)<br />
#* it converts the result in a value from 0.0 V and 3.3 V</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_Installing_scicoslab_and_generating_code_from_a_Scicos_diagramTutorial: Installing scicoslab and generating code from a Scicos diagram2012-02-01T10:45:21Z<p>Salva: /* Your first Scicos application */</p>
<hr />
<div>This is the Wiki page dedicated to the Scicos code generator originally developed by Roberto Bucher from SUPSI Lugano.<br />
<br />
The code of the code generator is distributed under GPL2. The project is currently lead by Roberto Bucher, from SUPSI Lugano, and is hosted on the Evidence web site.<br />
<br />
<br />
<br />
= Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX and EasyLab boards<br />
# Download and install Cygwin from the [http://www.cygwin.com/ Cygwin site]. Here is a [http://download.tuxfamily.org/erika/webdownload/eeCygwin_1_7_9.zip minimal installation pack]. Cygwin is required to compile the code generated from your Scicos diagram.<br />
# Download Microsoft Visual C++ 2008 from the [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download ScicosLab 4.4.1 from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. <br />
# Download Microchip MPLAB IDE from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board or EasyLab board. Then download a C30 compiler, for example from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC on the Flex board you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]. While for the EasyLab board the programmer is not required because it is equipped with one on board.<br />
# Download the latest Scicoslab pack from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab pack download page]. Unzip the pack and install it. To install the pack execute the installer.sce script file in ScicosLab (File -> Exec...). (If needed, run ScicosLab with administrator privileges). At the end of the installation restart ScicosLab for the changes to take effect.<br />
# Create and compile your first Scicos diagram (as shown here: [http://erika.tuxfamily.org/wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication An example of code-generation]), flash the microcontroller, test your application and ... enjoy! <br />
<br />
Please note, this version of the ScicosLab pack includes a stand-alone version of RT-Druid and a full version of Erika Enterprise.<br />
If you have any problem please contact us using the [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
<br />
<br />
= Your first Scicos application =<br />
<br />
This Chapter will guide you to the creation, compilation and execution<br />
of a first simple Scicos example on a FLEX Demo board (or EasyLab board). The example<br />
created in this tutorial can be found in the directory<br />
<tt>scicos_ee/examples/scicos_flex/Led_sin</tt><br />
<tt>(scicos_ee/examples/scicos_easylab/Led_sin)</tt>.<br />
<br />
inside scicos pack base directory.<br />
<br />
If you are looking for a pre-built example, go directly to the next Section.<br />
<br />
== Creating the Scicos example files ==<br />
<br />
(Note the screenshow may refer to old versions of ScicosLab or Scilab 4.1.2).<br />
<br />
# Please start ScicosLab from the Start menu. The ScicosLab window appears.<br />
# Type <tt>scicos();</tt> as showed below in the Figure, and press Enter.<br />
#: [[File:scilab_splash.png|center|thumb|200px|The Scilab splash screen. Type <tt>scicos();</tt> to start Scicos.]]<br />
# The Scicos windows appears, as showed in Figure<br />
#: [[File:scicos_splash.png|center|thumb|200px|The Scicos splash screen.]]<br />
# You need to compile the Scicos blocks, if you didn't do it yet, in order to get the system working. To do that type these commands in ScicosLab window:<br />
#:cd ("%SCICOSLAB_HOME%\contrib\dspic"); // (%SCICOSLAB_HOME% means the installation path of ScicosLab...)<br />
#:exec ("builder.sce");<br />
#::'''IMPORTANT NOTE''': please check the correctness of this path. Newer Scicos Packs are installed under <tt>...\scicoslab-4.4.1\contrib\scicos_ee\scicos_flex\dspic</tt> <tt>(...\scicoslab-4.4.1\contrib\scicos_ee\scicos_easylab\dspic)</tt><br />
# Select ''Palettes'' from the ''Palette'' menu, as showed in Figure<br />
#: [[File:palette_menu.png|center|thumb|200px|The Palettes.]]<br />
# A little list appear in place of the menu. Select ''FLEX'', as showed in Figure<br />
#: [[File:palette_menu2.png|center|thumb|200px|The Palette list.]]<br />
# A windows appears, with some sink blocks specific for the FLEX boards<br />
#: [[File:palette.png|center|thumb|200px|The dsPIC Palette.]]<br />
# Single click on the FLEX-LED block. The window selection moves to the Scicos window. The mouse now becomes a white rectangle of the dimension of the LED block. Single click somewhere in the white part of the window. A LED block is dropped in the diagram, like in Figure<br />
#: [[File:led.png|center|thumb|200px|The LED block is dropped in the design window.]]<br />
#* '''Note''': If you need to move a block, go over it with the mouse, press ''m'', then move the block and click on the new position!<br />
#* '''Note''': If you need to delete a block or a line, go over it with the mouse, then press ''d''!<br />
#* '''Note''': If some garbage appears on the diagram windos, don't panic! Just press ''r''!<br />
# Open the MCHP16-Sources palette, and repeat the same with the Sine block, placing it on the left of the LED block, as in Figure <br />
#: [[File:sineled.png|center|thumb|200px|Place the Sine block to the left of the LED block.]]<br />
# Link the black triangle of the Sine block to the black triangle of the LED block. To do that, press ''l'', then single click on the triangle of the Sine block (the ''source''), then click again on the triangle of the LED block (the ''sink''). See Figure<br />
#: [[File:link.png|center|thumb|200px|Sine and LED are now linked.]]<br />
# From the MCHP16-Sources Palette, which can be found il the palette list, choose the red clock, and put it on the diagram as shown in Figure<br />
#: [[File:clock.png|center|thumb|200px|Put the Clock block over the Sine and LED blocks.]]<br />
# Now connect the clock signal to the two blocks. To do that, single click on the red triangle of the <tt>clock</tt> block, then single click below it, then single click over the <tt>Sine</tt> block, then click on the red triangle of the <tt>Sine</tt> block. After that, single click on the line below the <tt>clock</tt> block, hit the key 'L' of keyboard, then over the <tt>LED</tt> block, then on the red triangle of the <tt>LED</tt> block. The result is shown in Figure<br />
#: [[File:redlink.png|center|thumb|200px|The Clock block is connected to the Sine and LED blocks.]]<br />
# Single click on the Clock block. Its properties window appears. Leave them untouched, and press OK. You can do the same on the Sine block. The two Figures below show these windows.<br />
#: [[File:clockproperties.png|center|thumb|200px|The Clock block properties.]]<br />
#: [[File:sineproperties.png|center|thumb|200px|The Sine block properties.]]<br />
# The code generator can produce code which only comes from a special block named ''Super Block''. For this reason, we need to create a Super Block enclosing the <tt>Sine</tt> and the <tt>LED</tt> blocks. To do that, select the ''Region to Super Block'' menu item from the ''Diagram'' menu (see Figure below).<br />
#: [[File:region2sb.png|center|thumb|200px|The Region to Super Block menu item.]]<br />
# Then, draw a selection which includes the <tt>Sine</tt>, the <tt>LED</tt>, and the red lines in a way that only ''one'' red line exits the selection, as shown in Figure<br />
#: [[File:sb.png|center|thumb|200px|The selection made to create a Super Block.]]<br />
# As a result, a Super Block is created (see Figure)<br />
#: [[File:sb1.png|center|thumb|200px|The Super Block.]]<br />
#: Which contains the Sine and LED blocks. To see these blocks, just single click on the Super Block, and another window will appear (see Figure). <br />
#: [[File:sb2.png|center|thumb|200px|The contents of the Super Block.]]<br />
# Please note that this window is very similar to the previous one except that the clock object is substituted by a placeholder signed with the number 1.<br />
#* '''Note''': The Diagram containing the Super Block is disabled when the Super Block diagram is displayed. Only one window can be enabled at a time in Scicos. The limitation will be removed in the next version of Scicos.<br />
# It is now time to save the two diagrams. From the ''File'' menu, choose ''Save as''. Save the diagram containing the Super Block as <tt>led_sin.cos</tt>.<br />
<br />
== Generating dsPIC code from a Scicos Diagram ==<br />
<br />
It is now time to generate the code for the example we just created.<br />
<br />
'''Note''': A copy of the file created in the previous steps is included inside the <tt>scicos_examples/led_sin</tt> directory. To open it, double click on the <tt>scicos_examples/led_sin/led_sin.cos</tt> file.<br />
<br />
# Select ''Set Target'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen0.png|center|thumb|200px|The CodeGen menu - Set target.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen3.png|center|thumb|200px|The SetTarget dialog box.]]<br />
# You can specify the target board (board_flex or board_easylab) using the second textbox. Please leave the other options unchanged.<br />
# Select ''FlexCodeGen'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen1.png|center|thumb|200px|The CodeGen menu - Flex code generator.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen2.png|center|thumb|200px|The FlexCodeGen dialog box.]]<br />
# You can specify the block name by modifying the <tt>New block's name</tt> textbox and the directory where all the files will be created by modifying the <tt>Created files Path</tt> textbox. <br />
#* '''IMPORTANT NOTE FOR WINDOWS USERS''': Choose a location where you have write permission. If you start 'ScicosLab' with administrator privileges there are no limitations in the choice of the destination folder.<br />
# Press ''Ok''. As a result, a set of files are generated in the output directory.<br />
# Then, Scicos automatically opens a console window, running in it the following commands:<br />
#* the RT-Druid template generator to instantiate the Scicos template application;<br />
#* the RT-Druid standalone code generator to produce the ERIKA Enterprise configuration files from the generated OIL file;<br />
#* the ''make'' application to compile the code.<br />
# The result of the code generation process is depicted in Figure \ref{fig:console}. <br />
#: [[File:console.png|center|thumb|200px|The compilation console.]]<br />
# The executable file is named <tt>pic30.elf</tt> and it is located inside the <tt>Debug</tt> directory as usual for all the ERIKA Enterprise applications.<br />
# You can now program your application on your FLEX board. To do that, you need to open MPLABIDE as you usually do to program other ERIKA Enterprise applications. Please refer to the ERIKA Enterprise tutorial for dsPIC for more information.<br />
# Running the code on your FLEX board has the following behavior: the system led on the board flashes with a period of 20 seconds, and a duty cycle of around 6 seconds over 20. The explanation is the following: <br />
#* The system works like a synchronous control system, with a sampling frequency of 0.1 secs<br />
#* The ''Sine'' block output is a sinus with a frequency of 0.05, which correspond to a period of 20 s<br />
#* The LED block is directly linked to the system led, and is programmed to put on the system led when its input is greater than 0.5.<br />
#* Looking at the Figure below, it is clear that the sinus has a value greater than 0.5 for around a third of its period. Given that, the system led is on for around 6 seconds over 20.<br />
#: [[File:graphic.png|center|thumb|200px|A graphic of a Sine and of a constant value 0.5.]]<br />
<br />
= Internals of the genareted code =<br />
<br />
== Templates and customization of the generated application ==<br />
<br />
The default application wich is generated by the Scicos embedded code generator for dsPIC generates a basic application which uses ERIKA Enterprise with the FP kernel, a periodic task and an Alarm triggered by a timer interrupt to activate it.<br />
<br />
In general, it is likely that advanced users would like to customize the application which is generated by the code generator, to add other activities to be executed concurrently with the code generated from the Scicos design. Examples of this activities could be for example background activities for reporting, supervision, display, debug, and so on.<br />
<br />
Implementing such variations is very easy, because the application scheleton used by the code generator is contained inside a RT-Druid template. In particular, the default template is the <tt>pic30_empty_scicos</tt> template stored inside the <tt>examples/pic30/pic30_scicos</tt> directory under the dsPIC examples plugin in the Eclipse installation. The user can add a new template using the following steps:<br />
<br />
# Copy the <tt>examples/pic30/pic30_scicos</tt> directory in another location under the <tt>examples</tt> directory;<br />
# Change the <tt>ID</tt> of the template by modifying the <tt>template.xml</tt> file contained inside the directory. The <tt>ID</tt> is specified in the second line of the XML file as follows: <pre> <evidence_example version="1" ID="pic30_empty_scicos"></pre><br />
# Change the files included in the new template. If you need to add a new file, please remember to add it in the corresponding list in the <tt>template.xml</tt> file.<br />
<br />
Finally, specify the new template when generating the code in the Template textbox.<br />
<br />
== Assumptions of the default template ==<br />
The code generated by the Scilab/Scicos code generator for FLEX uses the template named <tt>pic30_empty_scicos</tt>, and has the following symplifing assumptions:<br />
<br />
# There is a single sampling time T_s in the system;<br />
# T_s is forced to 1 ms;<br />
# Every sampling time specified by the user under the Scicos design will be rounded to a multiple of a millisecond;<br />
# An ERIKA Enterprise counter is linked to the a periodic timer;<br />
# The periodic timer used in the dsPIC hardware is set to raise an interrupt every 1 ms;<br />
# An ERIKA Enterprise alarm is attached to the counter, to periodically activate a task;<br />
# The task body just calls the routines generated by the Scicos code generator. Which executes the functions you specified in the design;<br />
# The PWM object has a fixed period of 1 ms. This means that if the sampling period is a multiple of T_s, then the PWM will repeat the same duty cycle until the PWN value is changed;<br />
# The A/D converter always works ''on demand'', meaning it always executes the following steps:<br />
#* selects a channel;<br />
#* starts the conversion;<br />
#* waits for the end of the conversion (typically max 10 usec)<br />
#* it converts the result in a value from 0.0 V and 3.3 V</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_Installing_scicoslab_and_generating_code_from_a_Scicos_diagramTutorial: Installing scicoslab and generating code from a Scicos diagram2012-02-01T10:41:16Z<p>Salva: </p>
<hr />
<div>This is the Wiki page dedicated to the Scicos code generator originally developed by Roberto Bucher from SUPSI Lugano.<br />
<br />
The code of the code generator is distributed under GPL2. The project is currently lead by Roberto Bucher, from SUPSI Lugano, and is hosted on the Evidence web site.<br />
<br />
<br />
<br />
= Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX and EasyLab boards<br />
# Download and install Cygwin from the [http://www.cygwin.com/ Cygwin site]. Here is a [http://download.tuxfamily.org/erika/webdownload/eeCygwin_1_7_9.zip minimal installation pack]. Cygwin is required to compile the code generated from your Scicos diagram.<br />
# Download Microsoft Visual C++ 2008 from the [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download ScicosLab 4.4.1 from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. <br />
# Download Microchip MPLAB IDE from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board or EasyLab board. Then download a C30 compiler, for example from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC on the Flex board you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]. While for the EasyLab board the programmer is not required because it is equipped with one on board.<br />
# Download the latest Scicoslab pack from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab pack download page]. Unzip the pack and install it. To install the pack execute the installer.sce script file in ScicosLab (File -> Exec...). (If needed, run ScicosLab with administrator privileges). At the end of the installation restart ScicosLab for the changes to take effect.<br />
# Create and compile your first Scicos diagram (as shown here: [http://erika.tuxfamily.org/wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication An example of code-generation]), flash the microcontroller, test your application and ... enjoy! <br />
<br />
Please note, this version of the ScicosLab pack includes a stand-alone version of RT-Druid and a full version of Erika Enterprise.<br />
If you have any problem please contact us using the [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
<br />
<br />
= Your first Scicos application =<br />
<br />
This Chapter will guide you to the creation, compilation and execution<br />
of a first simple Scicos example on a FLEX Demo board (or EasyLab board). The example<br />
created in this tutorial can be found in the directory<br />
<tt>scicos_ee/examples/scicos_flex/Led_sin</tt>.<br />
<tt>(scicos_ee/examples/scicos_easylab/Led_sin)</tt>.<br />
<br />
inside scicos pack base directory.<br />
<br />
If you are looking for a prebuilt example, go directly to the next Section.<br />
<br />
== Creating the Scicos example files ==<br />
<br />
(Note the screenshow may refer to old versions of ScicosLab or Scilab 4.1.2).<br />
<br />
# Please start ScicosLab from the Start menu. The ScicosLab window appears.<br />
# Type <tt>scicos();</tt> as showed below in the Figure, and press Enter.<br />
#: [[File:scilab_splash.png|center|thumb|200px|The Scilab splash screen. Type <tt>scicos();</tt> to start Scicos.]]<br />
# The Scicos windows appears, as showed in Figure<br />
#: [[File:scicos_splash.png|center|thumb|200px|The Scicos splash screen.]]<br />
# You need to compile the Scicos blocks, if you didn't do it yet, in order to get the system working. To do that type these commands in ScicosLab window:<br />
#:cd ("%SCICOSLAB_HOME%\contrib\dspic"); // (%SCICOSLAB_HOME% means the installation path of ScicosLab...)<br />
#:exec ("builder.sce");<br />
#::'''IMPORTANT NOTE''': please check the correctness of this path. Newer Scicos Packs are installed under <tt>...\scicoslab-4.4.1\contrib\scicos_ee\scicos_flex\dspic</tt><br />
# Select ''Palettes'' from the ''Palette'' menu, as showed in Figure<br />
#: [[File:palette_menu.png|center|thumb|200px|The Palettes.]]<br />
# A little list appear in place of the menu. Select ''FLEX'', as showed in Figure<br />
#: [[File:palette_menu2.png|center|thumb|200px|The Palette list.]]<br />
# A windows appears, with some sink blocks specific for the FLEX boards<br />
#: [[File:palette.png|center|thumb|200px|The dsPIC Palette.]]<br />
# Single click on the FLEX-LED block. The window selection moves to the Scicos window. The mouse now becomes a white rectangle of the dimension of the LED block. Single click somewhere in the white part of the window. A LED block is dropped in the diagram, like in Figure<br />
#: [[File:led.png|center|thumb|200px|The LED block is dropped in the design window.]]<br />
#* '''Note''': If you need to move a block, go over it with the mouse, press ''m'', then move the block and click on the new position!<br />
#* '''Note''': If you need to delete a block or a line, go over it with the mouse, then press ''d''!<br />
#* '''Note''': If some garbage appears on the diagram windos, don't panic! Just press ''r''!<br />
# Open the MCHP16-Sources palette, and repeat the same with the Sine block, placing it on the left of the LED block, as in Figure <br />
#: [[File:sineled.png|center|thumb|200px|Place the Sine block to the left of the LED block.]]<br />
# Link the black triangle of the Sine block to the black triangle of the LED block. To do that, press ''l'', then single click on the triangle of the Sine block (the ''source''), then click again on the triangle of the LED block (the ''sink''). See Figure<br />
#: [[File:link.png|center|thumb|200px|Sine and LED are now linked.]]<br />
# From the MCHP16-Sources Palette, which can be found il the palette list, choose the red clock, and put it on the diagram as shown in Figure<br />
#: [[File:clock.png|center|thumb|200px|Put the Clock block over the Sine and LED blocks.]]<br />
# Now connect the clock signal to the two blocks. To do that, single click on the red triangle of the <tt>clock</tt> block, then single click below it, then single click over the <tt>Sine</tt> block, then click on the red triangle of the <tt>Sine</tt> block. After that, single click on the line below the <tt>clock</tt> block, hit the key 'L' of keyboard, then over the <tt>LED</tt> block, then on the red triangle of the <tt>LED</tt> block. The result is shown in Figure<br />
#: [[File:redlink.png|center|thumb|200px|The Clock block is connected to the Sine and LED blocks.]]<br />
# Single click on the Clock block. Its properties window appears. Leave them untouched, and press OK. You can do the same on the Sine block. The two Figures below show these windows.<br />
#: [[File:clockproperties.png|center|thumb|200px|The Clock block properties.]]<br />
#: [[File:sineproperties.png|center|thumb|200px|The Sine block properties.]]<br />
# The code generator can produce code which only comes from a special block named ''Super Block''. For this reason, we need to create a Super Block enclosing the <tt>Sine</tt> and the <tt>LED</tt> blocks. To do that, select the ''Region to Super Block'' menu item from the ''Diagram'' menu (see Figure below).<br />
#: [[File:region2sb.png|center|thumb|200px|The Region to Super Block menu item.]]<br />
# Then, draw a selection which includes the <tt>Sine</tt>, the <tt>LED</tt>, and the red lines in a way that only ''one'' red line exits the selection, as shown in Figure<br />
#: [[File:sb.png|center|thumb|200px|The selection made to create a Super Block.]]<br />
# As a result, a Super Block is created (see Figure)<br />
#: [[File:sb1.png|center|thumb|200px|The Super Block.]]<br />
#: Which contains the Sine and LED blocks. To see these blocks, just single click on the Super Block, and another window will appear (see Figure). <br />
#: [[File:sb2.png|center|thumb|200px|The contents of the Super Block.]]<br />
# Please note that this window is very similar to the previous one except that the clock object is substituted by a placeholder signed with the number 1.<br />
#* '''Note''': The Diagram containing the Super Block is disabled when the Super Block diagram is displayed. Only one window can be enabled at a time in Scicos. The limitation will be removed in the next version of Scicos.<br />
# It is now time to save the two diagrams. From the ''File'' menu, choose ''Save as''. Save the diagram containing the Super Block as <tt>led_sin.cos</tt>.<br />
<br />
== Generating dsPIC code from a Scicos Diagram ==<br />
<br />
It is now time to generate the code for the example we just created.<br />
<br />
'''Note''': A copy of the file created in the previous steps is included inside the <tt>scicos_examples/led_sin</tt> directory. To open it, double click on the <tt>scicos_examples/led_sin/led_sin.cos</tt> file.<br />
<br />
# Select ''Set Target'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen0.png|center|thumb|200px|The CodeGen menu - Set target.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen3.png|center|thumb|200px|The SetTarget dialog box.]]<br />
# You can specify the target board (board_flex or board_easylab) using the second textbox. Please leave the other options unchanged.<br />
# Select ''FlexCodeGen'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen1.png|center|thumb|200px|The CodeGen menu - Flex code generator.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen2.png|center|thumb|200px|The FlexCodeGen dialog box.]]<br />
# You can specify the block name by modifying the <tt>New block's name</tt> textbox and the directory where all the files will be created by modifying the <tt>Created files Path</tt> textbox. <br />
#* '''IMPORTANT NOTE FOR WINDOWS USERS''': Choose a location where you have write permission. If you start 'ScicosLab' with administrator privileges there are no limitations in the choice of the destination folder.<br />
# Press ''Ok''. As a result, a set of files are generated in the output directory.<br />
# Then, Scicos automatically opens a console window, running in it the following commands:<br />
#* the RT-Druid template generator to instantiate the Scicos template application;<br />
#* the RT-Druid standalone code generator to produce the ERIKA Enterprise configuration files from the generated OIL file;<br />
#* the ''make'' application to compile the code.<br />
# The result of the code generation process is depicted in Figure \ref{fig:console}. <br />
#: [[File:console.png|center|thumb|200px|The compilation console.]]<br />
# The executable file is named <tt>pic30.elf</tt> and it is located inside the <tt>Debug</tt> directory as usual for all the ERIKA Enterprise applications.<br />
# You can now program your application on your FLEX board. To do that, you need to open MPLABIDE as you usually do to program other ERIKA Enterprise applications. Please refer to the ERIKA Enterprise tutorial for dsPIC for more information.<br />
# Running the code on your FLEX board has the following behavior: the system led on the board flashes with a period of 20 seconds, and a duty cycle of around 6 seconds over 20. The explanation is the following: <br />
#* The system works like a synchronous control system, with a sampling frequency of 0.1 secs<br />
#* The ''Sine'' block output is a sinus with a frequency of 0.05, which correspond to a period of 20 s<br />
#* The LED block is directly linked to the system led, and is programmed to put on the system led when its input is greater than 0.5.<br />
#* Looking at the Figure below, it is clear that the sinus has a value greater than 0.5 for around a third of its period. Given that, the system led is on for around 6 seconds over 20.<br />
#: [[File:graphic.png|center|thumb|200px|A graphic of a Sine and of a constant value 0.5.]]<br />
<br />
= Internals of the genareted code =<br />
<br />
== Templates and customization of the generated application ==<br />
<br />
The default application wich is generated by the Scicos embedded code generator for dsPIC generates a basic application which uses ERIKA Enterprise with the FP kernel, a periodic task and an Alarm triggered by a timer interrupt to activate it.<br />
<br />
In general, it is likely that advanced users would like to customize the application which is generated by the code generator, to add other activities to be executed concurrently with the code generated from the Scicos design. Examples of this activities could be for example background activities for reporting, supervision, display, debug, and so on.<br />
<br />
Implementing such variations is very easy, because the application scheleton used by the code generator is contained inside a RT-Druid template. In particular, the default template is the <tt>pic30_empty_scicos</tt> template stored inside the <tt>examples/pic30/pic30_scicos</tt> directory under the dsPIC examples plugin in the Eclipse installation. The user can add a new template using the following steps:<br />
<br />
# Copy the <tt>examples/pic30/pic30_scicos</tt> directory in another location under the <tt>examples</tt> directory;<br />
# Change the <tt>ID</tt> of the template by modifying the <tt>template.xml</tt> file contained inside the directory. The <tt>ID</tt> is specified in the second line of the XML file as follows: <pre> <evidence_example version="1" ID="pic30_empty_scicos"></pre><br />
# Change the files included in the new template. If you need to add a new file, please remember to add it in the corresponding list in the <tt>template.xml</tt> file.<br />
<br />
Finally, specify the new template when generating the code in the Template textbox.<br />
<br />
== Assumptions of the default template ==<br />
The code generated by the Scilab/Scicos code generator for FLEX uses the template named <tt>pic30_empty_scicos</tt>, and has the following symplifing assumptions:<br />
<br />
# There is a single sampling time T_s in the system;<br />
# T_s is forced to 1 ms;<br />
# Every sampling time specified by the user under the Scicos design will be rounded to a multiple of a millisecond;<br />
# An ERIKA Enterprise counter is linked to the a periodic timer;<br />
# The periodic timer used in the dsPIC hardware is set to raise an interrupt every 1 ms;<br />
# An ERIKA Enterprise alarm is attached to the counter, to periodically activate a task;<br />
# The task body just calls the routines generated by the Scicos code generator. Which executes the functions you specified in the design;<br />
# The PWM object has a fixed period of 1 ms. This means that if the sampling period is a multiple of T_s, then the PWM will repeat the same duty cycle until the PWN value is changed;<br />
# The A/D converter always works ''on demand'', meaning it always executes the following steps:<br />
#* selects a channel;<br />
#* starts the conversion;<br />
#* waits for the end of the conversion (typically max 10 usec)<br />
#* it converts the result in a value from 0.0 V and 3.3 V</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_Installing_scicoslab_and_generating_code_from_a_Scicos_diagramTutorial: Installing scicoslab and generating code from a Scicos diagram2012-02-01T10:20:38Z<p>Salva: </p>
<hr />
<div>This is the Wiki page dedicated to the Scicos code generator originally developed by Roberto Bucher from SUPSI Lugano.<br />
<br />
The code of the code generator is distributed under GPL2. The project is currently lead by Roberto Bucher, from SUPSI Lugano, and is hosted on the Evidence web site.<br />
<br />
= Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX and EasyLab boards<br />
# Download and install Cygwin from the [http://www.cygwin.com/ Cygwin site]. Here is a [http://download.tuxfamily.org/erika/webdownload/eeCygwin_1_7_9.zip minimal installation pack]. Cygwin is required to compile the code generated from your Scicos diagram.<br />
# Download Microsoft Visual C++ 2008 from the [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download ScicosLab 4.4.1 from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. <br />
# Download Microchip MPLAB IDE from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board or EasyLab board. Then download a C30 compiler, for example from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC on the Flex board you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]. While for the EasyLab board the programmer is not required because it is equipped with one on board.<br />
# Download the latest Scicoslab pack from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab pack download page]. Unzip the pack and install it. To install the pack execute the installer.sce script file in ScicosLab (File -> Exec...). (If needed, run ScicosLab with administrator privileges). At the end of the installation restart ScicosLab for the changes to take effect.<br />
# Create and compile your first Scicos diagram (as shown here: [http://erika.tuxfamily.org/wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication An example of code-generation]), flash the microcontroller, test your application and ... enjoy! <br />
<br />
Please note, this version of the ScicosLab pack includes a stand-alone version of RT-Druid and a full version of Erika Enterprise.<br />
If you have any problem please contact us using the [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
<br />
= Your first Scicos application =<br />
<br />
This Chapter will guide you to the creation, compilation and execution<br />
of a first simple Scicos example on a FLEX Demo board. The example<br />
created in this tutorial can be found in the directory<br />
<tt>scicos_ee/examples/scicos_flex/Led_sin</tt>.<br />
inside scicos pack base directory.<br />
<br />
If you are looking for a prebuilt example, go directly to the next Section.<br />
<br />
== Creating the Scicos example files ==<br />
<br />
(Note the screenshow may refer to old versions of ScicosLab or Scilab 4.1.2).<br />
<br />
# Please start ScicosLab from the Start menu. The ScicosLab window appears.<br />
# Type <tt>scicos();</tt> as showed below in the Figure, and press Enter.<br />
#: [[File:scilab_splash.png|center|thumb|200px|The Scilab splash screen. Type <tt>scicos();</tt> to start Scicos.]]<br />
# The Scicos windows appears, as showed in Figure<br />
#: [[File:scicos_splash.png|center|thumb|200px|The Scicos splash screen.]]<br />
# You need to compile the Scicos blocks, if you didn't do it yet, in order to get the system working. To do that type these commands in ScicosLab window:<br />
#:cd ("%SCICOSLAB_HOME%\contrib\dspic"); // (%SCICOSLAB_HOME% means the installation path of ScicosLab...)<br />
#:exec ("builder.sce");<br />
#::'''IMPORTANT NOTE''': please check the correctness of this path. Newer Scicos Packs are installed under <tt>...\scicoslab-4.4.1\contrib\scicos_ee\scicos_flex\dspic</tt><br />
# Select ''Palettes'' from the ''Palette'' menu, as showed in Figure<br />
#: [[File:palette_menu.png|center|thumb|200px|The Palettes.]]<br />
# A little list appear in place of the menu. Select ''FLEX'', as showed in Figure<br />
#: [[File:palette_menu2.png|center|thumb|200px|The Palette list.]]<br />
# A windows appears, with some sink blocks specific for the FLEX boards<br />
#: [[File:palette.png|center|thumb|200px|The dsPIC Palette.]]<br />
# Single click on the FLEX-LED block. The window selection moves to the Scicos window. The mouse now becomes a white rectangle of the dimension of the LED block. Single click somewhere in the white part of the window. A LED block is dropped in the diagram, like in Figure<br />
#: [[File:led.png|center|thumb|200px|The LED block is dropped in the design window.]]<br />
#* '''Note''': If you need to move a block, go over it with the mouse, press ''m'', then move the block and click on the new position!<br />
#* '''Note''': If you need to delete a block or a line, go over it with the mouse, then press ''d''!<br />
#* '''Note''': If some garbage appears on the diagram windos, don't panic! Just press ''r''!<br />
# Open the MCHP16-Sources palette, and repeat the same with the Sine block, placing it on the left of the LED block, as in Figure <br />
#: [[File:sineled.png|center|thumb|200px|Place the Sine block to the left of the LED block.]]<br />
# Link the black triangle of the Sine block to the black triangle of the LED block. To do that, press ''l'', then single click on the triangle of the Sine block (the ''source''), then click again on the triangle of the LED block (the ''sink''). See Figure<br />
#: [[File:link.png|center|thumb|200px|Sine and LED are now linked.]]<br />
# From the MCHP16-Sources Palette, which can be found il the palette list, choose the red clock, and put it on the diagram as shown in Figure<br />
#: [[File:clock.png|center|thumb|200px|Put the Clock block over the Sine and LED blocks.]]<br />
# Now connect the clock signal to the two blocks. To do that, single click on the red triangle of the <tt>clock</tt> block, then single click below it, then single click over the <tt>Sine</tt> block, then click on the red triangle of the <tt>Sine</tt> block. After that, single click on the line below the <tt>clock</tt> block, hit the key 'L' of keyboard, then over the <tt>LED</tt> block, then on the red triangle of the <tt>LED</tt> block. The result is shown in Figure<br />
#: [[File:redlink.png|center|thumb|200px|The Clock block is connected to the Sine and LED blocks.]]<br />
# Single click on the Clock block. Its properties window appears. Leave them untouched, and press OK. You can do the same on the Sine block. The two Figures below show these windows.<br />
#: [[File:clockproperties.png|center|thumb|200px|The Clock block properties.]]<br />
#: [[File:sineproperties.png|center|thumb|200px|The Sine block properties.]]<br />
# The code generator can produce code which only comes from a special block named ''Super Block''. For this reason, we need to create a Super Block enclosing the <tt>Sine</tt> and the <tt>LED</tt> blocks. To do that, select the ''Region to Super Block'' menu item from the ''Diagram'' menu (see Figure below).<br />
#: [[File:region2sb.png|center|thumb|200px|The Region to Super Block menu item.]]<br />
# Then, draw a selection which includes the <tt>Sine</tt>, the <tt>LED</tt>, and the red lines in a way that only ''one'' red line exits the selection, as shown in Figure<br />
#: [[File:sb.png|center|thumb|200px|The selection made to create a Super Block.]]<br />
# As a result, a Super Block is created (see Figure)<br />
#: [[File:sb1.png|center|thumb|200px|The Super Block.]]<br />
#: Which contains the Sine and LED blocks. To see these blocks, just single click on the Super Block, and another window will appear (see Figure). <br />
#: [[File:sb2.png|center|thumb|200px|The contents of the Super Block.]]<br />
# Please note that this window is very similar to the previous one except that the clock object is substituted by a placeholder signed with the number 1.<br />
#* '''Note''': The Diagram containing the Super Block is disabled when the Super Block diagram is displayed. Only one window can be enabled at a time in Scicos. The limitation will be removed in the next version of Scicos.<br />
# It is now time to save the two diagrams. From the ''File'' menu, choose ''Save as''. Save the diagram containing the Super Block as <tt>led_sin.cos</tt>.<br />
<br />
== Generating dsPIC code from a Scicos Diagram ==<br />
<br />
It is now time to generate the code for the example we just created.<br />
<br />
'''Note''': A copy of the file created in the previous steps is included inside the <tt>scicos_examples/led_sin</tt> directory. To open it, double click on the <tt>scicos_examples/led_sin/led_sin.cos</tt> file.<br />
<br />
# Select ''Set Target'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen0.png|center|thumb|200px|The CodeGen menu - Set target.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen3.png|center|thumb|200px|The SetTarget dialog box.]]<br />
# You can specify the target board (board_flex or board_easylab) using the second textbox. Please leave the other options unchanged.<br />
# Select ''FlexCodeGen'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen1.png|center|thumb|200px|The CodeGen menu - Flex code generator.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen2.png|center|thumb|200px|The FlexCodeGen dialog box.]]<br />
# You can specify the block name by modifying the <tt>New block's name</tt> textbox and the directory where all the files will be created by modifying the <tt>Created files Path</tt> textbox. <br />
#* '''IMPORTANT NOTE FOR WINDOWS USERS''': Choose a location where you have write permission. If you start 'ScicosLab' with administrator privileges there are no limitations in the choice of the destination folder.<br />
# Press ''Ok''. As a result, a set of files are generated in the output directory.<br />
# Then, Scicos automatically opens a console window, running in it the following commands:<br />
#* the RT-Druid template generator to instantiate the Scicos template application;<br />
#* the RT-Druid standalone code generator to produce the ERIKA Enterprise configuration files from the generated OIL file;<br />
#* the ''make'' application to compile the code.<br />
# The result of the code generation process is depicted in Figure \ref{fig:console}. <br />
#: [[File:console.png|center|thumb|200px|The compilation console.]]<br />
# The executable file is named <tt>pic30.elf</tt> and it is located inside the <tt>Debug</tt> directory as usual for all the ERIKA Enterprise applications.<br />
# You can now program your application on your FLEX board. To do that, you need to open MPLABIDE as you usually do to program other ERIKA Enterprise applications. Please refer to the ERIKA Enterprise tutorial for dsPIC for more information.<br />
# Running the code on your FLEX board has the following behavior: the system led on the board flashes with a period of 20 seconds, and a duty cycle of around 6 seconds over 20. The explanation is the following: <br />
#* The system works like a synchronous control system, with a sampling frequency of 0.1 secs<br />
#* The ''Sine'' block output is a sinus with a frequency of 0.05, which correspond to a period of 20 s<br />
#* The LED block is directly linked to the system led, and is programmed to put on the system led when its input is greater than 0.5.<br />
#* Looking at the Figure below, it is clear that the sinus has a value greater than 0.5 for around a third of its period. Given that, the system led is on for around 6 seconds over 20.<br />
#: [[File:graphic.png|center|thumb|200px|A graphic of a Sine and of a constant value 0.5.]]<br />
<br />
= Internals of the genareted code =<br />
<br />
== Templates and customization of the generated application ==<br />
<br />
The default application wich is generated by the Scicos embedded code generator for dsPIC generates a basic application which uses ERIKA Enterprise with the FP kernel, a periodic task and an Alarm triggered by a timer interrupt to activate it.<br />
<br />
In general, it is likely that advanced users would like to customize the application which is generated by the code generator, to add other activities to be executed concurrently with the code generated from the Scicos design. Examples of this activities could be for example background activities for reporting, supervision, display, debug, and so on.<br />
<br />
Implementing such variations is very easy, because the application scheleton used by the code generator is contained inside a RT-Druid template. In particular, the default template is the <tt>pic30_empty_scicos</tt> template stored inside the <tt>examples/pic30/pic30_scicos</tt> directory under the dsPIC examples plugin in the Eclipse installation. The user can add a new template using the following steps:<br />
<br />
# Copy the <tt>examples/pic30/pic30_scicos</tt> directory in another location under the <tt>examples</tt> directory;<br />
# Change the <tt>ID</tt> of the template by modifying the <tt>template.xml</tt> file contained inside the directory. The <tt>ID</tt> is specified in the second line of the XML file as follows: <pre> <evidence_example version="1" ID="pic30_empty_scicos"></pre><br />
# Change the files included in the new template. If you need to add a new file, please remember to add it in the corresponding list in the <tt>template.xml</tt> file.<br />
<br />
Finally, specify the new template when generating the code in the Template textbox.<br />
<br />
== Assumptions of the default template ==<br />
The code generated by the Scilab/Scicos code generator for FLEX uses the template named <tt>pic30_empty_scicos</tt>, and has the following symplifing assumptions:<br />
<br />
# There is a single sampling time T_s in the system;<br />
# T_s is forced to 1 ms;<br />
# Every sampling time specified by the user under the Scicos design will be rounded to a multiple of a millisecond;<br />
# An ERIKA Enterprise counter is linked to the a periodic timer;<br />
# The periodic timer used in the dsPIC hardware is set to raise an interrupt every 1 ms;<br />
# An ERIKA Enterprise alarm is attached to the counter, to periodically activate a task;<br />
# The task body just calls the routines generated by the Scicos code generator. Which executes the functions you specified in the design;<br />
# The PWM object has a fixed period of 1 ms. This means that if the sampling period is a multiple of T_s, then the PWM will repeat the same duty cycle until the PWN value is changed;<br />
# The A/D converter always works ''on demand'', meaning it always executes the following steps:<br />
#* selects a channel;<br />
#* starts the conversion;<br />
#* waits for the end of the conversion (typically max 10 usec)<br />
#* it converts the result in a value from 0.0 V and 3.3 V</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_Installing_scicoslab_and_generating_code_from_a_Scicos_diagramTutorial: Installing scicoslab and generating code from a Scicos diagram2012-02-01T10:14:28Z<p>Salva: /* Scicoslab 4.4b7 code generator for FLEX - Installation procedure */</p>
<hr />
<div>This is the Wiki page dedicated to the Scicos code generator originally developed by Roberto Bucher from SUPSI Lugano.<br />
<br />
The code of the code generator is distributed under GPL2. The project is currently lead by Roberto Bucher, from SUPSI Lugano, and is hosted on the Evidence web site.<br />
<br />
= Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX and EasyLab boards<br />
# Download and install Cygwin from the [http://www.cygwin.com/ Cygwin site]. Here is a [http://download.tuxfamily.org/erika/webdownload/eeCygwin_1_7_9.zip minimal installation pack]. Cygwin is required to compile the code generated from your Scicos diagram.<br />
# Download Microsoft Visual C++ 2008 from the [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download ScicosLab 4.4.1 from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. <br />
# Download Microchip MPLAB IDE from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board or EasyLab board. Then download a C30 compiler, for example from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC on the Flex board you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]. While for the EasyLab board the programmer is not required because it is equipped with one on board.<br />
# Download the latest Scicoslab pack from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab pack download page]. Unzip the pack and install it. To install the pack execute the installer.sce script file in ScicosLab (File -> Exec...). (If needed, run ScicosLab with administrator privileges). At the end of the installation restart ScicosLab for the changes to take effect.<br />
# Create and compile your first Scicos diagram (as shown here: [http://erika.tuxfamily.org/wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication An example of code-generation]), flash the microcontroller, test your application and ... enjoy! <br />
<br />
Please note, this version of the ScicosLab pack includes a stand-alone version of RT-Druid and a full version of Erika Enterprise.<br />
If you have any problem please contact us using the [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
= Scicoslab 4.4b7 code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX<br />
# Download Erika Enterprise 1.5.1 (the executable contains: Erika Enterprise kernel, RT-Druid and Cygwin) from [http://erika.tuxfamily.org/erika-for-multiple-devices.html Erika installer site] and install it. Then launch the program and update the software with the nightly build version (with Help->Software Updates...) from [http://download.tuxfamily.org/erika/webdownload/rtdruid_beta Erika update site] It is recommended to update periodically the program. Update is needed only if you want to use last version of Scicoslab pack.<br />
# Download Microsoft Visual C++ 2008 from [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download Scicoslab from [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. Then download the Scicoslab_pack you want to use and follow the instructions contained in the readme file to set up the pack inside Scicoslab.<br />
# Download Microchip MPLAB IDE from [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX or EasyLab board. Then download a C30 compiler, for example from [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC microcontroller you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]<br />
# Compile you first Scicos diagram, flash the microcontroller, test your application and ... enjoy! <br />
<br />
If you have any problem please contact us using the Forum: [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
= Your first Scicos application =<br />
<br />
This Chapter will guide you to the creation, compilation and execution<br />
of a first simple Scicos example on a FLEX Demo board. The example<br />
created in this tutorial can be found in the directory<br />
<tt>scicos_ee/examples/scicos_flex/Led_sin</tt>.<br />
inside scicos pack base directory.<br />
<br />
If you are looking for a prebuilt example, go directly to the next Section.<br />
<br />
== Creating the Scicos example files ==<br />
<br />
(Note the screenshow may refer to old versions of ScicosLab or Scilab 4.1.2).<br />
<br />
# Please start ScicosLab from the Start menu. The ScicosLab window appears.<br />
# Type <tt>scicos();</tt> as showed below in the Figure, and press Enter.<br />
#: [[File:scilab_splash.png|center|thumb|200px|The Scilab splash screen. Type <tt>scicos();</tt> to start Scicos.]]<br />
# The Scicos windows appears, as showed in Figure<br />
#: [[File:scicos_splash.png|center|thumb|200px|The Scicos splash screen.]]<br />
# You need to compile the Scicos blocks, if you didn't do it yet, in order to get the system working. To do that type these commands in ScicosLab window:<br />
#:cd ("%SCICOSLAB_HOME%\contrib\dspic"); // (%SCICOSLAB_HOME% means the installation path of ScicosLab...)<br />
#:exec ("builder.sce");<br />
#::'''IMPORTANT NOTE''': please check the correctness of this path. Newer Scicos Packs are installed under <tt>...\scicoslab-4.4.1\contrib\scicos_ee\scicos_flex\dspic</tt><br />
# Select ''Palettes'' from the ''Palette'' menu, as showed in Figure<br />
#: [[File:palette_menu.png|center|thumb|200px|The Palettes.]]<br />
# A little list appear in place of the menu. Select ''FLEX'', as showed in Figure<br />
#: [[File:palette_menu2.png|center|thumb|200px|The Palette list.]]<br />
# A windows appears, with some sink blocks specific for the FLEX boards<br />
#: [[File:palette.png|center|thumb|200px|The dsPIC Palette.]]<br />
# Single click on the FLEX-LED block. The window selection moves to the Scicos window. The mouse now becomes a white rectangle of the dimension of the LED block. Single click somewhere in the white part of the window. A LED block is dropped in the diagram, like in Figure<br />
#: [[File:led.png|center|thumb|200px|The LED block is dropped in the design window.]]<br />
#* '''Note''': If you need to move a block, go over it with the mouse, press ''m'', then move the block and click on the new position!<br />
#* '''Note''': If you need to delete a block or a line, go over it with the mouse, then press ''d''!<br />
#* '''Note''': If some garbage appears on the diagram windos, don't panic! Just press ''r''!<br />
# Open the MCHP16-Sources palette, and repeat the same with the Sine block, placing it on the left of the LED block, as in Figure <br />
#: [[File:sineled.png|center|thumb|200px|Place the Sine block to the left of the LED block.]]<br />
# Link the black triangle of the Sine block to the black triangle of the LED block. To do that, press ''l'', then single click on the triangle of the Sine block (the ''source''), then click again on the triangle of the LED block (the ''sink''). See Figure<br />
#: [[File:link.png|center|thumb|200px|Sine and LED are now linked.]]<br />
# From the MCHP16-Sources Palette, which can be found il the palette list, choose the red clock, and put it on the diagram as shown in Figure<br />
#: [[File:clock.png|center|thumb|200px|Put the Clock block over the Sine and LED blocks.]]<br />
# Now connect the clock signal to the two blocks. To do that, single click on the red triangle of the <tt>clock</tt> block, then single click below it, then single click over the <tt>Sine</tt> block, then click on the red triangle of the <tt>Sine</tt> block. After that, single click on the line below the <tt>clock</tt> block, hit the key 'L' of keyboard, then over the <tt>LED</tt> block, then on the red triangle of the <tt>LED</tt> block. The result is shown in Figure<br />
#: [[File:redlink.png|center|thumb|200px|The Clock block is connected to the Sine and LED blocks.]]<br />
# Single click on the Clock block. Its properties window appears. Leave them untouched, and press OK. You can do the same on the Sine block. The two Figures below show these windows.<br />
#: [[File:clockproperties.png|center|thumb|200px|The Clock block properties.]]<br />
#: [[File:sineproperties.png|center|thumb|200px|The Sine block properties.]]<br />
# The code generator can produce code which only comes from a special block named ''Super Block''. For this reason, we need to create a Super Block enclosing the <tt>Sine</tt> and the <tt>LED</tt> blocks. To do that, select the ''Region to Super Block'' menu item from the ''Diagram'' menu (see Figure below).<br />
#: [[File:region2sb.png|center|thumb|200px|The Region to Super Block menu item.]]<br />
# Then, draw a selection which includes the <tt>Sine</tt>, the <tt>LED</tt>, and the red lines in a way that only ''one'' red line exits the selection, as shown in Figure<br />
#: [[File:sb.png|center|thumb|200px|The selection made to create a Super Block.]]<br />
# As a result, a Super Block is created (see Figure)<br />
#: [[File:sb1.png|center|thumb|200px|The Super Block.]]<br />
#: Which contains the Sine and LED blocks. To see these blocks, just single click on the Super Block, and another window will appear (see Figure). <br />
#: [[File:sb2.png|center|thumb|200px|The contents of the Super Block.]]<br />
# Please note that this window is very similar to the previous one except that the clock object is substituted by a placeholder signed with the number 1.<br />
#* '''Note''': The Diagram containing the Super Block is disabled when the Super Block diagram is displayed. Only one window can be enabled at a time in Scicos. The limitation will be removed in the next version of Scicos.<br />
# It is now time to save the two diagrams. From the ''File'' menu, choose ''Save as''. Save the diagram containing the Super Block as <tt>led_sin.cos</tt>.<br />
<br />
== Generating dsPIC code from a Scicos Diagram ==<br />
<br />
It is now time to generate the code for the example we just created.<br />
<br />
'''Note''': A copy of the file created in the previous steps is included inside the <tt>scicos_examples/led_sin</tt> directory. To open it, double click on the <tt>scicos_examples/led_sin/led_sin.cos</tt> file.<br />
<br />
# Select ''Set Target'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen0.png|center|thumb|200px|The CodeGen menu - Set target.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen3.png|center|thumb|200px|The SetTarget dialog box.]]<br />
# You can specify the target board (board_flex or board_easylab) using the second textbox. Please leave the other options unchanged.<br />
# Select ''FlexCodeGen'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen1.png|center|thumb|200px|The CodeGen menu - Flex code generator.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen2.png|center|thumb|200px|The FlexCodeGen dialog box.]]<br />
# You can specify the block name by modifying the <tt>New block's name</tt> textbox and the directory where all the files will be created by modifying the <tt>Created files Path</tt> textbox. <br />
#* '''IMPORTANT NOTE FOR WINDOWS USERS''': Choose a location where you have write permission. If you start 'ScicosLab' with administrator privileges there are no limitations in the choice of the destination folder.<br />
# Press ''Ok''. As a result, a set of files are generated in the output directory.<br />
# Then, Scicos automatically opens a console window, running in it the following commands:<br />
#* the RT-Druid template generator to instantiate the Scicos template application;<br />
#* the RT-Druid standalone code generator to produce the ERIKA Enterprise configuration files from the generated OIL file;<br />
#* the ''make'' application to compile the code.<br />
# The result of the code generation process is depicted in Figure \ref{fig:console}. <br />
#: [[File:console.png|center|thumb|200px|The compilation console.]]<br />
# The executable file is named <tt>pic30.elf</tt> and it is located inside the <tt>Debug</tt> directory as usual for all the ERIKA Enterprise applications.<br />
# You can now program your application on your FLEX board. To do that, you need to open MPLABIDE as you usually do to program other ERIKA Enterprise applications. Please refer to the ERIKA Enterprise tutorial for dsPIC for more information.<br />
# Running the code on your FLEX board has the following behavior: the system led on the board flashes with a period of 20 seconds, and a duty cycle of around 6 seconds over 20. The explanation is the following: <br />
#* The system works like a synchronous control system, with a sampling frequency of 0.1 secs<br />
#* The ''Sine'' block output is a sinus with a frequency of 0.05, which correspond to a period of 20 s<br />
#* The LED block is directly linked to the system led, and is programmed to put on the system led when its input is greater than 0.5.<br />
#* Looking at the Figure below, it is clear that the sinus has a value greater than 0.5 for around a third of its period. Given that, the system led is on for around 6 seconds over 20.<br />
#: [[File:graphic.png|center|thumb|200px|A graphic of a Sine and of a constant value 0.5.]]<br />
<br />
= Internals of the genareted code =<br />
<br />
== Templates and customization of the generated application ==<br />
<br />
The default application wich is generated by the Scicos embedded code generator for dsPIC generates a basic application which uses ERIKA Enterprise with the FP kernel, a periodic task and an Alarm triggered by a timer interrupt to activate it.<br />
<br />
In general, it is likely that advanced users would like to customize the application which is generated by the code generator, to add other activities to be executed concurrently with the code generated from the Scicos design. Examples of this activities could be for example background activities for reporting, supervision, display, debug, and so on.<br />
<br />
Implementing such variations is very easy, because the application scheleton used by the code generator is contained inside a RT-Druid template. In particular, the default template is the <tt>pic30_empty_scicos</tt> template stored inside the <tt>examples/pic30/pic30_scicos</tt> directory under the dsPIC examples plugin in the Eclipse installation. The user can add a new template using the following steps:<br />
<br />
# Copy the <tt>examples/pic30/pic30_scicos</tt> directory in another location under the <tt>examples</tt> directory;<br />
# Change the <tt>ID</tt> of the template by modifying the <tt>template.xml</tt> file contained inside the directory. The <tt>ID</tt> is specified in the second line of the XML file as follows: <pre> <evidence_example version="1" ID="pic30_empty_scicos"></pre><br />
# Change the files included in the new template. If you need to add a new file, please remember to add it in the corresponding list in the <tt>template.xml</tt> file.<br />
<br />
Finally, specify the new template when generating the code in the Template textbox.<br />
<br />
== Assumptions of the default template ==<br />
The code generated by the Scilab/Scicos code generator for FLEX uses the template named <tt>pic30_empty_scicos</tt>, and has the following symplifing assumptions:<br />
<br />
# There is a single sampling time T_s in the system;<br />
# T_s is forced to 1 ms;<br />
# Every sampling time specified by the user under the Scicos design will be rounded to a multiple of a millisecond;<br />
# An ERIKA Enterprise counter is linked to the a periodic timer;<br />
# The periodic timer used in the dsPIC hardware is set to raise an interrupt every 1 ms;<br />
# An ERIKA Enterprise alarm is attached to the counter, to periodically activate a task;<br />
# The task body just calls the routines generated by the Scicos code generator. Which executes the functions you specified in the design;<br />
# The PWM object has a fixed period of 1 ms. This means that if the sampling period is a multiple of T_s, then the PWM will repeat the same duty cycle until the PWN value is changed;<br />
# The A/D converter always works ''on demand'', meaning it always executes the following steps:<br />
#* selects a channel;<br />
#* starts the conversion;<br />
#* waits for the end of the conversion (typically max 10 usec)<br />
#* it converts the result in a value from 0.0 V and 3.3 V</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_Installing_scicoslab_and_generating_code_from_a_Scicos_diagramTutorial: Installing scicoslab and generating code from a Scicos diagram2012-02-01T10:11:49Z<p>Salva: /* Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure */</p>
<hr />
<div>This is the Wiki page dedicated to the Scicos code generator originally developed by Roberto Bucher from SUPSI Lugano.<br />
<br />
The code of the code generator is distributed under GPL2. The project is currently lead by Roberto Bucher, from SUPSI Lugano, and is hosted on the Evidence web site.<br />
<br />
= Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX and EasyLab boards<br />
# Download and install Cygwin from the [http://www.cygwin.com/ Cygwin site]. Here is a [http://download.tuxfamily.org/erika/webdownload/eeCygwin_1_7_9.zip minimal installation pack]. Cygwin is required to compile the code generated from your Scicos diagram.<br />
# Download Microsoft Visual C++ 2008 from the [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download ScicosLab 4.4.1 from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. <br />
# Download Microchip MPLAB IDE from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board or EasyLab board. Then download a C30 compiler, for example from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC on the Flex board you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]. While for the EasyLab board the programmer is not required because it is equipped with one on board.<br />
# Download the latest Scicoslab pack from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab pack download page]. Unzip the pack and install it. To install the pack execute the installer.sce script file in ScicosLab (File -> Exec...). (If needed, run ScicosLab with administrator privileges). At the end of the installation restart ScicosLab for the changes to take effect.<br />
# Create and compile your first Scicos diagram (as shown here: [http://erika.tuxfamily.org/wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication An example of code-generation]), flash the microcontroller, test your application and ... enjoy! <br />
<br />
Please note, this version of the ScicosLab pack includes a stand-alone version of RT-Druid and a full version of Erika Enterprise.<br />
If you have any problem please contact us using the [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
= Scicoslab 4.4b7 code generator for FLEX - Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX<br />
# Download Erika Enterprise 1.5.1 (the executable contains: Erika Enterprise kernel, RT-Druid and Cygwin) from [http://erika.tuxfamily.org/erika-for-multiple-devices.html Erika installer site] and install it. Then launch the program and update the software with the nightly build version (with Help->Software Updates...) from [http://download.tuxfamily.org/erika/webdownload/rtdruid_beta Erika update site] It is recommended to update periodically the program. Update is needed only if you want to use last version of Scicoslab pack.<br />
# Download Microsoft Visual C++ 2008 from [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download Scicoslab from [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. Then download the Scicoslab_pack you want to use and follow the instructions contained in the readme file to set up the pack inside Scicoslab.<br />
# Download Microchip MPLAB IDE from [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board. Then download a C30 compiler, for example from [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC microcontroller you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]<br />
# Compile you first Scicos diagram, flash the microcontroller, test your application and ... enjoy! <br />
<br />
If you have any problem please contact us using the Forum: [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
= Your first Scicos application =<br />
<br />
This Chapter will guide you to the creation, compilation and execution<br />
of a first simple Scicos example on a FLEX Demo board. The example<br />
created in this tutorial can be found in the directory<br />
<tt>scicos_ee/examples/scicos_flex/Led_sin</tt>.<br />
inside scicos pack base directory.<br />
<br />
If you are looking for a prebuilt example, go directly to the next Section.<br />
<br />
== Creating the Scicos example files ==<br />
<br />
(Note the screenshow may refer to old versions of ScicosLab or Scilab 4.1.2).<br />
<br />
# Please start ScicosLab from the Start menu. The ScicosLab window appears.<br />
# Type <tt>scicos();</tt> as showed below in the Figure, and press Enter.<br />
#: [[File:scilab_splash.png|center|thumb|200px|The Scilab splash screen. Type <tt>scicos();</tt> to start Scicos.]]<br />
# The Scicos windows appears, as showed in Figure<br />
#: [[File:scicos_splash.png|center|thumb|200px|The Scicos splash screen.]]<br />
# You need to compile the Scicos blocks, if you didn't do it yet, in order to get the system working. To do that type these commands in ScicosLab window:<br />
#:cd ("%SCICOSLAB_HOME%\contrib\dspic"); // (%SCICOSLAB_HOME% means the installation path of ScicosLab...)<br />
#:exec ("builder.sce");<br />
#::'''IMPORTANT NOTE''': please check the correctness of this path. Newer Scicos Packs are installed under <tt>...\scicoslab-4.4.1\contrib\scicos_ee\scicos_flex\dspic</tt><br />
# Select ''Palettes'' from the ''Palette'' menu, as showed in Figure<br />
#: [[File:palette_menu.png|center|thumb|200px|The Palettes.]]<br />
# A little list appear in place of the menu. Select ''FLEX'', as showed in Figure<br />
#: [[File:palette_menu2.png|center|thumb|200px|The Palette list.]]<br />
# A windows appears, with some sink blocks specific for the FLEX boards<br />
#: [[File:palette.png|center|thumb|200px|The dsPIC Palette.]]<br />
# Single click on the FLEX-LED block. The window selection moves to the Scicos window. The mouse now becomes a white rectangle of the dimension of the LED block. Single click somewhere in the white part of the window. A LED block is dropped in the diagram, like in Figure<br />
#: [[File:led.png|center|thumb|200px|The LED block is dropped in the design window.]]<br />
#* '''Note''': If you need to move a block, go over it with the mouse, press ''m'', then move the block and click on the new position!<br />
#* '''Note''': If you need to delete a block or a line, go over it with the mouse, then press ''d''!<br />
#* '''Note''': If some garbage appears on the diagram windos, don't panic! Just press ''r''!<br />
# Open the MCHP16-Sources palette, and repeat the same with the Sine block, placing it on the left of the LED block, as in Figure <br />
#: [[File:sineled.png|center|thumb|200px|Place the Sine block to the left of the LED block.]]<br />
# Link the black triangle of the Sine block to the black triangle of the LED block. To do that, press ''l'', then single click on the triangle of the Sine block (the ''source''), then click again on the triangle of the LED block (the ''sink''). See Figure<br />
#: [[File:link.png|center|thumb|200px|Sine and LED are now linked.]]<br />
# From the MCHP16-Sources Palette, which can be found il the palette list, choose the red clock, and put it on the diagram as shown in Figure<br />
#: [[File:clock.png|center|thumb|200px|Put the Clock block over the Sine and LED blocks.]]<br />
# Now connect the clock signal to the two blocks. To do that, single click on the red triangle of the <tt>clock</tt> block, then single click below it, then single click over the <tt>Sine</tt> block, then click on the red triangle of the <tt>Sine</tt> block. After that, single click on the line below the <tt>clock</tt> block, hit the key 'L' of keyboard, then over the <tt>LED</tt> block, then on the red triangle of the <tt>LED</tt> block. The result is shown in Figure<br />
#: [[File:redlink.png|center|thumb|200px|The Clock block is connected to the Sine and LED blocks.]]<br />
# Single click on the Clock block. Its properties window appears. Leave them untouched, and press OK. You can do the same on the Sine block. The two Figures below show these windows.<br />
#: [[File:clockproperties.png|center|thumb|200px|The Clock block properties.]]<br />
#: [[File:sineproperties.png|center|thumb|200px|The Sine block properties.]]<br />
# The code generator can produce code which only comes from a special block named ''Super Block''. For this reason, we need to create a Super Block enclosing the <tt>Sine</tt> and the <tt>LED</tt> blocks. To do that, select the ''Region to Super Block'' menu item from the ''Diagram'' menu (see Figure below).<br />
#: [[File:region2sb.png|center|thumb|200px|The Region to Super Block menu item.]]<br />
# Then, draw a selection which includes the <tt>Sine</tt>, the <tt>LED</tt>, and the red lines in a way that only ''one'' red line exits the selection, as shown in Figure<br />
#: [[File:sb.png|center|thumb|200px|The selection made to create a Super Block.]]<br />
# As a result, a Super Block is created (see Figure)<br />
#: [[File:sb1.png|center|thumb|200px|The Super Block.]]<br />
#: Which contains the Sine and LED blocks. To see these blocks, just single click on the Super Block, and another window will appear (see Figure). <br />
#: [[File:sb2.png|center|thumb|200px|The contents of the Super Block.]]<br />
# Please note that this window is very similar to the previous one except that the clock object is substituted by a placeholder signed with the number 1.<br />
#* '''Note''': The Diagram containing the Super Block is disabled when the Super Block diagram is displayed. Only one window can be enabled at a time in Scicos. The limitation will be removed in the next version of Scicos.<br />
# It is now time to save the two diagrams. From the ''File'' menu, choose ''Save as''. Save the diagram containing the Super Block as <tt>led_sin.cos</tt>.<br />
<br />
== Generating dsPIC code from a Scicos Diagram ==<br />
<br />
It is now time to generate the code for the example we just created.<br />
<br />
'''Note''': A copy of the file created in the previous steps is included inside the <tt>scicos_examples/led_sin</tt> directory. To open it, double click on the <tt>scicos_examples/led_sin/led_sin.cos</tt> file.<br />
<br />
# Select ''Set Target'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen0.png|center|thumb|200px|The CodeGen menu - Set target.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen3.png|center|thumb|200px|The SetTarget dialog box.]]<br />
# You can specify the target board (board_flex or board_easylab) using the second textbox. Please leave the other options unchanged.<br />
# Select ''FlexCodeGen'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen1.png|center|thumb|200px|The CodeGen menu - Flex code generator.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen2.png|center|thumb|200px|The FlexCodeGen dialog box.]]<br />
# You can specify the block name by modifying the <tt>New block's name</tt> textbox and the directory where all the files will be created by modifying the <tt>Created files Path</tt> textbox. <br />
#* '''IMPORTANT NOTE FOR WINDOWS USERS''': Choose a location where you have write permission. If you start 'ScicosLab' with administrator privileges there are no limitations in the choice of the destination folder.<br />
# Press ''Ok''. As a result, a set of files are generated in the output directory.<br />
# Then, Scicos automatically opens a console window, running in it the following commands:<br />
#* the RT-Druid template generator to instantiate the Scicos template application;<br />
#* the RT-Druid standalone code generator to produce the ERIKA Enterprise configuration files from the generated OIL file;<br />
#* the ''make'' application to compile the code.<br />
# The result of the code generation process is depicted in Figure \ref{fig:console}. <br />
#: [[File:console.png|center|thumb|200px|The compilation console.]]<br />
# The executable file is named <tt>pic30.elf</tt> and it is located inside the <tt>Debug</tt> directory as usual for all the ERIKA Enterprise applications.<br />
# You can now program your application on your FLEX board. To do that, you need to open MPLABIDE as you usually do to program other ERIKA Enterprise applications. Please refer to the ERIKA Enterprise tutorial for dsPIC for more information.<br />
# Running the code on your FLEX board has the following behavior: the system led on the board flashes with a period of 20 seconds, and a duty cycle of around 6 seconds over 20. The explanation is the following: <br />
#* The system works like a synchronous control system, with a sampling frequency of 0.1 secs<br />
#* The ''Sine'' block output is a sinus with a frequency of 0.05, which correspond to a period of 20 s<br />
#* The LED block is directly linked to the system led, and is programmed to put on the system led when its input is greater than 0.5.<br />
#* Looking at the Figure below, it is clear that the sinus has a value greater than 0.5 for around a third of its period. Given that, the system led is on for around 6 seconds over 20.<br />
#: [[File:graphic.png|center|thumb|200px|A graphic of a Sine and of a constant value 0.5.]]<br />
<br />
= Internals of the genareted code =<br />
<br />
== Templates and customization of the generated application ==<br />
<br />
The default application wich is generated by the Scicos embedded code generator for dsPIC generates a basic application which uses ERIKA Enterprise with the FP kernel, a periodic task and an Alarm triggered by a timer interrupt to activate it.<br />
<br />
In general, it is likely that advanced users would like to customize the application which is generated by the code generator, to add other activities to be executed concurrently with the code generated from the Scicos design. Examples of this activities could be for example background activities for reporting, supervision, display, debug, and so on.<br />
<br />
Implementing such variations is very easy, because the application scheleton used by the code generator is contained inside a RT-Druid template. In particular, the default template is the <tt>pic30_empty_scicos</tt> template stored inside the <tt>examples/pic30/pic30_scicos</tt> directory under the dsPIC examples plugin in the Eclipse installation. The user can add a new template using the following steps:<br />
<br />
# Copy the <tt>examples/pic30/pic30_scicos</tt> directory in another location under the <tt>examples</tt> directory;<br />
# Change the <tt>ID</tt> of the template by modifying the <tt>template.xml</tt> file contained inside the directory. The <tt>ID</tt> is specified in the second line of the XML file as follows: <pre> <evidence_example version="1" ID="pic30_empty_scicos"></pre><br />
# Change the files included in the new template. If you need to add a new file, please remember to add it in the corresponding list in the <tt>template.xml</tt> file.<br />
<br />
Finally, specify the new template when generating the code in the Template textbox.<br />
<br />
== Assumptions of the default template ==<br />
The code generated by the Scilab/Scicos code generator for FLEX uses the template named <tt>pic30_empty_scicos</tt>, and has the following symplifing assumptions:<br />
<br />
# There is a single sampling time T_s in the system;<br />
# T_s is forced to 1 ms;<br />
# Every sampling time specified by the user under the Scicos design will be rounded to a multiple of a millisecond;<br />
# An ERIKA Enterprise counter is linked to the a periodic timer;<br />
# The periodic timer used in the dsPIC hardware is set to raise an interrupt every 1 ms;<br />
# An ERIKA Enterprise alarm is attached to the counter, to periodically activate a task;<br />
# The task body just calls the routines generated by the Scicos code generator. Which executes the functions you specified in the design;<br />
# The PWM object has a fixed period of 1 ms. This means that if the sampling period is a multiple of T_s, then the PWM will repeat the same duty cycle until the PWN value is changed;<br />
# The A/D converter always works ''on demand'', meaning it always executes the following steps:<br />
#* selects a channel;<br />
#* starts the conversion;<br />
#* waits for the end of the conversion (typically max 10 usec)<br />
#* it converts the result in a value from 0.0 V and 3.3 V</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Tutorial:_Installing_scicoslab_and_generating_code_from_a_Scicos_diagramTutorial: Installing scicoslab and generating code from a Scicos diagram2012-02-01T09:54:24Z<p>Salva: </p>
<hr />
<div>This is the Wiki page dedicated to the Scicos code generator originally developed by Roberto Bucher from SUPSI Lugano.<br />
<br />
The code of the code generator is distributed under GPL2. The project is currently lead by Roberto Bucher, from SUPSI Lugano, and is hosted on the Evidence web site.<br />
<br />
= Scicoslab 4.4.1 and ScicosLab Pack 10.0: code generator for FLEX and EasyLab boards- Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX and EasyLab boards<br />
# Download and install Cygwin from the [http://www.cygwin.com/ Cygwin site]. Here is a [http://download.tuxfamily.org/erika/webdownload/eeCygwin_1_7_9.zip minimal installation pack]. Cygwin is required to compile the code generated from your Scicos diagram.<br />
# Download Microsoft Visual C++ 2008 from the [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download ScicosLab 4.4.1 from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. <br />
# Download Microchip MPLAB IDE from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board. Then download a C30 compiler, for example from the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC microcontroller you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]<br />
# Download the latest Scicoslab pack from the [http://erika.tuxfamily.org/scilabscicos.html ScicosLab pack download page]. Unzip the pack and install it. To install the pack execute the installer.sce script file in ScicosLab (File -> Exec...). (If needed, run ScicosLab with administrator privileges). At the end of the installation restart ScicosLab for the changes to take effect.<br />
# Create and compile your first Scicos diagram (as shown here: [http://erika.tuxfamily.org/wiki/index.php?title=Amazing_Ball_Control_System:_An_example_of_PID_control_and_UDP_communication An example of code-generation]), flash the microcontroller, test your application and ... enjoy! <br />
<br />
Please note, this version of the ScicosLab pack includes a stand-alone version of RT-Druid and a full version of Erika Enterprise.<br />
If you have any problem please contact us using the [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
= Scicoslab 4.4b7 code generator for FLEX - Installation procedure =<br />
Steps to set up the Scicoslab code generation for FLEX<br />
# Download Erika Enterprise 1.5.1 (the executable contains: Erika Enterprise kernel, RT-Druid and Cygwin) from [http://erika.tuxfamily.org/erika-for-multiple-devices.html Erika installer site] and install it. Then launch the program and update the software with the nightly build version (with Help->Software Updates...) from [http://download.tuxfamily.org/erika/webdownload/rtdruid_beta Erika update site] It is recommended to update periodically the program. Update is needed only if you want to use last version of Scicoslab pack.<br />
# Download Microsoft Visual C++ 2008 from [http://www.microsoft.com/express/Downloads/#2008-Visual-CPP Microsoft Visual C++ site] and install it. It is required from the Evidence Scicoslab pack. <br />
# Download Scicoslab from [http://erika.tuxfamily.org/scilabscicos.html ScicosLab site] and install it. Then download the Scicoslab_pack you want to use and follow the instructions contained in the readme file to set up the pack inside Scicoslab.<br />
# Download Microchip MPLAB IDE from [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469 MPLAB IDE site] and install it. It is required to program the dsPIC microcontroller mounted on the FLEX board. Then download a C30 compiler, for example from [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip MPLAB C30 compiler site] and install it. A compiler is required to compile your control application. To program the dsPIC microcontroller you need a programmer. You can buy a programmer for dsPIC from Microchip site. Programmers suggested are: Microchip MPLAB ICD2 or Microchip MPLAB ICD3. See Microchip for more informations:[http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010046 Microchip programmers site]<br />
# Compile you first Scicos diagram, flash the microcontroller, test your application and ... enjoy! <br />
<br />
If you have any problem please contact us using the Forum: [http://erika.tuxfamily.org/forum/ Erika Forum]<br />
<br />
= Your first Scicos application =<br />
<br />
This Chapter will guide you to the creation, compilation and execution<br />
of a first simple Scicos example on a FLEX Demo board. The example<br />
created in this tutorial can be found in the directory<br />
<tt>scicos_ee/examples/scicos_flex/Led_sin</tt>.<br />
inside scicos pack base directory.<br />
<br />
If you are looking for a prebuilt example, go directly to the next Section.<br />
<br />
== Creating the Scicos example files ==<br />
<br />
(Note the screenshow may refer to old versions of ScicosLab or Scilab 4.1.2).<br />
<br />
# Please start ScicosLab from the Start menu. The ScicosLab window appears.<br />
# Type <tt>scicos();</tt> as showed below in the Figure, and press Enter.<br />
#: [[File:scilab_splash.png|center|thumb|200px|The Scilab splash screen. Type <tt>scicos();</tt> to start Scicos.]]<br />
# The Scicos windows appears, as showed in Figure<br />
#: [[File:scicos_splash.png|center|thumb|200px|The Scicos splash screen.]]<br />
# You need to compile the Scicos blocks, if you didn't do it yet, in order to get the system working. To do that type these commands in ScicosLab window:<br />
#:cd ("%SCICOSLAB_HOME%\contrib\dspic"); // (%SCICOSLAB_HOME% means the installation path of ScicosLab...)<br />
#:exec ("builder.sce");<br />
#::'''IMPORTANT NOTE''': please check the correctness of this path. Newer Scicos Packs are installed under <tt>...\scicoslab-4.4.1\contrib\scicos_ee\scicos_flex\dspic</tt><br />
# Select ''Palettes'' from the ''Palette'' menu, as showed in Figure<br />
#: [[File:palette_menu.png|center|thumb|200px|The Palettes.]]<br />
# A little list appear in place of the menu. Select ''FLEX'', as showed in Figure<br />
#: [[File:palette_menu2.png|center|thumb|200px|The Palette list.]]<br />
# A windows appears, with some sink blocks specific for the FLEX boards<br />
#: [[File:palette.png|center|thumb|200px|The dsPIC Palette.]]<br />
# Single click on the FLEX-LED block. The window selection moves to the Scicos window. The mouse now becomes a white rectangle of the dimension of the LED block. Single click somewhere in the white part of the window. A LED block is dropped in the diagram, like in Figure<br />
#: [[File:led.png|center|thumb|200px|The LED block is dropped in the design window.]]<br />
#* '''Note''': If you need to move a block, go over it with the mouse, press ''m'', then move the block and click on the new position!<br />
#* '''Note''': If you need to delete a block or a line, go over it with the mouse, then press ''d''!<br />
#* '''Note''': If some garbage appears on the diagram windos, don't panic! Just press ''r''!<br />
# Open the MCHP16-Sources palette, and repeat the same with the Sine block, placing it on the left of the LED block, as in Figure <br />
#: [[File:sineled.png|center|thumb|200px|Place the Sine block to the left of the LED block.]]<br />
# Link the black triangle of the Sine block to the black triangle of the LED block. To do that, press ''l'', then single click on the triangle of the Sine block (the ''source''), then click again on the triangle of the LED block (the ''sink''). See Figure<br />
#: [[File:link.png|center|thumb|200px|Sine and LED are now linked.]]<br />
# From the MCHP16-Sources Palette, which can be found il the palette list, choose the red clock, and put it on the diagram as shown in Figure<br />
#: [[File:clock.png|center|thumb|200px|Put the Clock block over the Sine and LED blocks.]]<br />
# Now connect the clock signal to the two blocks. To do that, single click on the red triangle of the <tt>clock</tt> block, then single click below it, then single click over the <tt>Sine</tt> block, then click on the red triangle of the <tt>Sine</tt> block. After that, single click on the line below the <tt>clock</tt> block, hit the key 'L' of keyboard, then over the <tt>LED</tt> block, then on the red triangle of the <tt>LED</tt> block. The result is shown in Figure<br />
#: [[File:redlink.png|center|thumb|200px|The Clock block is connected to the Sine and LED blocks.]]<br />
# Single click on the Clock block. Its properties window appears. Leave them untouched, and press OK. You can do the same on the Sine block. The two Figures below show these windows.<br />
#: [[File:clockproperties.png|center|thumb|200px|The Clock block properties.]]<br />
#: [[File:sineproperties.png|center|thumb|200px|The Sine block properties.]]<br />
# The code generator can produce code which only comes from a special block named ''Super Block''. For this reason, we need to create a Super Block enclosing the <tt>Sine</tt> and the <tt>LED</tt> blocks. To do that, select the ''Region to Super Block'' menu item from the ''Diagram'' menu (see Figure below).<br />
#: [[File:region2sb.png|center|thumb|200px|The Region to Super Block menu item.]]<br />
# Then, draw a selection which includes the <tt>Sine</tt>, the <tt>LED</tt>, and the red lines in a way that only ''one'' red line exits the selection, as shown in Figure<br />
#: [[File:sb.png|center|thumb|200px|The selection made to create a Super Block.]]<br />
# As a result, a Super Block is created (see Figure)<br />
#: [[File:sb1.png|center|thumb|200px|The Super Block.]]<br />
#: Which contains the Sine and LED blocks. To see these blocks, just single click on the Super Block, and another window will appear (see Figure). <br />
#: [[File:sb2.png|center|thumb|200px|The contents of the Super Block.]]<br />
# Please note that this window is very similar to the previous one except that the clock object is substituted by a placeholder signed with the number 1.<br />
#* '''Note''': The Diagram containing the Super Block is disabled when the Super Block diagram is displayed. Only one window can be enabled at a time in Scicos. The limitation will be removed in the next version of Scicos.<br />
# It is now time to save the two diagrams. From the ''File'' menu, choose ''Save as''. Save the diagram containing the Super Block as <tt>led_sin.cos</tt>.<br />
<br />
== Generating dsPIC code from a Scicos Diagram ==<br />
<br />
It is now time to generate the code for the example we just created.<br />
<br />
'''Note''': A copy of the file created in the previous steps is included inside the <tt>scicos_examples/led_sin</tt> directory. To open it, double click on the <tt>scicos_examples/led_sin/led_sin.cos</tt> file.<br />
<br />
# Select ''Set Target'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen0.png|center|thumb|200px|The CodeGen menu - Set target.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen3.png|center|thumb|200px|The SetTarget dialog box.]]<br />
# You can specify the target board (board_flex or board_easylab) using the second textbox. Please leave the other options unchanged.<br />
# Select ''FlexCodeGen'' from the ''CodeGen'' menu (see Figure).<br />
#: [[File:codegen1.png|center|thumb|200px|The CodeGen menu - Flex code generator.]]<br />
# A window appear, like the one in Figure<br />
#: [[File:codegen2.png|center|thumb|200px|The FlexCodeGen dialog box.]]<br />
# You can specify the block name by modifying the <tt>New block's name</tt> textbox and the directory where all the files will be created by modifying the <tt>Created files Path</tt> textbox. <br />
#* '''IMPORTANT NOTE FOR WINDOWS USERS''': Choose a location where you have write permission. If you start 'ScicosLab' with administrator privileges there are no limitations in the choice of the destination folder.<br />
# Press ''Ok''. As a result, a set of files are generated in the output directory.<br />
# Then, Scicos automatically opens a console window, running in it the following commands:<br />
#* the RT-Druid template generator to instantiate the Scicos template application;<br />
#* the RT-Druid standalone code generator to produce the ERIKA Enterprise configuration files from the generated OIL file;<br />
#* the ''make'' application to compile the code.<br />
# The result of the code generation process is depicted in Figure \ref{fig:console}. <br />
#: [[File:console.png|center|thumb|200px|The compilation console.]]<br />
# The executable file is named <tt>pic30.elf</tt> and it is located inside the <tt>Debug</tt> directory as usual for all the ERIKA Enterprise applications.<br />
# You can now program your application on your FLEX board. To do that, you need to open MPLABIDE as you usually do to program other ERIKA Enterprise applications. Please refer to the ERIKA Enterprise tutorial for dsPIC for more information.<br />
# Running the code on your FLEX board has the following behavior: the system led on the board flashes with a period of 20 seconds, and a duty cycle of around 6 seconds over 20. The explanation is the following: <br />
#* The system works like a synchronous control system, with a sampling frequency of 0.1 secs<br />
#* The ''Sine'' block output is a sinus with a frequency of 0.05, which correspond to a period of 20 s<br />
#* The LED block is directly linked to the system led, and is programmed to put on the system led when its input is greater than 0.5.<br />
#* Looking at the Figure below, it is clear that the sinus has a value greater than 0.5 for around a third of its period. Given that, the system led is on for around 6 seconds over 20.<br />
#: [[File:graphic.png|center|thumb|200px|A graphic of a Sine and of a constant value 0.5.]]<br />
<br />
= Internals of the genareted code =<br />
<br />
== Templates and customization of the generated application ==<br />
<br />
The default application wich is generated by the Scicos embedded code generator for dsPIC generates a basic application which uses ERIKA Enterprise with the FP kernel, a periodic task and an Alarm triggered by a timer interrupt to activate it.<br />
<br />
In general, it is likely that advanced users would like to customize the application which is generated by the code generator, to add other activities to be executed concurrently with the code generated from the Scicos design. Examples of this activities could be for example background activities for reporting, supervision, display, debug, and so on.<br />
<br />
Implementing such variations is very easy, because the application scheleton used by the code generator is contained inside a RT-Druid template. In particular, the default template is the <tt>pic30_empty_scicos</tt> template stored inside the <tt>examples/pic30/pic30_scicos</tt> directory under the dsPIC examples plugin in the Eclipse installation. The user can add a new template using the following steps:<br />
<br />
# Copy the <tt>examples/pic30/pic30_scicos</tt> directory in another location under the <tt>examples</tt> directory;<br />
# Change the <tt>ID</tt> of the template by modifying the <tt>template.xml</tt> file contained inside the directory. The <tt>ID</tt> is specified in the second line of the XML file as follows: <pre> <evidence_example version="1" ID="pic30_empty_scicos"></pre><br />
# Change the files included in the new template. If you need to add a new file, please remember to add it in the corresponding list in the <tt>template.xml</tt> file.<br />
<br />
Finally, specify the new template when generating the code in the Template textbox.<br />
<br />
== Assumptions of the default template ==<br />
The code generated by the Scilab/Scicos code generator for FLEX uses the template named <tt>pic30_empty_scicos</tt>, and has the following symplifing assumptions:<br />
<br />
# There is a single sampling time T_s in the system;<br />
# T_s is forced to 1 ms;<br />
# Every sampling time specified by the user under the Scicos design will be rounded to a multiple of a millisecond;<br />
# An ERIKA Enterprise counter is linked to the a periodic timer;<br />
# The periodic timer used in the dsPIC hardware is set to raise an interrupt every 1 ms;<br />
# An ERIKA Enterprise alarm is attached to the counter, to periodically activate a task;<br />
# The task body just calls the routines generated by the Scicos code generator. Which executes the functions you specified in the design;<br />
# The PWM object has a fixed period of 1 ms. This means that if the sampling period is a multiple of T_s, then the PWM will repeat the same duty cycle until the PWN value is changed;<br />
# The A/D converter always works ''on demand'', meaning it always executes the following steps:<br />
#* selects a channel;<br />
#* starts the conversion;<br />
#* waits for the end of the conversion (typically max 10 usec)<br />
#* it converts the result in a value from 0.0 V and 3.3 V</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Main_PageMain Page2012-02-01T09:44:08Z<p>Salva: /* Easylab Board */</p>
<hr />
<div>= ERIKA Enterprise and RT-Druid =<br />
<br />
[[ERIKA Enterprise and RT-Druid Design Flow]]<br />
<br />
[[:Category:ERIKA internals|ERIKA internals category]]<br />
<br />
[[RT-Druid configuration]]<br />
<br />
[[People]] - a (probably incomplete) list of people who contributed to the project, in alphabetical order<br />
<br />
[[TODO List]]<br />
<br />
== Download and SVN ==<br />
* [[ERIKA Enterprise and RT-Druid SVN Access]]<br />
* [[Known Issues]]<br />
<br />
== Supported Devices ==<br />
<br />
This is a list of the architectures supported by ERIKA Enterprise and RT-Druid<br />
<br />
* [[Altera Nios II]]<br />
* [[ARM7TDMI]]<br />
* [[Atmel AVR5]]<br />
* [[ARM Cortex MX]]<br />
* [[EnSilica eSi-RISC]]<br />
* [[Freescale PPC e200 (MPC 56xx)]] (including PPC e200 z0, z6, z7)<br />
* [[Freescale S12]]<br />
* [[Infineon Tricore]]<br />
* [[Lattice Mico32]]<br />
* [[Microchip dsPIC]] (including dsPIC30, dsPIC33, and PIC24)<br />
* [[Microchip PIC32]]<br />
* [[TI MSP430]]<br />
<br />
Howtos<br />
* [[Porting ERIKA Enterprise and RT-Druid to a new microcontroller]]<br />
<br />
Support for Hitachi H8, C167/ST10 has been moved in the "old" session since there has been not much work on them and we cannot guarantee they still compile. If interested in them just write us an e-mail!<br />
<br />
== Tutorials and Online Documentation ==<br />
The following links contain links to specific themes, which in the past were separate PDF manuals.<br />
<br />
* [[Tutorial: Installing ERIKA and RT-Druid, and compile your first application]] on Windows hosts<br />
* [[Tutorial: Installing ERIKA and RT-Druid on a Linux host]]<br />
* [[Erika_path_in_RT-Druid| Set Erika path and show Erika sources in RT-Druid]]<br />
* [[Tutorial: Develop RT-Druid plugins]]<br />
* [[Tutorial: Update ERIKA and RT-Druid]]<br />
* [[Tutorial: RT-Druid and OIL basics]]<br />
* [[Tutorial: RT-Druid and OIL code generation using XML and XSLT transformations]]<br />
* [[Tutorial: Use a customized makefile]]<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram]]<br />
* Tutorial: [[Amazing Ball Introduction]]<br />
* [[Tutorial: S12XS - First installation and application compilation on Windows]]<br />
Videos<br />
* [[YouTube videos]]<br />
<br />
== Regression Tests ==<br />
<br />
* [[Regression tests on Examples]] - regression tests on the examples<br />
* [[Black Box Regression tests]] - regression tests automatically compiled and tested, including MODISTARC<br />
* [[Regression tests on ScicoLab]] - regression tests on the ScicosLab blocks<br />
<br />
== FLEX Boards ==<br />
<br />
* [[FLEX Demo Daughter Board]] Description of the board<br />
* [[FLEX Demo2 pack for motion control]] Description of the pack<br />
* [[FLEX Multibus Daughter Board]] Description of the board<br />
* [[FLEX Peripheral usage list]] This is an index of some peripherals and board connections used in the FLEX boards, to avoid making device drivers with conflicts on the dsPIC/PIC18 peripherals<br />
* [[FLEX University projects]] An '''incomplete list''' of university projects made using FLEX boards<br />
* [[RS485 on FLEX]] Which pins you should use to connect RS485 hardware to the FLEX boards<br />
* [[How to connect Flex Boards with a Zigbee Transceiver]]<br />
<br />
== Easylab Board ==<br />
<br />
* [[Easylab board: Description & MPLAB IDE Library]] <br />
* [[Easylab board and new dsPIC ERIKA Enterprise Driver API]]<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram|Using Easylab board with ScicosLab]].<br />
<br />
= Related Projects =<br />
<br />
== Scicoslab ==<br />
<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram]]<br />
* [[Tutorial: Generating code from a Scicos diagram targeting Easylab Board]]<br />
* [[Tutorial: Simulate and then generating code from a Scicos diagram]]<br />
* [[Scicos Blocks]]<br />
* Customizations<br />
** [[How to add a new Scicos block to ERIKA Enterprise]]<br />
** [[How to use Scicos-FLEX on non-FLEX boards]]<br />
* [[USB communication using FLEX FULL Demo Board and the Scilab/Scicos code generator]]<br />
* [[Amazing Ball Introduction]]<br />
* Links to courses and material on how to use Scicos for Embedded code design:<br />
** http://www.dii.unisi.it/~giannibi/teaching (look at the pages of "Progetto dei Sistemi di Controllo" and "Controllo Digitale" (in Italian)<br />
* [http://www.stargate-tr.com/?page_id=799 ScicosPowerLab] - could be interesting to link it to Scicos-FLEX!<br />
* Course material<br />
** [[ScicosLab Course October 2010 - Florence]]<br />
** [[ScicosLab Course November 2010 - Malaysia]] (updated material on 2011-01-28!)<br />
<br />
* Links to material on how to use FLEX and Erika Enterprise to control application design<br />
** [[Universitat Politècnica de Catalunia (Intelligent Robotics and Systems research group, Automatic Control Department)]]<br />
<br />
== SMCube ==<br />
<br />
These pages are a set of online resource created by SMCube users:<br />
<br />
* [[SMCube examples]]<br />
<br />
== FPG-EYE ==<br />
* [[FPG-EYE hardware and software]]<br />
* [[Installation of Mico32/FPG-EYE development environment]]<br />
* [[Tutorial: Building a Mico32 platform for FPG-EYE]]<br />
* [[Tutorial: Running ERIKA on Mico32 and FPG-EYE]]<br />
* [[CAL support on FPG-EYE]]<br />
<br />
== Matlab/Simulink code generation ==<br />
<br />
* [[Matlab/Simulimk code generator description]]<br />
<br />
== CAL Language ==<br />
<br />
* [[Brief introduction to the CAL language]]<br />
* [[CAL support on ERIKA Enterprise]] - how the CAL Language is integrated together with ERIKA<br />
* [[CAL support on FPG-EYE]] - how to integrate the CAL to Verilog toolchain on the FPG-EYE board<br />
<br />
=== Tutorials ===<br />
* [[Tutorial: Installing CAL with ERIKA Enterprise]]<br />
* [[Tutorial: Compiling a CAL application with ERIKA Enterprise]]<br />
<br />
=== Interesting links ===<br />
* [http://www.actors-project.eu ACTORS Project]<br />
* [http://www.actors-project.eu/index.php?page=public-deliverables ACTORS Deliverables]<br />
* [http://embedded.eecs.berkeley.edu/caltrop/ CALTrop]<br />
* [http://sourceforge.net/projects/opendf/ OpenDF]<br />
<br />
== EICASLAB ==<br />
<br />
This wiki part is dedicated to material about the EICASLab Code Generator for ERIKA Enterprise<br />
<br />
* [[YouTube videos]] - This lists the EICASLab webinars<br />
<br />
= List of publications =<br />
<br />
* [[Journal publications related to ERIKA and RT-Druid]]<br />
* [[Conference publications related to ERIKA and RT-Druid]]<br />
* [[Demo publications related to ERIKA and RT-Druid]]<br />
<br />
= Wikimedia Useful Links =<br />
<br />
* [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]<br />
* [http://www.mediawiki.org/wiki/Help:FAQ MediaWiki FAQ]<br />
<br />
= Thanks = <br />
<br />
ErikaWiki is hosted by TuxFamily.org<br />
<br />
[http://www.tuxfamily.org [[Image:Powered_tf1.png]]]</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Main_PageMain Page2012-02-01T09:43:54Z<p>Salva: /* Easylab Board */</p>
<hr />
<div>= ERIKA Enterprise and RT-Druid =<br />
<br />
[[ERIKA Enterprise and RT-Druid Design Flow]]<br />
<br />
[[:Category:ERIKA internals|ERIKA internals category]]<br />
<br />
[[RT-Druid configuration]]<br />
<br />
[[People]] - a (probably incomplete) list of people who contributed to the project, in alphabetical order<br />
<br />
[[TODO List]]<br />
<br />
== Download and SVN ==<br />
* [[ERIKA Enterprise and RT-Druid SVN Access]]<br />
* [[Known Issues]]<br />
<br />
== Supported Devices ==<br />
<br />
This is a list of the architectures supported by ERIKA Enterprise and RT-Druid<br />
<br />
* [[Altera Nios II]]<br />
* [[ARM7TDMI]]<br />
* [[Atmel AVR5]]<br />
* [[ARM Cortex MX]]<br />
* [[EnSilica eSi-RISC]]<br />
* [[Freescale PPC e200 (MPC 56xx)]] (including PPC e200 z0, z6, z7)<br />
* [[Freescale S12]]<br />
* [[Infineon Tricore]]<br />
* [[Lattice Mico32]]<br />
* [[Microchip dsPIC]] (including dsPIC30, dsPIC33, and PIC24)<br />
* [[Microchip PIC32]]<br />
* [[TI MSP430]]<br />
<br />
Howtos<br />
* [[Porting ERIKA Enterprise and RT-Druid to a new microcontroller]]<br />
<br />
Support for Hitachi H8, C167/ST10 has been moved in the "old" session since there has been not much work on them and we cannot guarantee they still compile. If interested in them just write us an e-mail!<br />
<br />
== Tutorials and Online Documentation ==<br />
The following links contain links to specific themes, which in the past were separate PDF manuals.<br />
<br />
* [[Tutorial: Installing ERIKA and RT-Druid, and compile your first application]] on Windows hosts<br />
* [[Tutorial: Installing ERIKA and RT-Druid on a Linux host]]<br />
* [[Erika_path_in_RT-Druid| Set Erika path and show Erika sources in RT-Druid]]<br />
* [[Tutorial: Develop RT-Druid plugins]]<br />
* [[Tutorial: Update ERIKA and RT-Druid]]<br />
* [[Tutorial: RT-Druid and OIL basics]]<br />
* [[Tutorial: RT-Druid and OIL code generation using XML and XSLT transformations]]<br />
* [[Tutorial: Use a customized makefile]]<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram]]<br />
* Tutorial: [[Amazing Ball Introduction]]<br />
* [[Tutorial: S12XS - First installation and application compilation on Windows]]<br />
Videos<br />
* [[YouTube videos]]<br />
<br />
== Regression Tests ==<br />
<br />
* [[Regression tests on Examples]] - regression tests on the examples<br />
* [[Black Box Regression tests]] - regression tests automatically compiled and tested, including MODISTARC<br />
* [[Regression tests on ScicoLab]] - regression tests on the ScicosLab blocks<br />
<br />
== FLEX Boards ==<br />
<br />
* [[FLEX Demo Daughter Board]] Description of the board<br />
* [[FLEX Demo2 pack for motion control]] Description of the pack<br />
* [[FLEX Multibus Daughter Board]] Description of the board<br />
* [[FLEX Peripheral usage list]] This is an index of some peripherals and board connections used in the FLEX boards, to avoid making device drivers with conflicts on the dsPIC/PIC18 peripherals<br />
* [[FLEX University projects]] An '''incomplete list''' of university projects made using FLEX boards<br />
* [[RS485 on FLEX]] Which pins you should use to connect RS485 hardware to the FLEX boards<br />
* [[How to connect Flex Boards with a Zigbee Transceiver]]<br />
<br />
== Easylab Board ==<br />
<br />
* [[Easylab board: Description & MPLAB IDE Library]] <br />
* [[Easylab board and new dsPIC ERIKA Enterprise Driver API]]<br />
* [[Using Easylab board with ScicosLab]]<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram|Using Easylab board with ScicosLab]].<br />
<br />
= Related Projects =<br />
<br />
== Scicoslab ==<br />
<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram]]<br />
* [[Tutorial: Generating code from a Scicos diagram targeting Easylab Board]]<br />
* [[Tutorial: Simulate and then generating code from a Scicos diagram]]<br />
* [[Scicos Blocks]]<br />
* Customizations<br />
** [[How to add a new Scicos block to ERIKA Enterprise]]<br />
** [[How to use Scicos-FLEX on non-FLEX boards]]<br />
* [[USB communication using FLEX FULL Demo Board and the Scilab/Scicos code generator]]<br />
* [[Amazing Ball Introduction]]<br />
* Links to courses and material on how to use Scicos for Embedded code design:<br />
** http://www.dii.unisi.it/~giannibi/teaching (look at the pages of "Progetto dei Sistemi di Controllo" and "Controllo Digitale" (in Italian)<br />
* [http://www.stargate-tr.com/?page_id=799 ScicosPowerLab] - could be interesting to link it to Scicos-FLEX!<br />
* Course material<br />
** [[ScicosLab Course October 2010 - Florence]]<br />
** [[ScicosLab Course November 2010 - Malaysia]] (updated material on 2011-01-28!)<br />
<br />
* Links to material on how to use FLEX and Erika Enterprise to control application design<br />
** [[Universitat Politècnica de Catalunia (Intelligent Robotics and Systems research group, Automatic Control Department)]]<br />
<br />
== SMCube ==<br />
<br />
These pages are a set of online resource created by SMCube users:<br />
<br />
* [[SMCube examples]]<br />
<br />
== FPG-EYE ==<br />
* [[FPG-EYE hardware and software]]<br />
* [[Installation of Mico32/FPG-EYE development environment]]<br />
* [[Tutorial: Building a Mico32 platform for FPG-EYE]]<br />
* [[Tutorial: Running ERIKA on Mico32 and FPG-EYE]]<br />
* [[CAL support on FPG-EYE]]<br />
<br />
== Matlab/Simulink code generation ==<br />
<br />
* [[Matlab/Simulimk code generator description]]<br />
<br />
== CAL Language ==<br />
<br />
* [[Brief introduction to the CAL language]]<br />
* [[CAL support on ERIKA Enterprise]] - how the CAL Language is integrated together with ERIKA<br />
* [[CAL support on FPG-EYE]] - how to integrate the CAL to Verilog toolchain on the FPG-EYE board<br />
<br />
=== Tutorials ===<br />
* [[Tutorial: Installing CAL with ERIKA Enterprise]]<br />
* [[Tutorial: Compiling a CAL application with ERIKA Enterprise]]<br />
<br />
=== Interesting links ===<br />
* [http://www.actors-project.eu ACTORS Project]<br />
* [http://www.actors-project.eu/index.php?page=public-deliverables ACTORS Deliverables]<br />
* [http://embedded.eecs.berkeley.edu/caltrop/ CALTrop]<br />
* [http://sourceforge.net/projects/opendf/ OpenDF]<br />
<br />
== EICASLAB ==<br />
<br />
This wiki part is dedicated to material about the EICASLab Code Generator for ERIKA Enterprise<br />
<br />
* [[YouTube videos]] - This lists the EICASLab webinars<br />
<br />
= List of publications =<br />
<br />
* [[Journal publications related to ERIKA and RT-Druid]]<br />
* [[Conference publications related to ERIKA and RT-Druid]]<br />
* [[Demo publications related to ERIKA and RT-Druid]]<br />
<br />
= Wikimedia Useful Links =<br />
<br />
* [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]<br />
* [http://www.mediawiki.org/wiki/Help:FAQ MediaWiki FAQ]<br />
<br />
= Thanks = <br />
<br />
ErikaWiki is hosted by TuxFamily.org<br />
<br />
[http://www.tuxfamily.org [[Image:Powered_tf1.png]]]</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Main_PageMain Page2012-02-01T09:42:40Z<p>Salva: /* Easylab Board */</p>
<hr />
<div>= ERIKA Enterprise and RT-Druid =<br />
<br />
[[ERIKA Enterprise and RT-Druid Design Flow]]<br />
<br />
[[:Category:ERIKA internals|ERIKA internals category]]<br />
<br />
[[RT-Druid configuration]]<br />
<br />
[[People]] - a (probably incomplete) list of people who contributed to the project, in alphabetical order<br />
<br />
[[TODO List]]<br />
<br />
== Download and SVN ==<br />
* [[ERIKA Enterprise and RT-Druid SVN Access]]<br />
* [[Known Issues]]<br />
<br />
== Supported Devices ==<br />
<br />
This is a list of the architectures supported by ERIKA Enterprise and RT-Druid<br />
<br />
* [[Altera Nios II]]<br />
* [[ARM7TDMI]]<br />
* [[Atmel AVR5]]<br />
* [[ARM Cortex MX]]<br />
* [[EnSilica eSi-RISC]]<br />
* [[Freescale PPC e200 (MPC 56xx)]] (including PPC e200 z0, z6, z7)<br />
* [[Freescale S12]]<br />
* [[Infineon Tricore]]<br />
* [[Lattice Mico32]]<br />
* [[Microchip dsPIC]] (including dsPIC30, dsPIC33, and PIC24)<br />
* [[Microchip PIC32]]<br />
* [[TI MSP430]]<br />
<br />
Howtos<br />
* [[Porting ERIKA Enterprise and RT-Druid to a new microcontroller]]<br />
<br />
Support for Hitachi H8, C167/ST10 has been moved in the "old" session since there has been not much work on them and we cannot guarantee they still compile. If interested in them just write us an e-mail!<br />
<br />
== Tutorials and Online Documentation ==<br />
The following links contain links to specific themes, which in the past were separate PDF manuals.<br />
<br />
* [[Tutorial: Installing ERIKA and RT-Druid, and compile your first application]] on Windows hosts<br />
* [[Tutorial: Installing ERIKA and RT-Druid on a Linux host]]<br />
* [[Erika_path_in_RT-Druid| Set Erika path and show Erika sources in RT-Druid]]<br />
* [[Tutorial: Develop RT-Druid plugins]]<br />
* [[Tutorial: Update ERIKA and RT-Druid]]<br />
* [[Tutorial: RT-Druid and OIL basics]]<br />
* [[Tutorial: RT-Druid and OIL code generation using XML and XSLT transformations]]<br />
* [[Tutorial: Use a customized makefile]]<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram]]<br />
* Tutorial: [[Amazing Ball Introduction]]<br />
* [[Tutorial: S12XS - First installation and application compilation on Windows]]<br />
Videos<br />
* [[YouTube videos]]<br />
<br />
== Regression Tests ==<br />
<br />
* [[Regression tests on Examples]] - regression tests on the examples<br />
* [[Black Box Regression tests]] - regression tests automatically compiled and tested, including MODISTARC<br />
* [[Regression tests on ScicoLab]] - regression tests on the ScicosLab blocks<br />
<br />
== FLEX Boards ==<br />
<br />
* [[FLEX Demo Daughter Board]] Description of the board<br />
* [[FLEX Demo2 pack for motion control]] Description of the pack<br />
* [[FLEX Multibus Daughter Board]] Description of the board<br />
* [[FLEX Peripheral usage list]] This is an index of some peripherals and board connections used in the FLEX boards, to avoid making device drivers with conflicts on the dsPIC/PIC18 peripherals<br />
* [[FLEX University projects]] An '''incomplete list''' of university projects made using FLEX boards<br />
* [[RS485 on FLEX]] Which pins you should use to connect RS485 hardware to the FLEX boards<br />
* [[How to connect Flex Boards with a Zigbee Transceiver]]<br />
<br />
== Easylab Board ==<br />
<br />
* [[Easylab board: Description & MPLAB IDE Library]] <br />
* [[Easylab board and new dsPIC ERIKA Enterprise Driver API]]<br />
* [[Using Easylab board with ScicosLab]]<br />
* [[page name#section name|displayed text]].<br />
<br />
= Related Projects =<br />
<br />
== Scicoslab ==<br />
<br />
* [[Tutorial: Installing scicoslab and generating code from a Scicos diagram]]<br />
* [[Tutorial: Generating code from a Scicos diagram targeting Easylab Board]]<br />
* [[Tutorial: Simulate and then generating code from a Scicos diagram]]<br />
* [[Scicos Blocks]]<br />
* Customizations<br />
** [[How to add a new Scicos block to ERIKA Enterprise]]<br />
** [[How to use Scicos-FLEX on non-FLEX boards]]<br />
* [[USB communication using FLEX FULL Demo Board and the Scilab/Scicos code generator]]<br />
* [[Amazing Ball Introduction]]<br />
* Links to courses and material on how to use Scicos for Embedded code design:<br />
** http://www.dii.unisi.it/~giannibi/teaching (look at the pages of "Progetto dei Sistemi di Controllo" and "Controllo Digitale" (in Italian)<br />
* [http://www.stargate-tr.com/?page_id=799 ScicosPowerLab] - could be interesting to link it to Scicos-FLEX!<br />
* Course material<br />
** [[ScicosLab Course October 2010 - Florence]]<br />
** [[ScicosLab Course November 2010 - Malaysia]] (updated material on 2011-01-28!)<br />
<br />
* Links to material on how to use FLEX and Erika Enterprise to control application design<br />
** [[Universitat Politècnica de Catalunia (Intelligent Robotics and Systems research group, Automatic Control Department)]]<br />
<br />
== SMCube ==<br />
<br />
These pages are a set of online resource created by SMCube users:<br />
<br />
* [[SMCube examples]]<br />
<br />
== FPG-EYE ==<br />
* [[FPG-EYE hardware and software]]<br />
* [[Installation of Mico32/FPG-EYE development environment]]<br />
* [[Tutorial: Building a Mico32 platform for FPG-EYE]]<br />
* [[Tutorial: Running ERIKA on Mico32 and FPG-EYE]]<br />
* [[CAL support on FPG-EYE]]<br />
<br />
== Matlab/Simulink code generation ==<br />
<br />
* [[Matlab/Simulimk code generator description]]<br />
<br />
== CAL Language ==<br />
<br />
* [[Brief introduction to the CAL language]]<br />
* [[CAL support on ERIKA Enterprise]] - how the CAL Language is integrated together with ERIKA<br />
* [[CAL support on FPG-EYE]] - how to integrate the CAL to Verilog toolchain on the FPG-EYE board<br />
<br />
=== Tutorials ===<br />
* [[Tutorial: Installing CAL with ERIKA Enterprise]]<br />
* [[Tutorial: Compiling a CAL application with ERIKA Enterprise]]<br />
<br />
=== Interesting links ===<br />
* [http://www.actors-project.eu ACTORS Project]<br />
* [http://www.actors-project.eu/index.php?page=public-deliverables ACTORS Deliverables]<br />
* [http://embedded.eecs.berkeley.edu/caltrop/ CALTrop]<br />
* [http://sourceforge.net/projects/opendf/ OpenDF]<br />
<br />
== EICASLAB ==<br />
<br />
This wiki part is dedicated to material about the EICASLab Code Generator for ERIKA Enterprise<br />
<br />
* [[YouTube videos]] - This lists the EICASLab webinars<br />
<br />
= List of publications =<br />
<br />
* [[Journal publications related to ERIKA and RT-Druid]]<br />
* [[Conference publications related to ERIKA and RT-Druid]]<br />
* [[Demo publications related to ERIKA and RT-Druid]]<br />
<br />
= Wikimedia Useful Links =<br />
<br />
* [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide]<br />
* [http://www.mediawiki.org/wiki/Help:FAQ MediaWiki FAQ]<br />
<br />
= Thanks = <br />
<br />
ErikaWiki is hosted by TuxFamily.org<br />
<br />
[http://www.tuxfamily.org [[Image:Powered_tf1.png]]]</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T16:53:07Z<p>Salva: /* PWM Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
<br />
== '''PWM Channels''' ==<br />
<br />
The EasyLab board has 4 independent and configurable pwm output (''PWM1'', ''PWM2'', ''PWM3'' and ''PWM4''). <br />
These outputs can work also how two both pwm configuration (''PWM12'', ''PWM1'' together ''PWM2'' and ''PWM34'', ''PWM3'' with ''PWM4'').<br />
In the OIL file need to use the flag '''USEPWM''':<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEPWM = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The PWM's API are the follow:<br />
<br />
* ''EE_INT16 EE_easylab_pwm_init(EE_UINT8 pwm_pin, EE_UINT32 pwm_freq);''<br />
*: Description: Initialize an specific PWM channel. The parameter can be used are the follow:<br />
** '''pwm_pin''': Is the PWM channel, its values can be: <br />
*** EE_EASYLAB_PWM1<br />
*** EE_EASYLAB_PWM2<br />
*** EE_EASYLAB_PWM3<br />
*** EE_EASYLAB_PWM4<br />
*** EE_EASYLAB_PWM12<br />
*** EE_EASYLAB_PWM34<br />
** '''pwm_freq''': pwm frequency<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT16 EE_easylab_pwm_close(EE_UINT8 pwm_pin);''<br />
*: Description: Close the specific PWM channel passed as parameter.<br />
** '''pwm_pin''': Is the PWM channel, its values can be: <br />
*** EE_EASYLAB_PWM1<br />
*** EE_EASYLAB_PWM2<br />
*** EE_EASYLAB_PWM3<br />
*** EE_EASYLAB_PWM4<br />
*** EE_EASYLAB_PWM12<br />
*** EE_EASYLAB_PWM34<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT16 EE_easylab_pwm_set_duty(EE_UINT8 pwm_pin, EE_UINT16 duty);''<br />
*: Description: Set the duty-cycle at specific PWM channel passed as parameter.<br />
** '''pwm_pin''': Is the PWM channel, its values can be: <br />
*** EE_EASYLAB_PWM1<br />
*** EE_EASYLAB_PWM2<br />
*** EE_EASYLAB_PWM3<br />
*** EE_EASYLAB_PWM4<br />
*** EE_EASYLAB_PWM12<br />
*** EE_EASYLAB_PWM34<br />
** '''duty''': duty-cycle<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T16:51:06Z<p>Salva: </p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
<br />
== '''PWM Channels''' ==<br />
<br />
The EasyLab board has 4 independent and configurable pwm output (''PWM1'', ''PWM2'', ''PWM3'' and ''PWM4''). <br />
These outputs can work also how two both pwm configuration (''PWM12'', ''PWM1'' together ''PWM2'' and ''PWM34'', ''PWM3'' with ''PWM4'').<br />
In the OIL file need to use the flag '''USEPWM''':<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEPWM = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The PWM's API are the follow:<br />
<br />
* ''EE_INT16 EE_easylab_pwm_init(EE_UINT8 pwm_pin, EE_UINT32 pwm_freq);''<br />
*: Description: Initialize an specific PWM channel. The parameter can be used are the follow:<br />
** '''pwm_pin''': Is the PWM channel, its values can be: <br />
*** EE_EASYLAB_PWM1<br />
*** EE_EASYLAB_PWM2<br />
*** EE_EASYLAB_PWM3<br />
*** EE_EASYLAB_PWM4<br />
*** EE_EASYLAB_PWM12<br />
*** EE_EASYLAB_PWM34<br />
** '''pwm_freq''': pwm frequency<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT16 EE_easylab_pwm_close(EE_UINT8 pwm_pin);''<br />
*: Description: Close the specific PWM channel passed as parameter.<br />
** '''pwm_pin''': Is the PWM channel, its values can be: <br />
*** EE_EASYLAB_PWM1<br />
*** EE_EASYLAB_PWM2<br />
*** EE_EASYLAB_PWM3<br />
*** EE_EASYLAB_PWM4<br />
*** EE_EASYLAB_PWM12<br />
*** EE_EASYLAB_PWM34<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T16:48:56Z<p>Salva: /* PWM Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
<br />
== '''PWM Channels''' ==<br />
<br />
The EasyLab board has 4 independent and configurable pwm output (''PWM1'', ''PWM2'', ''PWM3'' and ''PWM4''). <br />
These outputs can work also how two both pwm configuration (''PWM12'', ''PWM1'' together ''PWM2'' and ''PWM34'', ''PWM3'' with ''PWM4'').<br />
In the OIL file need to use the flag '''USEPWM''':<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEPWM = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The PWM's API are the follow:<br />
<br />
* ''EE_INT16 EE_easylab_pwm_init(EE_UINT8 pwm_pin, EE_UINT32 pwm_freq);''<br />
*: Description: Initialize an specific PWM channel. The parameter can be used are the follow:<br />
** '''pwm_pin''': Is the PWM channel, its values can be: <br />
*** EE_EASYLAB_PWM1<br />
*** EE_EASYLAB_PWM2<br />
*** EE_EASYLAB_PWM3<br />
*** EE_EASYLAB_PWM4<br />
*** EE_EASYLAB_PWM12<br />
*** EE_EASYLAB_PWM34<br />
** '''pwm_freq''': pwm frequency</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T16:47:41Z<p>Salva: </p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
<br />
== '''PWM Channels''' ==<br />
<br />
The EasyLab board has 4 independent and configurable pwm output (''PWM1'', ''PWM2'', ''PWM3'' and ''PWM4''). <br />
These outputs can work also how two both pwm configuration (''PWM12'', ''PWM1'' together ''PWM2'' and ''PWM34'', ''PWM3'' with ''PWM4'').<br />
In the OIL file need to use the flag '''USEPWM''':<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEPWM = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The PWM's API are the follow:<br />
<br />
* ''EE_INT16 EE_easylab_pwm_init(EE_UINT8 pwm_pin, EE_UINT32 pwm_freq);''<br />
*: Description: Initialize an specific PWM channel. The parameter can be used are the follow:<br />
** '''pwm_pin''': Is the PWM channel, its values can be: <br />
*** EE_EASYLAB_PWM1<br />
*** EE_EASYLAB_PWM2<br />
*** EE_EASYLAB_PWM3<br />
*** EE_EASYLAB_PWM4<br />
*** EE_EASYLAB_PWM12<br />
*** EE_EASYLAB_PWM34</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T16:44:14Z<p>Salva: /* Digital Pins I/O */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
<br />
== '''PWM Channels''' ==<br />
<br />
The EasyLab board has 4 independent and configurable pwm output (''PWM1'', ''PWM2'', ''PWM3'' and ''PWM4''). <br />
These outputs can work also how two both pwm configuration (''PWM12'', ''PWM1'' together ''PWM2'' and ''PWM34'', ''PWM3'' with ''PWM4'').<br />
In the OIL file need to use the flag '''USEPWM''':<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEPWM = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The PWM's API are the follow:</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T16:44:05Z<p>Salva: /* Digital Pin I/O */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pins I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
<br />
== '''PWM Channels''' ==<br />
<br />
The EasyLab board has 4 independent and configurable pwm output (''PWM1'', ''PWM2'', ''PWM3'' and ''PWM4''). <br />
These outputs can work also how two both pwm configuration (''PWM12'', ''PWM1'' together ''PWM2'' and ''PWM34'', ''PWM3'' with ''PWM4'').<br />
In the OIL file need to use the flag '''USEPWM''':<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEPWM = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The PWM's API are the follow:</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T16:43:32Z<p>Salva: /* ADC Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
<br />
== '''PWM Channels''' ==<br />
<br />
The EasyLab board has 4 independent and configurable pwm output (''PWM1'', ''PWM2'', ''PWM3'' and ''PWM4''). <br />
These outputs can work also how two both pwm configuration (''PWM12'', ''PWM1'' together ''PWM2'' and ''PWM34'', ''PWM3'' with ''PWM4'').<br />
In the OIL file need to use the flag '''USEPWM''':<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEPWM = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The PWM's API are the follow:</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T15:54:00Z<p>Salva: /* ADC Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_INT8 EE_easylab_adc_start(void):''<br />
*: Description: Start ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_stop(void):''<br />
*: Description: Stop ADC sampling.<br />
** return value: 0 if no errors happened. Otherwise appropriate error value (negative value).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T15:48:00Z<p>Salva: /* ADC Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT <br />
* return value: 0 if no errors happend. Otherwise appropriate error value (negative value).<br />
* ''EE_INT8 EE_easylab_adc_get_ch_uint(EE_AdcChId adc_ch_id, EE_UINT16 * value );''<br />
*: Description: Acquire analog value on specific input.<br />
** '''adc_ch_id''': Channel's ID to acquire.<br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''*value''': return value conversion pointer.<br />
* return value: 0 if no errors happend. Otherwise appropriate error value (negative value).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T15:41:15Z<p>Salva: /* ADC Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: <br />
*** EE_ADC_AN1<br />
*** EE_ADC_AN2<br />
*** EE_ADC_AN3<br />
*** EE_ADC_AN4<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** ''EE_ADC_VDD_VSS''<br />
*** ''EE_ADC_VREFh_VSS''<br />
*** ''EE_ADC_VDD_VREFl''<br />
*** ''EE_ADC_VREFh_VREFl''<br />
** '''bit_res''' : Is the resolution of the ADC. <br />
*** EE_ADC_10_BIT<br />
*** EE_ADC_12_BIT</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T15:02:22Z<p>Salva: /* ADC Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
** '''adc_ch_id''': Is the ADC channel, the value can be: EE_ADC_AN1, EE_ADC_AN2, EE_ADC_AN3 or EE_ADC_AN4.<br />
** '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*** EE_ADC_VDD_VSS = 0x0,<br />
*** EE_ADC_VREFh_VSS = 0x1,<br />
*** EE_ADC_VDD_VREFl = 0x02,<br />
*** EE_ADC_VREFh_VREFl = 0x7</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T15:01:24Z<p>Salva: /* ADC Channels */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
* '''adc_ch_id''': Is the ADC channel, the value can be: EE_ADC_AN1, EE_ADC_AN2, EE_ADC_AN3 or EE_ADC_AN4.<br />
* '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
* EE_ADC_VDD_VSS = 0x0,<br />
* EE_ADC_VREFh_VSS = 0x1,<br />
* EE_ADC_VDD_VREFl = 0x02,<br />
* EE_ADC_VREFh_VREFl = 0x7</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T15:00:47Z<p>Salva: </p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Initialize an specific ADC channel. The parameter can be used are the follow:<br />
*: '''adc_ch_id''': Is the ADC channel, the value can be: EE_ADC_AN1, EE_ADC_AN2, EE_ADC_AN3 or EE_ADC_AN4.<br />
*: '''volt_ref''' : Is the Ref for ADC conversion. At this parameter can be assigned the follow value:<br />
*: EE_ADC_VDD_VSS = 0x0,<br />
*: EE_ADC_VREFh_VSS = 0x1,<br />
*: EE_ADC_VDD_VREFl = 0x02,<br />
*: EE_ADC_VREFh_VREFl = 0x7</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T14:47:28Z<p>Salva: /* Buzzer */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.<br />
<br />
== '''ADC Channels''' ==<br />
<br />
The EasyLab board has 4 input analog to digital converter (ADCx). If an application uses the ADC functionality in necessary modified the OIL file adding the option USEADC:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEADC = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ADC's API are the follow:<br />
<br />
* ''EE_INT8 EE_easylab_adc_init_ch(EE_AdcChId adc_ch_id, EE_Adc_VoltageRef volt_ref, EE_Adc_BitResolution bit_res);''<br />
*: Description: Inizialize . The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T14:06:44Z<p>Salva: /* Digital Pin I/O */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.<br />
<br />
== '''Buzzer''' ==<br />
<br />
On the EasyLab board is present a simple piezo buzzer. When the users wants use it in a his project, he has to write, in the OIL file, something like this:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEBUZZER = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The API are the follow:<br />
<br />
* ''void EE_buzzer_start(EE_UINT16 freq);''<br />
*: Description: Start on the buzzer. The parameter '''freq''' is the frequency value and it's value is from 100 to 48000 Hz.<br />
* ''void EE_buzzer_stop(void);''<br />
*: Description: Turn off the buzzer sound.</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:50:46Z<p>Salva: /* Digital Pin I/O = */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ==<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in''' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in=1''' the output pin is '''1''' logic, while if the parameter '''in=0''' the output pin is '''0''' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:49:36Z<p>Salva: </p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ===<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
* ''void EE_diox_configure(EE_BIT in); (x=1,...,8)''<br />
*: Description: Initialize the pin'''x''' (x=1,...,8). If the '''in'' parameter is '''0''' (zero) the pin is output while '''1''' is input.<br />
* ''void EE_diox_write(EE_BIT bit); (x=1,...,8)''<br />
*: Description: If the parameter '''in'''=1 the output pin is ''1'' logic, while if the parameter '''in'''=0 the output pin is ''0'' logic.<br />
* ''int EE_BIT EE_diox_read(void); (x=1,...,8)''<br />
*: Description: The API return the logic value on pin'''x''' when it is configured as input.</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:40:32Z<p>Salva: /* Digital Pin I/O = */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ===<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:<br />
<br />
void EE_dio1_configure(EE_BIT in)</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:39:44Z<p>Salva: /* Board LEDs */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).<br />
<br />
== '''Digital Pin I/O''' ===<br />
<br />
The same pins connected to board LEDS can be used how general ''Digital Pin I/O''. These pins are exported on board connectors.<br />
<br />
For their use on the board the developer have to specify the '''USE_DIO''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''DIO'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USEDIO = TRUE;<br />
...<br />
}<br />
...<br />
</pre> <br />
<br />
The ''API'' than uses the digital pins I/O (DIO) are the follow:</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:25:33Z<p>Salva: /* Board LEDs */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.<br />
* ''void EE_ledx_on(void); (x=1,...,8)''<br />
*: Description: Turn on the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_off(void); (x=1,...,8)''<br />
*: Description: Turn off the LED'''x''' present on the board (x=1,...,8).<br />
* ''void EE_led1_toggle(void); (x=1,...,8)''<br />
*: Description: Toggle the LED'''x''' present on the board (x=1,...,8).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:20:58Z<p>Salva: /* Board LEDs */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).<br />
* ''void EE_ledx_init(void); (x=1,...,8)''<br />
*: Description: Initialize the LED'''x''' present on the board (x=1,...,8). The LED starts turned off.</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:18:26Z<p>Salva: </p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
== '''System LED''' ==<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
== '''Board LEDs''' ==<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T13:17:16Z<p>Salva: </p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
'''System LED'''<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
</pre><br />
...<br />
<br />
The following paragraphs will describe the functions available to control the easyLab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Initialize the system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).<br />
<br />
'''Board LEDs'''<br />
<br />
The EasyLab includes 8 red LEDs. To use the board LEDs the developer have to specify the '''USELEDS''' attribute as '''TRUE''', as in the following example (same ''OIL'' configuration of the '''System LED'''):<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
</pre><br />
...<br />
<br />
The ''API'' for board LEDS control are the follow:<br />
<br />
* ''void EE_leds_init(void);''<br />
*: Description: Initialize all LEDS present on the board. The LEDs starts turned off.<br />
* ''void EE_leds_enable(void);''<br />
*: Description: Turn on all the LEDs present on the board (system LED too).<br />
* ''void EE_leds_disable(void);''<br />
*: Description: Turn off all the LEDs present on the board (system LED too).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board_and_new_dsPIC_ERIKA_Enterprise_Driver_APIEasylab board and new dsPIC ERIKA Enterprise Driver API2012-01-31T11:26:22Z<p>Salva: /* Easylab Board API */</p>
<hr />
<div>= Introduction =<br />
<br />
During the development of Erika support for easylab some new API have created and other ones have been updated.<br />
Follow an overview of these changes, but to be sure that the information of this page are updated double check the code.<br />
<br />
= Easylab Board API =<br />
<br />
The [http://www.evidence.eu.com/products/easy-lab.html EasyLab board] is fully supported by [http://erika.tuxfamily.org/ Erika Rtos].<br />
This chapter describes the API support done in Erika Enterprise for the Evidence EasyLab Board.<br />
To configure the usage of the EasyLab Board, the user has to specify an appropriate '''BOARD_DATA''' in ''OIL'' file , as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
...<br />
}<br />
...<br />
</pre><br />
<br />
this ''OIL'' element enable the inclusion of ''pkg/board/ee_easylab/inc/ee_board.h'' as board header.<br />
<br />
<br />
'''System LED'''<br />
<br />
The [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstic] Guest board has a system LED attached to a GPIO pin of the microcontroller. To use the system LED, the developer should specify the '''USELEDS''' attribute as '''TRUE''', as in the following example:<br />
<br />
<pre><br />
...<br />
BOARD_DATA = EE_EASYLAB {<br />
USELEDS = TRUE;<br />
...<br />
}<br />
</pre><br />
...<br />
<br />
The following paragraphs will describe the functions available to control the easylab System LED.<br />
<br />
* ''void EE_sys_led_init(void);''<br />
*: Description: Inizializzazione system LED (the one on microstick). The LED starts turned off.<br />
* ''void EE_sys_led_on(void);''<br />
*: Description: The function turns on the system LED (the one on microstick).<br />
* ''void EE_led_sys_off(void);''<br />
*: Description: The function turns off the system LED (the one on microstick).</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Easylab_supply.pngFile:Easylab supply.png2012-01-31T10:49:20Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=Easylab_board:_Description_%26_MPLAB_IDE_LibraryEasylab board: Description & MPLAB IDE Library2012-01-31T10:46:18Z<p>Salva: </p>
<hr />
<div>= Description =<br />
<br />
[http://www.evidence.eu.com/products/easy-lab.html Easylab board] is prototyping board developed by [http://www.evidence.eu.com/ Evidence Srl]. It's essentially an expansion board of the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microchip Microstick dsPIC33F and PIC24H Development Board].<br><br />
<br />
[[File:easylab_diagram_block.png|center|thumb|300px| EasyLab simple diagram block]]<br />
<br />
Key Features:<br />
<br />
* RS232 to USB Interface to PC for board control.<br />
* Power supply 5V DC from USB cable.<br />
* miniUSB In-System Programming (ISP) for Microstick module.<br />
* 8 Pin I/O, configurable as input or output, for general use.<br />
* 8 LEDS on each I/O pin.<br />
* 2 Configurable Output PWM to drive dc-motor in motion control.<br />
* 2 Low Pass Filter on each PWM to obtain a programmable dc voltage.<br />
* All I/O ports easily accessible through pin header connectors.<br />
<br />
<br />
<br />
= EasyLab Connecting the Hardware =<br />
<br />
The EasyLab needs to run two USB cables. The first cable is a miniUSB (''A'' in the follow picture) is for programming/debugging and<br />
power supply of the Microchip MicroStick. The second cable, a normal USB, is for pc to board communication and power supply of the expansion board.<br><br />
<br />
[[File:easylab_supply.png|center|thumb|300px| EasyLab needs two USB cable to run]] <br />
<br />
= Easylab simple Library =<br />
<br />
There is a very simple library in the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. The library consists in a C file (easylab.c) and the relative header file (easylab.h). These files have written to be compiled by [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 Microchip C30 compiler]. In the EasyLab library use some Microchip C30's API , so is necessary to install a Microchip C30 compiler for dsPIC (we tested with version 3.25) for try them. <br />
<br />
API Software description:<br />
<br />
* Configure dspic pins in realation with board layout<br />
* Set/Get actual clock frequency (with internal FRC with PLL)<br />
* Turn on/off & toggle leds<br />
* Read/Write DIO pins<br />
* Configure up to 2 General Purpose Timers<br />
* Start and stop a buzzer with a given forcing frequency<br />
* Configure one of 4 ADC channels and sample that synchronously<br />
* Configure 2 couple of PWM pins in any combination of PWM/override, with given frequency and duty cycle<br />
* Serial comunication with UART serial over USB<br />
<br />
The library has been coded with dsPIC33FJ64MC802 as only test target, even though [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en548414 Microstick] package come with a PIC24FJ64GP too.<br />
<br />
= Easylab Library in a MPLAB's example =<br />
<br />
Easylab Library comes with a complete example that shows the usage of some features of the board like PWM, ADC, Buzzer, USB/Serial and leds.<br />
The library and the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB's]. project are placed in the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet].<br><br />
In the [[How Compile and Run a MPLAB's project]] are placed all the instruction to do it.<br><br />
At the beginning the test configure the PWM and the ADC channels. Then, using a simple cable, the user can connect the analogic output (AOx for PWM channel x) to the AD converter (ANx for ADC channel x). The value measured by the AD converter is then transmitted to the PC. You can interact with the application with any serial console (e.g Putty.exe, HyperTerminal, HTerm etc...).<br />
<br />
So application steps are:<br />
<br />
# Select the PWM channel.<br />
# Select the ADC channel.<br />
# Set the desired voltage value.<br />
# Connect the cable and measure the output voltage.<br />
<br />
You can send 'ESC' char to restart the demo.<br></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Easylab_menu.pngFile:Easylab menu.png2012-01-31T10:45:25Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T10:45:00Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
In '''Menu -> Configure -> Select Device''' please select the device '''dsPIC33FJ64MC802'''.<br />
<br />
[[File:mplab_easylab_select_micro.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
Now in the '''Menu -> Project -> Select Language Toolsuite''' select the '''Microchip C30 toolsuite''' and its location in the your file system.<br />
<br />
[[File:mplab_toolsuite.png|center|thumb|700px| Select '''Language Toolsuite''']]<br />
<br />
Now click on '''Menu -> Project -> Build All''' and the project should be compiled.<br />
<br />
[[File:mplab_easylab_build.png|center|thumb|700px| Build the demo project]] <br />
<br />
Now connect your Easylab with miniUSB supply programming cable and USB communication cable at your Pc.<br />
Select '''Starter Kits programmer''' in '''Menu -> Programmer -> Select Programmer -> Starter Kits'''.<br />
<br />
[[File:mplab_start_kit.png|center|thumb|700px| Select '''Starter Kit''']] <br />
<br />
For the Pc communications please open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
<br />
[[File:hyperterminal.png|center|thumb|700px| Serial communication with EasyLab]] <br />
<br />
Program your board clicking on '''Program''' button (It should have been appeared after you selected the programmer)<br />
Enjoy the kitting effect and a nice stadium choir. :)<br />
Look at your serial terminal, you should get the example instruction on the console.<br />
<br />
[[File:easylab_menu.png|center|thumb|700px| EasyLab Menu]] <br />
<br />
Have fun with it. :D</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Hyperterminal.pngFile:Hyperterminal.png2012-01-31T10:24:12Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T10:23:14Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
In '''Menu -> Configure -> Select Device''' please select the device '''dsPIC33FJ64MC802'''.<br />
<br />
[[File:mplab_easylab_select_micro.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
Now in the '''Menu -> Project -> Select Language Toolsuite''' select the '''Microchip C30 toolsuite''' and its location in the your file system.<br />
<br />
[[File:mplab_toolsuite.png|center|thumb|700px| Select '''Language Toolsuite''']]<br />
<br />
Now click on '''Menu -> Project -> Build All''' and the project should be compiled.<br />
<br />
[[File:mplab_easylab_build.png|center|thumb|700px| Build the demo project]] <br />
<br />
Now connect your Easylab with miniUSB supply programming cable and USB communication cable at your Pc.<br />
Select '''Starter Kits programmer''' in '''Menu -> Programmer -> Select Programmer -> Starter Kits'''.<br />
<br />
[[File:mplab_start_kit.png|center|thumb|700px| Select '''Starter Kit''']] <br />
<br />
For the Pc communications please open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
<br />
[[File:hyperterminal.png|center|thumb|700px| Serial communication with EasyLab]] <br />
<br />
# Program your board ([MAIN TOLLBAR] ->[BUTTON] Program (It should have been appeared after you selected the programmer))<br />
# Enjoy the kitt effect and a nice stadium choir. :)<br />
# Look at your serial teminal, you should get the example instruction on the console.<br />
# Have fun with it. :D</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T10:22:44Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
In '''Menu -> Configure -> Select Device''' please select the device '''dsPIC33FJ64MC802'''.<br />
<br />
[[File:mplab_easylab_select_micro.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
Now in the '''Menu -> Project -> Select Language Toolsuite''' select the '''Microchip C30 toolsuite''' and its location in the your file system.<br />
<br />
[[File:mplab_toolsuite.png|center|thumb|700px| Select '''Language Toolsuite''']]<br />
<br />
Now click on '''Menu -> Project -> Build All''' and the project should be compiled.<br />
<br />
[[File:mplab_easylab_build.png|center|thumb|700px| Build the demo project]] <br />
<br />
Now connect your Easylab with miniUSB supply programming cable and USB communication cable at your Pc.<br />
Select '''Starter Kits programmer''' in '''Menu -> Programmer -> Select Programmer -> Starter Kits'''.<br />
<br />
[[File:mplab_start_kit.png|center|thumb|700px| Select '''Starter Kit''']] <br />
<br />
For the Pc communications please open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
<br />
[[File:minicom.png|center|thumb|700px| Serial communication with EasyLab]] <br />
<br />
# Program your board ([MAIN TOLLBAR] ->[BUTTON] Program (It should have been appeared after you selected the programmer))<br />
# Enjoy the kitt effect and a nice stadium choir. :)<br />
# Look at your serial teminal, you should get the example instruction on the console.<br />
# Have fun with it. :D</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Mplab_start_kit.pngFile:Mplab start kit.png2012-01-31T09:59:19Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T09:59:06Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
In '''Menu -> Configure -> Select Device''' please select the device '''dsPIC33FJ64MC802'''.<br />
<br />
[[File:mplab_easylab_select_micro.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
Now in the '''Menu -> Project -> Select Language Toolsuite''' select the '''Microchip C30 toolsuite''' and its location in the your file system.<br />
<br />
[[File:mplab_toolsuite.png|center|thumb|700px| Select '''Language Toolsuite''']]<br />
<br />
Now click on '''Menu -> Project -> Build All''' and the project should be compiled.<br />
<br />
[[File:mplab_easylab_build.png|center|thumb|700px| Build the demo project]] <br />
<br />
Now connect your Easylab with miniUSB supply programming cable and USB communication cable at your Pc.<br />
Select '''Starter Kits programmer''' in '''Menu -> Programmer -> Select Programmer -> Starter Kits'''.<br />
<br />
[[File:mplab_start_kit.png|center|thumb|700px| Select '''Starter Kit''']] <br />
<br />
<br />
# Open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
# Program your board ([MAIN TOLLBAR] ->[BUTTON] Program (It should have been appeared after you selected the programmer))<br />
# Enjoy the kitt effect and a nice stadium choir. :)<br />
# Look at your serial teminal, you should get the example instruction on the console.<br />
# Have fun with it. :D</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Mplab_easylab_build.pngFile:Mplab easylab build.png2012-01-31T09:53:33Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T09:50:51Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
In '''Menu -> Configure -> Select Device''' please select the device '''dsPIC33FJ64MC802'''.<br />
<br />
[[File:mplab_easylab_select_micro.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
Now in the '''Menu -> Project -> Select Language Toolsuite''' select the '''Microchip C30 toolsuite''' and its location in the your file system.<br />
<br />
[[File:mplab_toolsuite.png|center|thumb|700px| Select '''Language Toolsuite''']]<br />
<br />
Now click on '''Menu -> Project -> Build All''' and the project should be compiled.<br />
<br />
[[File:mplab_easylab_build.png|center|thumb|700px| Build the demo project]] <br />
<br />
Now connect your Easylab with supply-communication cable and connect you microstick board with programmer cable to your computer<br />
<br />
# Build your project ([Project CONTEXT MENU] -> [ITEM] Build All).<br />
# Select Starter Kits programmer ([MAIN MENU] Programmer -> [SUB MENU] Select Programmer -> [ITEM] Starter Kits)<br />
# Open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
# Program your board ([MAIN TOLLBAR] ->[BUTTON] Program (It should have been appeared after you selected the programmer))<br />
# Enjoy the kitt effect and a nice stadium choir. :)<br />
# Look at your serial teminal, you should get the example instruction on the console.<br />
# Have fun with it. :D</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Mplab_toolsuite.pngFile:Mplab toolsuite.png2012-01-31T09:30:18Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T09:29:57Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
In '''Menu -> Configure -> Select Device''' please select the device '''dsPIC33FJ64MC802'''.<br />
<br />
[[File:mplab_easylab_select_micro.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
Now in the '''Menu -> Project -> Select Language Toolsuite''' select the '''Microchip C30 toolsuite''' and its location in the your file system.<br />
<br />
[[File:mplab_toolsuite.png|center|thumb|700px| Select '''Language Toolsuite''']]<br />
<br />
# Connect your Easylab with supply-communication cable and connect you microstick board with programmer cable to your computer<br />
# select dsPIC33FJ64MC802 as target device ([Main Menu] Configure -> Select Device...)<br />
# Choose your Toolsuite (Microchip C30 Toolsuite), eventually give the path to the tools if MPLAB IDE is not able to found them by it self.<br />
# Create a new Project file browsing for the previously created project directory and giving a name to project file in "Save Project As" dialog.<br />
# Add all Easylab Library files at your project.<br />
# After click next until the end of wizard you could uncomment all needed compile defines at begin of easylab.h file or add them to your project build options ([Project CONTEXT MENU] (right click on the project) -> [ITEM] Build Options... -> [TAB] MPLAB C30 ->[GROUP] Preprocessr Macros -> [BUTTON] Add) .<br />
# Build your project ([Project CONTEXT MENU] -> [ITEM] Build All).<br />
# Select Starter Kits programmer ([MAIN MENU] Programmer -> [SUB MENU] Select Programmer -> [ITEM] Starter Kits)<br />
# Open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
# Program your board ([MAIN TOLLBAR] ->[BUTTON] Program (It should have been appeared after you selected the programmer))<br />
# Enjoy the kitt effect and a nice stadium choir. :)<br />
# Look at your serial teminal, you should get the example instruction on the console.<br />
# Have fun with it. :D</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Mplab_easylab_select_micro.pngFile:Mplab easylab select micro.png2012-01-31T09:19:41Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T09:19:25Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
In '''Menu -> Configure -> Select Device''' please select the device '''dsPIC33FJ64MC802'''.<br />
<br />
[[File:mplab_easylab_select_micro.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
<br />
# Connect your Easylab with supply-communication cable and connect you microstick board with programmer cable to your computer<br />
# select dsPIC33FJ64MC802 as target device ([Main Menu] Configure -> Select Device...)<br />
# Choose your Toolsuite (Microchip C30 Toolsuite), eventually give the path to the tools if MPLAB IDE is not able to found them by it self.<br />
# Create a new Project file browsing for the previously created project directory and giving a name to project file in "Save Project As" dialog.<br />
# Add all Easylab Library files at your project.<br />
# After click next until the end of wizard you could uncomment all needed compile defines at begin of easylab.h file or add them to your project build options ([Project CONTEXT MENU] (right click on the project) -> [ITEM] Build Options... -> [TAB] MPLAB C30 ->[GROUP] Preprocessr Macros -> [BUTTON] Add) .<br />
# Build your project ([Project CONTEXT MENU] -> [ITEM] Build All).<br />
# Select Starter Kits programmer ([MAIN MENU] Programmer -> [SUB MENU] Select Programmer -> [ITEM] Starter Kits)<br />
# Open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
# Program your board ([MAIN TOLLBAR] ->[BUTTON] Program (It should have been appeared after you selected the programmer))<br />
# Enjoy the kitt effect and a nice stadium choir. :)<br />
# Look at your serial teminal, you should get the example instruction on the console.<br />
# Have fun with it. :D</div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=File:Mplab_easylab_open_project.pngFile:Mplab easylab open project.png2012-01-31T09:12:51Z<p>Salva: </p>
<hr />
<div></div>Salvahttps://erika.tuxfamily.org/wiki/index.php?title=How_Compile_and_Run_a_MPLAB%27s_projectHow Compile and Run a MPLAB's project2012-01-31T09:12:25Z<p>Salva: /* MPLAB IDE */</p>
<hr />
<div>= Introduction =<br />
<br />
To compile and run the example you should download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002 MPLAB IDE] v8.66 or later. Then please download the [http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en010065&part=SW006012 compiler C30] (a C version compiler for dsPic). For install MPLAB IDE and C30 Compiler please follow the instructions present on the Microchip web site.<br />
<br />
= EasyLab Project Packet =<br />
<br />
We take as example the [http://download.tuxfamily.org/erika/webdownload/easylab/Easylab.zip Easylab Software Packet]. It contains the follow files:<br />
<br />
* '''easy-lab-demo-project.mcp:''' is the MPLAB's project file.<br />
* '''easylab.c:''' is demo library C file.<br />
* '''easylab.h:''' is demo library header file.<br />
* '''main.c:''' is the project main file where is called the library API.<br />
* '''cof:''' is a directory where is placed an programmable ''cof'' file ready to be programmed (without compile the project).<br />
<br />
Put these files in a your working project directory.<br />
<br />
= MPLAB IDE =<br />
<br />
Now please launch the Microchip Mplab ide from your 'Start Program'.<br />
<br />
[[File:mplab_ide.png|center|thumb|700px| Microchip Mplab ide]]<br />
<br />
Now click on ''Open Project'' and select the project where it was decompressed. <br />
<br />
[[File:mplab_easylab_open_project.png|center|thumb|700px| Open the ''EasyLab demo project'']]<br />
<br />
# Connect your Easylab with supply-communication cable and connect you microstick board with programmer cable to your computer<br />
# select dsPIC33FJ64MC802 as target device ([Main Menu] Configure -> Select Device...)<br />
# Choose your Toolsuite (Microchip C30 Toolsuite), eventually give the path to the tools if MPLAB IDE is not able to found them by it self.<br />
# Create a new Project file browsing for the previously created project directory and giving a name to project file in "Save Project As" dialog.<br />
# Add all Easylab Library files at your project.<br />
# After click next until the end of wizard you could uncomment all needed compile defines at begin of easylab.h file or add them to your project build options ([Project CONTEXT MENU] (right click on the project) -> [ITEM] Build Options... -> [TAB] MPLAB C30 ->[GROUP] Preprocessr Macros -> [BUTTON] Add) .<br />
# Build your project ([Project CONTEXT MENU] -> [ITEM] Build All).<br />
# Select Starter Kits programmer ([MAIN MENU] Programmer -> [SUB MENU] Select Programmer -> [ITEM] Starter Kits)<br />
# Open a Serial Terminal (e.g. Putty.exe, HTerm.exe). Configure the port, baud rate (115200),data bits(8 bit), stop bits (1 bit) and parity bits (none). DON'T enable CTS. Connet to the channel.<br />
# Program your board ([MAIN TOLLBAR] ->[BUTTON] Program (It should have been appeared after you selected the programmer))<br />
# Enjoy the kitt effect and a nice stadium choir. :)<br />
# Look at your serial teminal, you should get the example instruction on the console.<br />
# Have fun with it. :D</div>Salva