| Target for TI C2000 | ![]() |
www.kxcad.net Home > CAE Software Index > MATLAB Index >
Enhanced Control Area Network receive mailbox
c280xdspchiplib in Target for TI C2000
The C280x enhanced Control Area Network (eCAN) Receive block generates source code for receiving eCAN messages through an eCAN mailbox. The eCAN modules on the DSP chip provide serial communication capability and have 32 mailboxes configurable for receive or transmit. The C280x supports eCAN data frames in standard or extended format.
The C28x eCAN Receive block has up to two and, optionally, three output ports.
The first output port is the function call port, and a function call subsystem should be connected to this port. When a new message is received, this subsystem is executed.
The second output port is the message data port. The received data is output in the form of a vector of elements of the selected data type. The length of the vector is always 8 bytes. The message data port will always output data. When the block is used in polling mode, if there is no new message created between the consecutive executions of the block, then the old message, or the existing message, is repeated.
The third output port is optional and appears only if Output message length is selected.

Determines which of the two eCAN modules is being configured by this instance of the C280x eCAN Receive block. Options are eCAN_A and eCAN_B.
Unique number from 0 to 15 for standard or from 0 to 31 for enhanced CAN mode. It refers to a mailbox area in RAM. In standard mode, the mailbox number determines priority.
Identifier of length 11 bits for standard frame size or length 29 bits for extended frame size in decimal, binary, or hex. If in binary or hex, use bin2dec(' ') or hex2dec(' '), respectively, to convert the entry. The message identifier is associated with a receive mailbox. Only messages that match the mailbox message identifier are accepted into it.
Select Standard (11-bit identifier) or Extended (29-bit identifier).
Frequency with which the mailbox is polled to determine if a new message has been received. A new message causes a function call to be emitted from the mailbox. If you want to update the message output only when a new message arrives, then the block needs to be executed asynchronously. To execute this block asynchronously, set Sample Time to -1, check the Post interrupt when message is received box, and refer to Asynchronous Interrupt Processing for a discussion of block placement and other necessary settings.
Note For information about setting the timing parameters of the CAN module see Configuring Timing Parameters for CAN Blocks. |
Type of data in the data vector. The length of the vector for the received message is at most 8 bytes. If the message is less than 8 bytes, the data buffer bytes are right-aligned in the output. Only uint16 (vector length = 4 elements) or uint32 (vector length = 8 elements) data are allowed. The data are unpacked as follows using the data buffer, which is 8 bytes.
For uint16 data,
Output[0] = data_buffer[1..0]; Output[1] = data_buffer[3..2]; Output[2] = data_buffer[5..4]; Output[3] = data_buffer[7..6];
For uint32 data,
Output[0] = data_buffer[3..0]; Output[1] = data_buffer[7..4];
For example, if the received message has two bytes,
data_buffer[0] = 0x21 data_buffer[1] = 0x43
the uint16 output would be:
Output[0] = 0x4321 Output[1] = 0x0000 Output[2] = 0x0000 Output[3] = 0x0000
Select to output the message length in bytes to the third output port. If not selected, the block has only two output ports.
Select this check box to post an asynchronous interrupt when a message is received.
Detailed information on the eCAN module is in TMS320x281x, 280x Enhanced Controller Area Network (eCAN) Reference Guide (Rev. D), Literature Number SPRU074D, available at the Texas Instruments Web site.
C280x eCAN Transmit, C280x Hardware Interrupt
| CAN Calibration Protocol (C2000) | C280x eCAN Transmit | ![]() |
© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments