Documentation

Softing CAN-AC2-104 with Philips SJA1000 FIFO Setup

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

Library

Simulink® Real-Time™ Library for CAN

Description

The FIFO Setup driver block defines general settings of the installed CAN boards. The CAN driver blocks for this board support up to three boards for each target system, making up to six CAN ports available. For each board in the target system, you must use exactly one Setup driver block.

Block Parameters

Board

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

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 selected User defined from the CAN 1 - baud rate list, enter 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 CAN port 1. 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.

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 selected User defined from the CAN 1 - baud rate list, enter 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 CAN port 2. 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

Defines whether the CAN controller should detect error frames and forward these to the receive FIFO. 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 models, selecting this box might increase the FIFO Read driver block latency, because the receive FIFO is filled with additional events.

Initialization command structure and Termination

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

Termination

Defines 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.

I/O base address

Defines the I/O base address of the board to be accessed by this block instance. The I/O base address is given by the DIP switch setting on the board itself. The I/O address range is 4 bytes of I/O address space. It is mainly used to identify the memory base address the board should use. See the Softing user manual for this board on how you can set the I/O base address. The I/O base address entered in this control must correspond with the DIP switch setting on the board. If more than one board is present in the target system, you must enter a different I/O base address for each board. In this case, the I/O base address itself defines which board is referenced by which board number.

Memory base address

Defines the memory base address of the board to be accessed by this block instance. The memory base address is a software setting only (the board does not have a corresponding DIP switch). The memory address range is 4 KB. If more than one board is present in the target system, you must enter a different memory base address for each board and verify that the defined address ranges do not overlap. Because the Simulink Real-Time kernel only reserves a subset of the address range between 640 KB and 1 MB for memory-mapped devices, the address ranges must be within the following range:

C8000 - D8000

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

Interrupt line

Select an interrupt line from the list.

Was this topic helpful?