CAN Transmit - Transmit CAN messages via CAN module on Infineon C166 microcontrollers

Library

Target Support Package IC1/C166 Driver Library/CAN Interface

Description

The CAN Transmit block transmits a CAN message onto the CAN bus. Three modes of transmission are available with the CAN Transmit block.

The default mode is to use a priority-based message queue shared by all transmit blocks operating in this mode; the priority-based message queue operates with CAN buffer 14; when a message is successfully transmitted from this buffer, an interrupt is generated and the highest priority message from the queue is loaded into the hardware buffer ready to be transmitted. This mode has the advantage of allowing several messages with different identifiers to be transmitted without each message requiring a dedicated hardware buffer. Note that although messages are taken from the queue in order of priority, it is possible for a low priority message to be present in the hardware buffer and higher priority messages cannot then be transferred from the queue until transmission of the low priority message is complete.

The second transmit mode is to use a dedicated CAN buffer; in this case, messages to be transmitted are loaded directly into a CAN buffer that is used exclusively by the block. No queue is used, which means that in case the previous message has not been transmitted, it will be overwritten by the new one. This transmit mode does not use interrupts. An advantage of using the dedicated buffer mode is that there is reduced delay in transmitting high-priority messages, and reduced processor overhead that is otherwise required for queue management and servicing interrupts.

The third transmit mode is to use a First In First Out (FIFO) queue with dedicated buffer. In this mode, messages are placed in a queue and then transmitted on a first in, first out basis. This mode is useful if several messages, possibly with the same CAN identifier, must be transmitted in sequence; this may be a requirement if CAN is being used for data acquisition.

The CAN Transmit block should be connected to CAN Message Packing/Unpacking blocks. Do not ground the block or leave it unconnected.

Dialog Box

Module

Select CAN module A or B.. The CAN modules can receive messages independently.

Transmit mode

Select one of the three modes described above: queued transmission with shared buffer, direct transmission with dedicated buffer, or FIFO queue with dedicated buffer.

Buffer selection

Only for selecting dedicated buffers — available only if you select direct transmission or FIFO queue transmit modes. Choose either automatic or manual selection of the hardware buffer number.

Buffer number

This option is available only if the buffer selection is available and set to manual. You must select a buffer number between 1 and 14. Note if more than one message is ready to be transmitted, then the one in the lower buffer number will be sent first. Select buffer numbers such that the higher the message priority, the lower the buffer number.

Sample time

Choose -1 to inherit the sample time from the driving blocks. The CAN Transmit block does not inherit constant sample times and runs at the base rate of the model if driven by invariant signals.

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS