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.

DsPIC Block

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

Root

Master
Select the targeted microcontroller, Set its Clock configuration (Quartz or External Clock, PLL...), and few options allowing to check that real time time step constraint is respected.
Compiler Configuration
set the size of double data type (32 or 64 bits ; default is 32)
Ports Info
List all pin used. Provide also peripheral using theses pins.

Configure Simulink for dsPIC Target

Digital I/O

Digital Input
Logic Input
Digital Output Write
Logic Output, write a value
Digital Output Read
Logic Output, get the las value written

Peripheral I/O Functions

Analog to Digital Converter (ADC)
Input driver for analog-to-digital converter (ADC)
Input Capture (IC)
Pulse width modulation capture
Change Notification (CN)
Pulse width modulation capture and change notification
External Interrupt (EI)
Pulse width modulation capture and change notification
Output Compare (OC)
Pulse width modulation (PWM) signal generation
Output Compare Hardware (OC_HW)
Pulse width modulation (PWM) signal generation without interrupt, allow fast PWM and synchronisation with ADC
PWM Motor Output
Pulse width modulation (PWM) signal generation

Serial Port (UART)

UART Configuration
Set UART configuration
Tx Output
Serial output a scalar or vector of uint8 data
Rx Input
Serial Input a scalar of uint8 data
Tx Output Multplexed for Matlab-Labview
Serial output of data with conditionning allowing graphical monitoring of variable into matalb in pseudo real time
Interface Tx-Matlab
MAtalb Grapical User Interface to collect, view and record varaible evolution send using Tx Output Multiplexed for Matlab-Labview

BUS SPI

SPI Configuration
Configure the microcontroller SPI port
SPI Input/Output
Input-Output driver for SPI
SPI Input/Output interrupt driven
Input-Output interrupt driven SPI driver

BUS CAN

CAN Configuration
Configure the CAN Peripheral
CAN Transmit
Output block for CAN Peripheral
CAN Receive
Input block for CAN Peripheral

BUS I2C

I2C Master
I2C Peripheral (as master)

Others

Calculus Time Step
Get the time step calculation time
Chronograph
Get time within the time step
C Function Call
Call custom write handed C function
Clock Switch to Low Power mode
Switch clock into a LP mode, reducing power consumption
Nop
Add Nop instructions introducint a lag time between two blocks
Software Reset
Reset the microcontroller



<comments \>