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/SPI Input Output"

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
m (LubinKerhuel moved page Block/SPI Input Output to DsPIC Block/SPI Input Output: Block is a special page, creates many issues)
 
(No difference)

Latest revision as of 18:30, 3 May 2015

Block SPI Input/Output

Input-Output Driver for SPI module

The SPI Input-Output block can be configured as an input for SPI data, as an SPI output, or as both Input-Output. The SPI pin can be disabled after reading or sending data allowing the pin tu be used as a digital output (usefull if weird protocole is used)

Dialog Box Parameters

SPI Input Output Dialog
Example of SPI block reading data from an rate-gyro (ADIS16100). Chip Select of the rate gyro is connected to the B4 dsPIC pin which is activated just before execution of the SPI block. Note the Ordering connection to force block ordering.

n° SPI

SPI used

SPI Input

If checked, SPI data will be read This add one output to the Simulink block.

Wait for previous operation to finish, and Reset before Read

Wait for previous operation to finish, and Reset before Read

SPI Output

When checked, SPI data will be written to the SPI pin. This add one input to the Simulink block.

Special SPI

Allow to disable SPI pin function and to use theses pin as digital input/output. The choices are :

  • Always Enable
  • Disable After block execution
  • Re-Enable before block execution
  • Re-Enable Execute and disable

Data Length

8 or 16 bits. This option is set in SPI Configuration block

Wait for incomming data (slave mode)

Stop execution of other blocks while no data are received

Block Ordering Input / Output

Create one input and/or output port on simulink. This port is just used to set the order of execution between severals blocks. You want for example inside one time step set a pin to its high value and to its low value just after (create a glitch). You will used two blocks digital output, but they should be activated in a certain order. Connecting the first block to the second one (temporaly speaking) will allow to respect the execution order you desire.

Status

Provides information like bit rate and status


<comments \>