Blockset described on this wiki is deprecated since 2012.

For Model Based Design (MBD), use the free MPLAB Device Blocks for Simulink, tool from Microchip.
Updated Rapid Control Prototyping (RCP) custom projects are published at: https://lubin.kerhuel.eu.

Review

From http://www.kerhuel.eu/wiki - Simulink device driver Blockset for dsPIC / PIC24 / PIC32 Microcontrollers --[[User:LubinKerhuel|LubinKerhuel]] 12:40, 3 September 2009 (UTC)
Jump to navigation Jump to search

Rapid Prototyping Tools or experimentation for Microchip PIC / dsPIC microcontroller

Tools

Microchip

Microchip released a first version of a blockst in late 2008 (about november). The version 2 of the microchip blockset were released on June, 5th 2009. It seems that The Dev Team get inspired from an old version of my blockset (*). Anyway, with this blockset, you have to configure all registers of the peripheral. This it not really convenient. I also did not see efficient interrupt handling to make some peripheral works. A free evaluation version is available from their website. Please try it and report your impressions.


3 simple steps to remove the 30s pause from microchip free evaluation version :

  • Remove/Rename the file ./Microchip/MPLAB IDE/Tools/MATLAB/dsPIC_Matlab/dspic/serKeyVal.p (renamed in serKeyVal.old)
  • create a new m file in the same directory
function a = serKeyVal()
disp('Hello Word')
a=0;
end
  • save as serKeyVal.m

(*) speicfic parts of code from my blockset can be found in microchip blockset (but that's not official !): In microchip dsPIC_mrmain.tlc file in directory dspicblks, you can find

   %if (CalculusTimeStepEN == 1)
          CalculusTimeStep = TMR1;
   %endif
   %if (MasterBusyPort != -1)

Sames instructions in the original: In Lubin's blockset, dsPIC_mrmain.tlc file in directory blocks

   %if (CalculusTimeStepEN == 1)
       if (_T1IF) CalculusTimeStep = PR1;  /* Overload */
       else CalculusTimeStep = TMR1;     
   %endif
   %if (MasterBusyPort != -1)
   (differences comes from the fact that I improved it, i.e. Microchip did not get inspired from my last version)

This code is a very specific function that can only be found in the "Lubin's blockset" (not accessible in the microchip blockset). This code remains in Microchip blockset, even in V2 published on 5th 2009. There are probably other similar part of code.

(I now scramble tlc files so as to avoid non-official collaboration. Thus, you will recognize variables name : CalculusTimeStepEN and CalculusTimeStep in my tlc file.)




Quantiphi

product from SimuQuest companie sell a Matlab toolbox for Microchip PIC18Fx480/x580 (9000$ for a single licence including the UniPhi product)




Scicos-Scilab

Evidence Companie built a Scilab/Scicos Code Generator for the FLEX board which is based on a microchip microcontroller



Embedded Target for dsPIC

v3.7e (10 sep 2012) suporting 100


Experimentation

The Autonomous Unmanned Systems (USL)

This team at the University or South Florida works of Unmanned Aerial Vehicles (UAV). In a step by stem approach, they validate the simulink generated code by compiling it and connecting the "Autopilote PC-software" to a plane simulation software (X-Plane). Then, they compile the code to implement it into a PIC18f 4620. They deal with timing and PIC peripheral by integrating "hand coding functions" into the code generated by Matlab.

Two refferences: ( PDF available on http://splatsosoft.com:81/site/jeff/vitae.html )

D. Ernst, K. Valavanis, J. Craighead, “Unmanned Vehicle Controller Design, Evaluation and Implementation: From MATLAB to Printed Circuit Board”, Journal of Intelligent and Robotic Systems (In print)

D. Ernst, K. Valavanis, J. Craighead, Automated Process for Unmanned Systems Controller Implementation Using MATLAB, CD-ROM Proceedings, 14th Mediterranean Conference on Control and Automation, Ancona, Italy, June 2006.