https://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&feed=atom&action=historyFLEX usb data communication using Scilab and Scicos - Revision history2024-03-28T11:28:28ZRevision history for this page on the wikiMediaWiki 1.16.4https://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=4894&oldid=prevNicola at 08:43, 28 September 20122012-09-28T08:43:57Z<p></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 08:43, 28 September 2012</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Please start by downloading this file:</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>Please start by downloading this file:</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* http://www.evidence.eu.com/download/USB_driver.zip</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* http://www.evidence.eu.com/download<ins class="diffchange diffchange-inline">/flex</ins>/USB_driver.zip</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
</table>Nicolahttps://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=1801&oldid=prevWikiSysop: Recovery from data loss [all of the changes done between 2009Oct2 and 2009Nov2 are recovered this way and will have incorrect history]2009-12-26T19:54:47Z<p>Recovery from data loss [all of the changes done between 2009Oct2 and 2009Nov2 are recovered this way and will have incorrect history]</p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 19:54, 26 December 2009</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>This <del class="diffchange diffchange-inline">demo </del>focuses on the USB data communication between the FLEX Board and a host PC<del class="diffchange diffchange-inline">. The three accelerometer values are represented in a Scicos scope. A pdf guide is included in the zip archive</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>This <ins class="diffchange diffchange-inline">section </ins>focuses on the USB data communication between the FLEX Board and a host PC.</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>* http://www.evidence.eu.com/download/<del class="diffchange diffchange-inline">USB_DEMO_wiki</del>.zip</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Please start by downloading this file:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>* http://www.evidence.eu.com/download/<ins class="diffchange diffchange-inline">USB_driver</ins>.zip</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== PIC18 USB firmware ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== PIC18 USB firmware ==</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The FLEX Full USB connection is provided by the PIC18F2550 that communicates with the dsPIC through a SPI <del class="diffchange diffchange-inline"> </del>protocol. Download the <tt><del class="diffchange diffchange-inline">FLEX_USB</del>.cof</tt> (furnished with ''<del class="diffchange diffchange-inline">USB_DEMO_wiki</del>'' software) inside the microcontroller using MPLAB IDE. Usually, there is no need to change the configuration bits. In some cases the a configuration bit must be changed manually. After importing the cof file, check under MPLAB IDE in Configure → Configuration bits that address 0x300000 has value 0x24. If the proposed value is 0x04 unselect the checkbox and insert the correct value. After flashing the device, reset the board and connect the USB cable. </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The FLEX Full USB connection is provided by the PIC18F2550 that communicates with the dsPIC through a SPI protocol. Download the <tt><ins class="diffchange diffchange-inline">FLEX_USB_PIC18</ins>.cof</tt> (furnished with ''<ins class="diffchange diffchange-inline">USB_driver</ins>'' software) inside the microcontroller using MPLAB IDE. Usually, there is no need to change the configuration bits. In some cases the a configuration bit must be changed manually. After importing the cof file, check under MPLAB IDE in Configure → Configuration bits that address 0x300000 has value 0x24. If the proposed value is 0x04 unselect the checkbox and insert the correct value. After flashing the device, reset the board and connect the USB cable. </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Interfacing with the PC ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== Interfacing with the PC ==</div></td></tr>
<tr><td colspan="2" class="diff-lineno">Line 19:</td>
<td colspan="2" class="diff-lineno">Line 24:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># Click on Update driver → search the driver in the computer → manually search the driver. </div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># Click on Update driver → search the driver in the computer → manually search the driver. </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#; [[image:Usb_1d.jpg|center]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#; [[image:Usb_1d.jpg|center]]</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div># Specify the path of the folder <tt>libusb</tt> furnished with ''<del class="diffchange diffchange-inline">USB_DEMO_wiki</del>'' software (<tt><del class="diffchange diffchange-inline">USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB</del>\libusb</tt>). </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div># Specify the path of the folder <tt>libusb</tt> furnished with ''<ins class="diffchange diffchange-inline">USB_driver</ins>'' software (<tt><ins class="diffchange diffchange-inline">USB_driver</ins>\libusb</tt>). </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#; [[image:Usb_1e.jpg|center]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#; [[image:Usb_1e.jpg|center]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># The PC will load this as a new driver for the FLEX Full Board.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div># The PC will load this as a new driver for the FLEX Full Board.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#; [[image:Usb_2.jpg|center]]</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>#; [[image:Usb_2.jpg|center]]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>== <del class="diffchange diffchange-inline">Creating </del>the USB PC application ==</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>== <ins class="diffchange diffchange-inline">Prerequisites for </ins>the USB PC application ==</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">First of all you have to download and install Visual studio 2008 C++ express edition from the Microsoft website. Then check the support for Visual studio 2008 C++ express edition into your Scilab version. Check this web page: [http://groups.google.com/group/comp.soft-sys.math.scilab/browse_thread/thread/cd70873264c3fd4a]</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">To compile external code, Scilab must detect and support Visual studio 2008 C++ express edition with dynamic link. This is required for using the <tt>flex_usbdll.dll</tt> and <tt>flex_usbdll.lib</tt>.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">To compile the USB demo compilation under Scilab/Scicos, launch Scilab and after the startup execution write:</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"><tt>cd <path of the demo folder><br />exec go.sce;<br />scicos;<br /></tt></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Open the <tt>PC_3ch.cos</tt>' example (schematic is depicted below):</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">[[image:Usb_3.jpg|center]]</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">Connect the FLEX Full Board and then open the simulate menu under Scicos </del>and <del class="diffchange diffchange-inline">click run</del>. The <del class="diffchange diffchange-inline">result is a scope showing in a scope </del>the <del class="diffchange diffchange-inline">three axis accelerometer values</del>. <del class="diffchange diffchange-inline">In the second scope the three accelerometer values of a remote node are depicted</del>. <del class="diffchange diffchange-inline">The remote node is a separate FLEX Board with a ZigBee transceiver (device)</del>. <del class="diffchange diffchange-inline">The FLEX Full Board connected to the PC through USB is the ZigBee coordinator (see the dsPIC coordinator Scicos schematic)</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">* First of all you have to download </ins>and <ins class="diffchange diffchange-inline">install Scilab 4.1.2</ins>. The <ins class="diffchange diffchange-inline">Scilab executable can be found at </ins>the <ins class="diffchange diffchange-inline">following addresses:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[http://www</ins>.<ins class="diffchange diffchange-inline">scilab</ins>.<ins class="diffchange diffchange-inline">org/download/index_download.php?page=old_releases]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[http://www</ins>.<ins class="diffchange diffchange-inline">evidence.eu</ins>.<ins class="diffchange diffchange-inline">com/content/view/293/382/]</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">The block used for </del>the <del class="diffchange diffchange-inline">PC application </del>is the <del class="diffchange diffchange-inline"><tt>flex_usb_datain</tt></del>:</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">* Then you have to download and install Visual studio 2008 C++ express edition from </ins>the <ins class="diffchange diffchange-inline">Microsoft website. To compile external code, Scilab must detect and support Visual studio 2008 C++ express edition with dynamic link. This </ins>is <ins class="diffchange diffchange-inline">required if you want to re-compile </ins>the <ins class="diffchange diffchange-inline">scicos pack dll. </ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">The tool is downloadable at</ins>:</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[http://www.microsoft.com/Express/VC/]</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[<del class="diffchange diffchange-inline">[image</del>:<del class="diffchange diffchange-inline">Usb_4</del>.<del class="diffchange diffchange-inline">jpg|center]</del>]</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">* Then can be useful to download and install the Microchip MPLAB IDE to program the</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">Flex Full microcontroller (dsPIC33FJ256MC710). For the download go to the site:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>[<ins class="diffchange diffchange-inline">http</ins>:<ins class="diffchange diffchange-inline">//www.microchip</ins>.<ins class="diffchange diffchange-inline">com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002</ins>]</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The <del class="diffchange diffchange-inline">number written inside the block represents the logical channel number and this must correspond </del>to <del class="diffchange diffchange-inline">a usb logical channel in the </del>dsPIC <del class="diffchange diffchange-inline">schematic</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">* </ins>The <ins class="diffchange diffchange-inline">next step is </ins>to <ins class="diffchange diffchange-inline">download and install ERIKA Enterprise for Microchip </ins>dsPIC <ins class="diffchange diffchange-inline">and the scicos pack 8.1. The software can be found at:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">[http://www.evidence.eu</ins>.<ins class="diffchange diffchange-inline">com/content/view/293/382/]</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">The block is currently not inserted in the </del>Scicos <del class="diffchange diffchange-inline">palettes (we'll do this in the next version). To add it to an existing palette, please follow the instructions at [[How to add a new Scicos block to ERIKA Enterprise]]</del>.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">== Using </ins>Scicos <ins class="diffchange diffchange-inline">pack 8</ins>.<ins class="diffchange diffchange-inline">1 USB PC application ==</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">== dsPIC ==</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The <ins class="diffchange diffchange-inline">demo description is at [[FLEX usb data communication using Scilab and Scicos]]</ins></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">To test the demo application, the dsPIC needs to be flashed. </del>The <del class="diffchange diffchange-inline">firmware can be found in the folder <tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\cof</tt>.</del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
</table>WikiSysophttps://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=1544&oldid=prevPaolo.gai at 17:40, 30 September 20082008-09-30T17:40:06Z<p></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 17:40, 30 September 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 44:</td>
<td colspan="2" class="diff-lineno">Line 44:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The number written inside the block represents the logical channel number and this must correspond to a usb logical channel in the dsPIC schematic.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>The number written inside the block represents the logical channel number and this must correspond to a usb logical channel in the dsPIC schematic.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">The block is currently not inserted in the Scicos palettes (we'll do this in the next version). To add it to an existing palette, please follow the instructions at [[How to add a new Scicos block to ERIKA Enterprise]].</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== dsPIC ==</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>== dsPIC ==</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>To test the demo application, the dsPIC needs to be flashed. The firmware can be found in the folder <tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\cof</tt>.</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>To test the demo application, the dsPIC needs to be flashed. The firmware can be found in the folder <tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\cof</tt>.</div></td></tr>
</table>Paolo.gaihttps://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=1543&oldid=prevPaolo.gai at 13:25, 29 September 20082008-09-29T13:25:53Z<p></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 13:25, 29 September 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 3:</td>
<td colspan="2" class="diff-lineno">Line 3:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"><h3></del>PIC18 USB firmware<del class="diffchange diffchange-inline"></h3></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">== </ins>PIC18 USB firmware <ins class="diffchange diffchange-inline">==</ins></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The FLEX Full USB connection is provided by the PIC18F2550 that communicates with the dsPIC through a SPI protocol. Download the <tt>FLEX_USB.cof</tt> (furnished with ''USB_DEMO_wiki'' software) inside the microcontroller using MPLAB IDE. Usually, there is no need to change the configuration bits. In some cases the a configuration bit must be changed manually. After importing the cof file, check under MPLAB IDE in Configure → Configuration bits that address 0x300000 has value 0x24. If the proposed value is 0x04 unselect the checkbox and insert the correct value. After flashing the device, reset the board and connect the USB cable. The PC automatically recognize the device as a HID device. Open the PC control panel → system → device manager: open the Human Interface Device<del class="diffchange diffchange-inline">, and double </del>click on one of the devices, in order to identify the device with VID = 0x04d8 and PID = 0x0033 on the property window. This is the FLEX board. Click on the driver tab <del class="diffchange diffchange-inline">and then </del>on <del class="diffchange diffchange-inline">update </del>driver → search the driver in the computer → manually search the driver. Specify the path of the folder <tt>libusb</tt> furnished with ''USB_DEMO_wiki'' software (<tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\libusb</tt>). The PC will load this as a new driver for the FLEX Full Board. <del class="diffchange diffchange-inline">This is a one time operation done before the FLEX Full Board. <br /><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The FLEX Full USB connection is provided by the PIC18F2550 that communicates with the dsPIC through a SPI protocol. Download the <tt>FLEX_USB.cof</tt> (furnished with ''USB_DEMO_wiki'' software) inside the microcontroller using MPLAB IDE. Usually, there is no need to change the configuration bits. In some cases the a configuration bit must be changed manually. After importing the cof file, check under MPLAB IDE in Configure → Configuration bits that address 0x300000 has value 0x24. If the proposed value is 0x04 unselect the checkbox and insert the correct value. After flashing the device, reset the board and connect the USB cable. </div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[[image:<del class="diffchange diffchange-inline">Usb_1a</del>.jpg|center]]<del class="diffchange diffchange-inline"><br /><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[<del class="diffchange diffchange-inline">[image</del>:<del class="diffchange diffchange-inline">Usb_1b</del>.<del class="diffchange diffchange-inline">jpg|center]]<br </del>/<del class="diffchange diffchange-inline">><br </del>/<del class="diffchange diffchange-inline">></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">== Interfacing with the PC ==</ins></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">[[image:Usb_1c</del>.<del class="diffchange diffchange-inline">jpg|center]]<br </del>/<del class="diffchange diffchange-inline">><br </del>/<del class="diffchange diffchange-inline">></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">[[image:Usb_1d</del>.<del class="diffchange diffchange-inline">jpg|center]]</del><<del class="diffchange diffchange-inline">br /</del>><del class="diffchange diffchange-inline"><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">This is a '''one time operation''' that has to be done before using the FLEX Full Board.</ins></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">[[image:Usb_1e</del>.<del class="diffchange diffchange-inline">jpg|center]]</del><<del class="diffchange diffchange-inline">br </del>/><<del class="diffchange diffchange-inline">br /</del>></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline">[[image:Usb_2</del>.<del class="diffchange diffchange-inline">jpg|center]]</del><<del class="diffchange diffchange-inline">br </del>/><del class="diffchange diffchange-inline"><br </del>/<del class="diffchange diffchange-inline">></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"># After programming the Flex board, connect it to the PC</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"># </ins>The PC automatically recognize the device as a HID device. Open the PC control panel → system → device manager: open the Human Interface Device <ins class="diffchange diffchange-inline">(as shown in the Figure below).</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">#; [[image:Usb_1a.jpg|center]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"># Double </ins>click on one of the devices, in order to identify the device with VID = 0x04d8 and PID = 0x0033 on the property window. This is the FLEX board. <ins class="diffchange diffchange-inline">See the Figure below</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">#; [[image:Usb_1b.jpg|center]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"># </ins>Click on the driver tab <ins class="diffchange diffchange-inline">as in the Figure below:</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">#; [[image:Usb_1c.jpg|center]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"># Click </ins>on <ins class="diffchange diffchange-inline">Update </ins>driver → search the driver in the computer → manually search the driver. </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">#; [[image:Usb_1d.jpg|center]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"># </ins>Specify the path of the folder <tt>libusb</tt> furnished with ''USB_DEMO_wiki'' software (<tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\libusb</tt>). </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">#; [[image:Usb_1e.jpg|center]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline"># </ins>The PC will load this as a new driver for the FLEX Full Board.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">#; </ins>[[image:<ins class="diffchange diffchange-inline">Usb_2</ins>.jpg|center]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">== Creating the USB PC application ==</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">First of all you have to download and install Visual studio 2008 C++ express edition from the Microsoft website. Then check the support for Visual studio 2008 C++ express edition into your Scilab version. Check this web page: </ins>[<ins class="diffchange diffchange-inline">http</ins>:<ins class="diffchange diffchange-inline">//groups</ins>.<ins class="diffchange diffchange-inline">google.com</ins>/<ins class="diffchange diffchange-inline">group</ins>/<ins class="diffchange diffchange-inline">comp</ins>.<ins class="diffchange diffchange-inline">soft-sys.math.scilab</ins>/<ins class="diffchange diffchange-inline">browse_thread</ins>/<ins class="diffchange diffchange-inline">thread/cd70873264c3fd4a]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">To compile external code, Scilab must detect and support Visual studio 2008 C++ express edition with dynamic link</ins>. <ins class="diffchange diffchange-inline">This is required for using the </ins><<ins class="diffchange diffchange-inline">tt</ins>><ins class="diffchange diffchange-inline">flex_usbdll</ins>.<ins class="diffchange diffchange-inline">dll</ins></<ins class="diffchange diffchange-inline">tt</ins>> <ins class="diffchange diffchange-inline">and </ins><<ins class="diffchange diffchange-inline">tt</ins>><ins class="diffchange diffchange-inline">flex_usbdll</ins>.<ins class="diffchange diffchange-inline">lib</ins></<ins class="diffchange diffchange-inline">tt</ins>><ins class="diffchange diffchange-inline">.</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">To compile the USB demo compilation under Scilab</ins>/<ins class="diffchange diffchange-inline">Scicos, launch Scilab and after the startup execution write:</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;"><h3>Creating the USB PC application</h3></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;">First of all you have to download and install Visual studio 2008 C++ express edition from the Microsoft website. Then check the support for Visual studio 2008 C++ express edition into your Scilab version. Check this web page: [http://groups.google.com/group/comp.soft-sys.math.scilab/browse_thread/thread/cd70873264c3fd4a]<br /></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;">To compile external code, Scilab must detect and support Visual studio 2008 C++ express edition with dynamic link. This is required for using the <tt>flex_usbdll.dll</tt> and <tt>flex_usbdll.lib</tt>.<br /></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del style="color: red; font-weight: bold; text-decoration: none;">To compile the USB demo compilation under Scilab/Scicos, launch Scilab and after the startup execution write:<br /></del></div></td><td colspan="2"> </td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><tt>cd <path of the demo folder><br />exec go.sce;<br />scicos;<br /></tt></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><tt>cd <path of the demo folder><br />exec go.sce;<br />scicos;<br /></tt></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Open the <tt>PC_3ch.cos</tt>' example (schematic is depicted below):<del class="diffchange diffchange-inline"><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Open the <tt>PC_3ch.cos</tt>' example (schematic is depicted below):</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[[image:Usb_3.jpg|center]]<del class="diffchange diffchange-inline"><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>Connect the FLEX Full Board and then open the simulate menu under Scicos and click run. The result is a scope showing in a scope the three axis accelerometer values. In the second scope the three accelerometer values of a remote node are depicted. The remote node is a separate FLEX Board with a ZigBee transceiver (device). The FLEX Full Board connected to the PC through USB is the ZigBee coordinator (see the dsPIC coordinator Scicos schematic).<del class="diffchange diffchange-inline"><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>[[image:Usb_3.jpg|center]]</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The block used for the PC application is the <tt>flex_usb_datain</tt>:<del class="diffchange diffchange-inline"><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>[[image:Usb_4.jpg|center]]<del class="diffchange diffchange-inline"><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>Connect the FLEX Full Board and then open the simulate menu under Scicos and click run. The result is a scope showing in a scope the three axis accelerometer values. In the second scope the three accelerometer values of a remote node are depicted. The remote node is a separate FLEX Board with a ZigBee transceiver (device). The FLEX Full Board connected to the PC through USB is the ZigBee coordinator (see the dsPIC coordinator Scicos schematic).</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The number written inside the block represents the logical channel number and this must correspond to a usb logical channel in the dsPIC schematic.<del class="diffchange diffchange-inline"><br /><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The block used for the PC application is the <tt>flex_usb_datain</tt>:</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>[[image:Usb_4.jpg|center]]</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div> </div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The number written inside the block represents the logical channel number and this must correspond to a usb logical channel in the dsPIC schematic.</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div><del class="diffchange diffchange-inline"><h3></del>dsPIC<del class="diffchange diffchange-inline"></h3></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins class="diffchange diffchange-inline">== </ins>dsPIC <ins class="diffchange diffchange-inline">==</ins></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>To test the demo application, the dsPIC needs to be flashed. The firmware can be found in the folder <tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\cof</tt>.<del class="diffchange diffchange-inline"><br /></del></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>To test the demo application, the dsPIC needs to be flashed. The firmware can be found in the folder <tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\cof</tt>.</div></td></tr>
</table>Paolo.gaihttps://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=1542&oldid=prevChris at 13:13, 29 September 20082008-09-29T13:13:20Z<p></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 13:13, 29 September 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 7:</td>
<td colspan="2" class="diff-lineno">Line 7:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1a.jpg|center]]<br /><br /></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1a.jpg|center]]<br /><br /></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1b.jpg|center]]<br /><br /></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1b.jpg|center]]<br /><br /></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_1c.jpg|center]]<br /><br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_1d.jpg|center]]<br /><br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_1e.jpg|center]]<br /><br /></ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_2.jpg|center]]<br /><br /></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_2.jpg|center]]<br /><br /></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
</table>Chrishttps://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=1520&oldid=prevNino at 15:31, 23 September 20082008-09-23T15:31:21Z<p></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 15:31, 23 September 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 4:</td>
<td colspan="2" class="diff-lineno">Line 4:</td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><h3>PIC18 USB firmware</h3></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div><h3>PIC18 USB firmware</h3></div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>The FLEX Full USB connection is provided by the PIC18F2550 that communicates with the dsPIC through a SPI protocol. Download the <tt>FLEX_USB.cof</tt> (furnished with ''USB_DEMO_wiki'' software) inside the microcontroller using MPLAB IDE. <del class="diffchange diffchange-inline">There </del>is no need to change the configuration bits. After flashing the device, reset the board and connect the USB cable. The PC automatically recognize the device as a HID device. Open the PC control panel → system → device manager: open the Human Interface Device, and double click on one of the devices, in order to identify the device with VID = 0x04d8 and PID = 0x0033 on the property window. This is the FLEX board. Click on the driver tab and then on update driver → search the driver in the computer → manually search the driver. Specify the path of the folder <tt>libusb</tt> furnished with ''USB_DEMO_wiki'' software (<tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\libusb</tt>). The PC will load this as a new driver for the FLEX Full Board. This is a one time operation done before the FLEX Full Board. <br /><br /></div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>The FLEX Full USB connection is provided by the PIC18F2550 that communicates with the dsPIC through a SPI protocol. Download the <tt>FLEX_USB.cof</tt> (furnished with ''USB_DEMO_wiki'' software) inside the microcontroller using MPLAB IDE. <ins class="diffchange diffchange-inline">Usually, there </ins>is no need to change the configuration bits<ins class="diffchange diffchange-inline">. In some cases the a configuration bit must be changed manually. After importing the cof file, check under MPLAB IDE in Configure → Configuration bits that address 0x300000 has value 0x24. If the proposed value is 0x04 unselect the checkbox and insert the correct value</ins>. After flashing the device, reset the board and connect the USB cable. The PC automatically recognize the device as a HID device. Open the PC control panel → system → device manager: open the Human Interface Device, and double click on one of the devices, in order to identify the device with VID = 0x04d8 and PID = 0x0033 on the property window. This is the FLEX board. Click on the driver tab and then on update driver → search the driver in the computer → manually search the driver. Specify the path of the folder <tt>libusb</tt> furnished with ''USB_DEMO_wiki'' software (<tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\libusb</tt>). The PC will load this as a new driver for the FLEX Full Board. This is a one time operation done before the FLEX Full Board. <br /><br /></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1a.jpg|center]]<br /><br /></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1a.jpg|center]]<br /><br /></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1b.jpg|center]]<br /><br /></div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>[[image:Usb_1b.jpg|center]]<br /><br /></div></td></tr>
</table>Ninohttps://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=1429&oldid=prevShiva at 09:18, 19 August 20082008-08-19T09:18:51Z<p></p>
<table style="background-color: white; color:black;">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr valign='top'>
<td colspan='2' style="background-color: white; color:black;">← Older revision</td>
<td colspan='2' style="background-color: white; color:black;">Revision as of 09:18, 19 August 2008</td>
</tr><tr><td colspan="2" class="diff-lineno">Line 1:</td>
<td colspan="2" class="diff-lineno">Line 1:</td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div> </div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div>This demo focuses on the <ins class="diffchange diffchange-inline">USB </ins>data communication between the FLEX <ins class="diffchange diffchange-inline">Board </ins>and <ins class="diffchange diffchange-inline">a </ins>host PC. The three accelerometer values are represented in a Scicos scope. A pdf guide is included in the zip archive.</div></td></tr>
<tr><td class='diff-marker'>-</td><td style="background: #ffa; color:black; font-size: smaller;"><div>This demo focuses on the <del class="diffchange diffchange-inline">usb </del>data communication between the FLEX <del class="diffchange diffchange-inline">board </del>and <del class="diffchange diffchange-inline">the </del>host PC. The three accelerometer values are represented in a Scicos scope. A pdf guide is included in the zip archive.</div></td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* http://www.evidence.eu.com/download/USB_DEMO_wiki.zip</div></td><td class='diff-marker'> </td><td style="background: #eee; color:black; font-size: smaller;"><div>* http://www.evidence.eu.com/download/USB_DEMO_wiki.zip</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><h3>PIC18 USB firmware</h3></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">The FLEX Full USB connection is provided by the PIC18F2550 that communicates with the dsPIC through a SPI protocol. Download the <tt>FLEX_USB.cof</tt> (furnished with ''USB_DEMO_wiki'' software) inside the microcontroller using MPLAB IDE. There is no need to change the configuration bits. After flashing the device, reset the board and connect the USB cable. The PC automatically recognize the device as a HID device. Open the PC control panel → system → device manager: open the Human Interface Device, and double click on one of the devices, in order to identify the device with VID = 0x04d8 and PID = 0x0033 on the property window. This is the FLEX board. Click on the driver tab and then on update driver → search the driver in the computer → manually search the driver. Specify the path of the folder <tt>libusb</tt> furnished with ''USB_DEMO_wiki'' software (<tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\libusb</tt>). The PC will load this as a new driver for the FLEX Full Board. This is a one time operation done before the FLEX Full Board. <br /><br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_1a.jpg|center]]<br /><br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_1b.jpg|center]]<br /><br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_2.jpg|center]]<br /><br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><h3>Creating the USB PC application</h3></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">First of all you have to download and install Visual studio 2008 C++ express edition from the Microsoft website. Then check the support for Visual studio 2008 C++ express edition into your Scilab version. Check this web page: [http://groups.google.com/group/comp.soft-sys.math.scilab/browse_thread/thread/cd70873264c3fd4a]<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">To compile external code, Scilab must detect and support Visual studio 2008 C++ express edition with dynamic link. This is required for using the <tt>flex_usbdll.dll</tt> and <tt>flex_usbdll.lib</tt>.<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">To compile the USB demo compilation under Scilab/Scicos, launch Scilab and after the startup execution write:<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><tt>cd <path of the demo folder><br />exec go.sce;<br />scicos;<br /></tt></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Open the <tt>PC_3ch.cos</tt>' example (schematic is depicted below):<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_3.jpg|center]]<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">Connect the FLEX Full Board and then open the simulate menu under Scicos and click run. The result is a scope showing in a scope the three axis accelerometer values. In the second scope the three accelerometer values of a remote node are depicted. The remote node is a separate FLEX Board with a ZigBee transceiver (device). The FLEX Full Board connected to the PC through USB is the ZigBee coordinator (see the dsPIC coordinator Scicos schematic).<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">The block used for the PC application is the <tt>flex_usb_datain</tt>:<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">[[image:Usb_4.jpg|center]]<br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">The number written inside the block represents the logical channel number and this must correspond to a usb logical channel in the dsPIC schematic.<br /><br /></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;"><h3>dsPIC</h3></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="background: #cfc; color:black; font-size: smaller;"><div><ins style="color: red; font-weight: bold; text-decoration: none;">To test the demo application, the dsPIC needs to be flashed. The firmware can be found in the folder <tt>USB_DEMO_wiki\DEMO_USB_ONLY_3CH\PC_3ch_USB\cof</tt>.<br /></ins></div></td></tr>
</table>Shivahttps://erika.tuxfamily.org/wiki/index.php?title=FLEX_usb_data_communication_using_Scilab_and_Scicos&diff=1423&oldid=prevFrancesco at 15:16, 18 August 20082008-08-18T15:16:24Z<p></p>
<p><b>New page</b></p><div><br />
This demo focuses on the usb data communication between the FLEX board and the host PC. The three accelerometer values are represented in a Scicos scope. A pdf guide is included in the zip archive.<br />
* http://www.evidence.eu.com/download/USB_DEMO_wiki.zip</div>Francesco