| Target Support Package™ TC2 | ![]() |
c281xdspchiplib in Target Support Package™ TC2 software
The C281x enhanced Control Area Network (eCAN) Receive block generates source code for receiving eCAN messages through an eCAN mailbox. The eCAN module on the DSP chip provides serial communication capability and has 32 mailboxes configurable for receive or transmit. The C281x supports eCAN data frames in standard or extended format.
The C281x 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 third output port is optional and appears only if Output message length is selected.

Unique number between 0 and 15 for standard or between 0 and 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.
Check this check box to post an asynchronous interrupt when a message is received.
For detailed information on the eCAN module, see TMS320F28x DSP Enhanced Control Area Network (eCAN) Reference Guide, Literature Number SPRU074A, available at the Texas Instruments™ website.
C281x eCAN Transmit, C281x Hardware Interrupt
![]() | C281x CAP | C281x eCAN Transmit | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |