Documentation

Softing CAN-AC2-PCI with Philips SJA1000 FIFO Setup

Softing CAN-AC2-PCI with Philips SJA1000 FIFO Setup block

Library

Simulink® Real-Time™ Library for CAN

Description

The Setup block defines general settings of the installed CAN board(s). The CAN driver blocks for this board support up to 16 boards for each target system, making up to 32 CAN ports available. For each board in the target system, you can use one Setup block in a model.

Block Parameters

Board

Defines the board being accessed by this driver block instance. If multiple boards are present in the target computer, you can use the board number (1...16) to differentiate the boards. The physical board referenced by the board number depends on the PCI Slot parameter. If just one board is present in the target system, select board number 1.

CAN 1 - physical bus

Defines the physical CAN bus type of CAN port 1. In the board's standard configuration, only high-speed CAN is supported. By extending the board with low-speed CAN piggyback modules, you can also select low-speed CAN as the physical bus. Do not change this value to low-speed if a module is not present for the corresponding CAN port. If the module is present (see the Softing® user manual for how to install the modules), you can select between high-speed and low-speed CAN here.

CAN 1 - baud rate

Defines the most common baud rates for CAN port 1. If your model requires a special baud rate, select the value User defined.

CAN 1 - user defined baud rate

If you select User defined from the CAN 1 Baud rate list, enter the four values for the timing information. The vector elements have the following meanings:

[ Prescaler, Synchronization-Jump-Width, Time-Segment-1, 
Time-Segment-2 ]

For more information about these values, see the Softing user manual for this board.

CAN 1 - acceptance

Defines the acceptance filters for the CAN 1 port. Because the receive FIFO is filled with arbitrary CAN messages going over the bus, the use of the CAN controller acceptance filters becomes important to filter out unwanted messages already at the controller level. This acceptance filter information is provided by a row vector with four elements in which the first two are used to define the acceptance mask and acceptance code for standard identifiers and the latter two for extended identifiers. The default value defined by the Setup block does not filter the messages. For information on how to define the acceptance information to filter certain messages, see Acceptance Filters.

CAN 2 - physical bus

Defines the physical CAN bus type of CAN port 2. In the board's standard configuration, only high-speed CAN is supported. By extending the board with lows-peed CAN piggyback modules, you can also select low-speed CAN as the physical bus. Do not set this value should to low-speed if a module is not present for the corresponding CAN port. If the module is present (see the Softing user manual on how to install the modules), you can select between high-speed and low-speed CAN here.

CAN 2- baud rate

Defines the most common baud rates for CAN port 2. If your model requires a special baud rate, select the value User defined.

CAN 2 - user defined baud rate

If you select User defined from the CAN 2 baud rate list, enter the four values for the timing information. The vector elements have the following meanings:

[ Prescaler, Synchronization-Jump-Width, Time-Segment-1, 
Time-Segment-2 ]

For more information about these values, see the Softing user manual for this board.

CAN 2 - acceptance

Defines the acceptance filters for the CAN 2 port. Because the receive FIFO is filled with arbitrary CAN messages going over the bus, the use of the CAN controller acceptance filters becomes important to filter out unwanted messages already at the controller level. This acceptance filter information is provided by a row vector with four elements in which the first two are used to define the acceptance mask and acceptance code for standard identifiers and the latter two for extended identifiers. The default value defined by the Setup block does not filter messages. For information on how to define the acceptance information to filter certain messages, see Acceptance Filters.

Enable error frame detection

If the CAN controller should detect error frames and forward these to the Receive FIFO, select this box. Selecting this box makes sense for network monitoring, where you want to be informed about all events going over the bus. For low-latency-time system models, selecting this box might increase the FIFO Read driver block latency time because the receive FIFO gets filled with additional events.

Initialization command structure and Termination (struct)

Define the CAN messages sent during initialization and termination of the Setup block. For more information, see the standard CAN driver documentation inInitialization and Termination CAN Messages.

Termination

Define the CAN messages sent during termination of the Setup block. For more information, see the standard CAN driver documentation in Initialization and Termination CAN Messages.

Show bus-off status output

Select this check box to enable the bus-off status output port. The output signal can be 1 (bus-off state); otherwise, it is 0. If the bus-off status persists, the block optionally initiates recovery, depending on the setting of Bus-off recovery.

Clear this check box to disable the output port.

Bus-off recovery

Use this parameter to specify how the model is to perform bus-off recovery for the CAN network.

From the list, select:

  • Off

    Does not perform bus-off recovery.

  • Auto

    Upon detection, the model waits 1 second to see if the bus-off state persists. After 1 second, bus-off recovery occurs.

  • Manual Trigger Input

    Enables you to input a signal when you want bus-off recovery to occur. Selecting this option creates an input port for the Setup block.

PCI slot (-1:autosearch)

If only one board of this type is in the target computer, enter -1 to locate the board.

If two or more boards of this type are in the target computer, enter the bus number and the PCI slot number of the board associated with this driver block. Use the format [BusNumber,SlotNumber].

To determine the bus number and the PCI slot number, type:

tg = slrt;
getPCIInfo(tg, 'installed')

The board allows you to terminate each of the two CAN ports separately by means of DIP switches at the rear panel. Both CAN ports must be terminated if you use the loopback model provided to test the board and drivers. Refer to the Softing user manual on how to set the DIP switches.

Was this topic helpful?