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.

Download

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


This blockset is not recommended for new design and is archived here for user with backward compatibility requirements. Considere the Free and Unlimited MPLAB Device Blocks for Simulink from Microchip

Download

Download the evaluation version for the matlab version installed on your system.

Current release : 3.7e ((See release notes))

Release date : 10 sep 2012

Older blockset version fot theses older matlab release :

100 supported microcontrolleurs :



See Release Notes and known bug for details

PIC 24F ' PIC 32F** ' PIC 30F ' PIC 30F ' PIC 33FJ GP ' PIC 33FJ MC ' PIC 33FJ GP ' PIC 33FJ MC*
24fJ128GA006 32MX360F256L 30f2010 30f5011 33fJ128GP206 33fJ256MC510 33fj128GP202 33fj128MC202
24fJ128GA008 32MX360F512L 30f2011 30f5013 33fJ128GP306 33fJ256MC710 33fj128GP204 33fj128MC204
24fJ128GA010 32MX460F256L 30f2012 30f5015 33fJ128GP310 33fJ64MC506 33fj128GP802 33fj128MC802
24fJ64GA006 32MX460F512L 30f3010 30f5016 33fJ128GP706 33fJ64MC508 33fj128GP804 33fj128MC804
24fJ64GA008 32MX775F256L 30f3011 30f6010 33fJ128GP708 33fJ64MC510 33fj32GP302 33fj32MC302
24fJ64GA010 32MX775F256L 30f3012 30f6011 33fJ128GP710 33fJ64MC706 33fj32GP304 33fj32MC304
24fJ96GA006 32MX795F512L 30f3013 30f6012 33fJ256GP506 33fJ64MC710 33fj64GP202 33fj64MC202
24fJ96GA008 32MX320 30f3014 30f6013 33fJ256GP510 33fJ128MC506 33fj64GP204 33fj64MC204
24fJ96GA010 32MX340 30f4011 30f6014 33fJ256GP710 33fJ128MC510 33fj64GP802 33fj64MC802
24fJ16GA002 30f4012 30f6015 33fJ64GP206 33fJ128MC706 33fj64GP804 33fj64MC804
24fJ32GA002 30f4013 33fJ64GP306 33fJ128MC708
24fJ48GA002 33fJ64GP310 33fJ128MC710
24fJ64GA002 33fJ64GP706
24fJ16GA004 33fJ64GP708
24fJ32GA002 33fJ64GP710
24fJ48GA002
24fJ64GA002
Newly added chip 
64MC204, 128MC204, 128GP202, 32MC202, 32MC204, 16MC304 , 33FJ256GP710A
* PIC 32F
SPI function not suported yet;
* Compiler known and fixed bugs 
* Check your compiler installation and version 
at the matlab prompt ==> !pic30-gcc -v for pic30 and !pic32-gcc -v for pic32.
**Check pic32 compiler v 1.04 Workaround
**Check pic30 compiler PWM 2 Workaround from version v 3.12 to current version (3.25)...


Limitation

The evaluation version has a limitations:

  • Works with models containing up to Seven Input/Output pin used on the the targeted microcontroller

To obtain a version without limitation, go to the licence page

The Limit of Seven Input/Output pins of the evaluation version is sufficient for many project like motor control, sensor filtering or fusion and any projects that requires low number of input/output. The evaluation version of the blockset is therefore aimed at hobist or educational institutions.

Some peripherals may use more I/O pin than expected. For example using the UART Tx Port also enable both the Rx and Tx Pin of the microcontroller. Two Pin are then used.

Requirement

The following component must be installed.

  • Mathworks components
    • Simulink
    • Real-Time Workshop Embedded Coder
    • Real-Time Workshop
  • Microchip components
    • C30 compiler for PIC24, dsPIC30 and PIC33 family (tested with version 3.10b and 3.11b and 3.12) (download C30 for PIC24 and C30 for dsPIC and install both. downlaod webpage)
    • C32 compiler for PIC32 family (tested with version 1.02, 1.03 and 1.05) download webpage
  • Blockset for dsPIC from this website

An evaluation version of the Microchip compiler can be found on the microchip website : http://www.microchip.com

Installation

  • An animation (flash) of the installation process is available on the page. This animation is quite old now.
  • A recent video witn installation and with example is available : Screencast (.mov file, 164Mo), from Mariano Lizarraga(April, 28th 2009).

Installation of C30 compiler and/or C32 compiler:

  • Install the compiler in its defautl directory : C:\Program File\Microchip\MPLAB C30 (for C30)
  • Add the compiler Path to your variable environment : Click yes when Installer ask to modify environment
    • When installing C32 included in MPLAB, the path is not added to the path. Add manually the bin subdirectory of the C32 compiler in your computer path.
    • Compiler for PIC30 and Compiler for PIC24 share the same directory. This is not a problem, both are working.

Installation of the blockset in Matlab

  • unzip the installation file in the directory where the blockset will be installed
  • Start Matlab
  • Go to the directory where you unziped the installation .m file
  • Execute the installation script. Do not edit it (it's a large file)
    • Either type >>install_dsPIC at the maltab prompt or
    • in the matlab browser, right click on the install_dsPIC.m file ==> choose run

The blockset will be installed into the current directory.

Upgrading the blockset

When upgrading blockset with a more recent version follow the following steps :

  • Uninstall the old blockset
  • install the new one

Caution

Upgrading from a version earlier to V0.98 require to upgrade the C30 / C32 compiler ((See release notes)). A version of the C30 or C32 compiler for student can be downloaded from the microchip website.

To prevent some possible uncompatibility between blockset version, It is highly recommended to save the models created or modified using the old blockset version before opening them with the new blockset version installed.

The configuration parameters of the blocks should be inspected.

Check that the upgraded version of the blockset is compatible with the C30 or C32 compiler you are using (See release notes)

Uninstall

  • remove the three directory added into the matlab path.
  • delete the blockset directory.