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/CAN Configuration

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
Block CAN Configuration

Configuration for the CAN Peripheral

When using either a CAN receive block or a CAN Transmit block, this block configure the mode and the CAN BUS parameters.

Dialog Box Parameters

Num CAN

Ref to the CAN peripheral being configured (some PIC have two CAN bus)

Mode

Configure the mode of the CAN peripheral. Four options are available.

  • Normal : the one you will use in most case.
  • Loop back : Allow to test the CAN peripheral and the CAN blockset. In this mode, no external connection nor driver are necessary to make the CAN peripheral working. The dsPIC will write and read its own CAN messages.
  • Listen only : makes the microcontrolleur able to listen to the can BUS without writting anything. This mode will use only the Transmit PIN of the CAN peripheral The receve PIN can be used for another purpose.
  • Disable : shut down the CAN peripheral.


Theses parameters configure the Timing of the CAN bus. Refere to the CAN doccumentation for more informations.

  • TRefCAN
  • BaudRate
  • Progagation Time Segment bits
  • Phase Buffer Segment 1
  • Sample of the CAN bus line
  • Phase Buffer Segment 2
  • Synchronisation max jump (Tq)

The time quanta Tq and the BUS frequency Fcan are updated in the info parameter each time one of these parameters is modified.

Sample Time

Sample time of the block. -1 for inherited

Block Ordering Input / Output

If you want to force the execution order of blocks that are not connected, this option allow to add either an input, an output or both to the block. These virtual connection allow to force the ordering of the blocks.

Info

Information, give the clock frequency Fscl of the I2C bus