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
m (LubinKerhuel moved page Block to DsPIC Block: Block is a special page, creates many issues)
 
(8 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
;[[/Master|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.
 
;[[/Master|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|Compiler Configuration]]: set the size of double data type (32 or 64 bits ; default is 32)
 
;[[/Compiler_Configuration|Compiler Configuration]]: set the size of double data type (32 or 64 bits ; default is 32)
 +
;[[/Ports_Info|Ports Info]]: List all pin used. Provide also peripheral using theses pins.
  
 
==Configure Simulink for dsPIC Target==
 
==Configure Simulink for dsPIC Target==
Line 21: Line 22:
 
;[[/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 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
  
Line 27: Line 29:
 
;[[/UART_Configuration|UART Configuration]]:Set UART configuration  
 
;[[/UART_Configuration|UART Configuration]]:Set UART configuration  
 
;[[/Tx_Output|Tx Output]]:Serial output a scalar or vector of uint8 data  
 
;[[/Tx_Output|Tx Output]]:Serial output a scalar or vector of uint8 data  
;[[/Rx_Input|Tx Input]]:Serial Input a scalar of uint8 data  
+
;[[/Rx_Input|Rx Input]]:Serial Input a scalar of uint8 data  
 
;[[/Tx_Output_Multiplexed_For_Matlab-Labview|Tx Output Multplexed for Matlab-Labview]]:Serial output of data with conditionning allowing graphical monitoring of variable into matalb in pseudo real time  
 
;[[/Tx_Output_Multiplexed_For_Matlab-Labview|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|Interface Tx-Matlab]]:MAtalb Grapical User Interface to collect, view and record varaible evolution send using Tx Output Multiplexed for Matlab-Labview
 
;[[/Interface_Tx-Matlab|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==
+
==BUS SPI==
  
 
;[[/SPI_Configuration|SPI Configuration]]:Configure the microcontroller SPI port  
 
;[[/SPI_Configuration|SPI Configuration]]:Configure the microcontroller SPI port  
 
;[[/SPI_Input_Output|SPI Input/Output]]:Input-Output driver for SPI
 
;[[/SPI_Input_Output|SPI Input/Output]]:Input-Output driver for SPI
;[[/SPI_Input_Output_Interrupt_Driven|SPI Input/Output interrupt driven]]:Input-Output interrupt driven SPI driver  
+
;[[/SPI_Input_Output_Interrupt_Driven|SPI Input/Output interrupt driven]]:Input-Output interrupt driven SPI driver
  
 
==BUS CAN==
 
==BUS CAN==
Line 45: Line 47:
 
==BUS I2C==
 
==BUS I2C==
  
;[[/I2C_Master|I2C MAster]]:I2C Peripheral (as master)  
+
;[[/I2C_Master|I2C Master]]:I2C Peripheral (as master)  
  
 
==Others==
 
==Others==
Line 52: Line 54:
 
;[[/Chronograph|Chronograph]]:Get time within the time step
 
;[[/Chronograph|Chronograph]]:Get time within the time step
 
;[[/C_Function_Call| C Function Call]]:Call custom write handed C function  
 
;[[/C_Function_Call| C Function Call]]:Call custom write handed C function  
 +
;[[/Clock_Switch_LP| Clock Switch to Low Power mode]]:Switch clock into a LP mode, reducing power consumption
 
;[[/Nop|Nop]]: Add Nop instructions introducint a lag time between two blocks
 
;[[/Nop|Nop]]: Add Nop instructions introducint a lag time between two blocks
 
;[[/Software_Reset|Software Reset]]:Reset the microcontroller  
 
;[[/Software_Reset|Software Reset]]:Reset the microcontroller  
Line 85: Line 88:
 
Block_UART_Tx_Output.png
 
Block_UART_Tx_Output.png
 
-->
 
-->
 +
----
 +
<comments \>
 +
----

Latest revision as of 18:30, 3 May 2015

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 \>