MPLAB® Device Blocks for Simulink® is a block set developed by Microchip that integrates within the MATLAB®/Simulink environment. It contains a suite of blocks added to the Simulink Library and scripts for MATLAB that allows the configuration of a microcontroller and its peripherals. It also provides the ability to design complex algorithms using tools such as Simulink instead of hand-coding. This facility enables designers to go back and forth from high-level simulation to real hardware test efficiently removing the burden of low-level programming tasks.
MPLAB Device Blocks for Simulink make it easy to develop complex designs using Microchip’s dsPIC30, dsPIC33, PIC32MK, and PIC32MZ Digital Signal Controllers (DSCs). This support package provides a set of user interfaces to the MathWorks® Simulink graphical environment for simulation and model-based design, where the code for the application is generated, compiled, and loaded onto a target in a single, one-click step.
This block set also includes multi-rate and interrupt-capable device blocks and provide complete, model-based control of most dsPIC® and PIC32MK DSCs on-chip peripherals for greater flexibility and higher utilization, including the following:
- Digital I/Os
- Analog-to-Digital Converters (ADC)
- Pulse Width Modulations (PWM)
- Change notifications
- Output compares
- Input captures
- Quadrature Encoder Interfaces (QEI)
- Interrupts and resets
It also includes communication interfaces such as I²C, Serial Peripheral Interface (SPI), and UARTs. Additionally, designers can monitor, tune, log, and instrument their algorithms and applications in real time, via features like External-Mode, Processor in the Loop (PIL) and our PIC® GUI interface.
The Device Blocks are also simple to set up and one Simulink model can be easily modified to target any dsPIC DSC, which enables easy in-process design changes and seamless migration. The Code Replacement Library (CRL), enabled in one click, replaces parts of the MathWorks generated code by its Microchip fast implementation counterpart, which takes advantage of the chip specialized architecture. The Device Blocks’ facility to invoke dsPIC33/PIC32MK/PIC32MZ dedicated functions written in C (via a C function-call block) allow designers to add their custom driver or to use one of Microchip’s numerous application, algorithm, and operation libraries directly from a Simulink model.