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.

Difference between revisions of "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)
Jump to navigation Jump to search
Line 21: Line 21:
 
;[[/External_Interrupt_PWM|External Interrupt (EI)]]:Pulse width modulation capture and change notification  
 
;[[/External_Interrupt_PWM|External Interrupt (EI)]]:Pulse width modulation capture and change notification  
 
;[[/Output_Compare|Output Compare (OC)]]:Pulse width modulation (PWM) signal generation
 
;[[/Output_Compare|Output Compare (OC)]]:Pulse width modulation (PWM) signal generation
;[[/Output_Compare_HW|Output Compare (OC)]]:Pulse width modulation (PWM) signal generation without interrupt, allow fast PWM and synchronisation with ADC
+
;[[/Output_Compare_HW|Output Compare Hardware (OC_HW)]]:Pulse width modulation (PWM) signal generation without interrupt, allow fast PWM and synchronisation with ADC
 
;[[/PWM_Motor_Output|PWM Motor Output]]:Pulse width modulation (PWM) signal generation
 
;[[/PWM_Motor_Output|PWM Motor Output]]:Pulse width modulation (PWM) signal generation
  

Revision as of 15:47, 1 March 2009

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)

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

SPI PORT functions

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
Nop
Add Nop instructions introducint a lag time between two blocks
Software Reset
Reset the microcontroller