You are here

Changing the Data Length of the CAN Mailbox during Run time | Cypress Semiconductor

Changing the Data Length of the CAN Mailbox during Run time

Summary: 1 Reply, Latest post by hli on 16 Dec 2013 03:15 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
SRAM's picture
Cypress Employee
50 posts

<b>Is it possible to change the Data length field for the CAN maibox during the run time ?</b>

Yes . By default the data length for each of the CAN mailbox is defined in the CAN configuration window . In case if you need to change data length field for each of the message you are sending you need to modify the CMD register of the CAN transmitter .

The datalength is stored in the DLC field of the CMD register. The CAN TX CMD register contains 4 bits to store the DLC value. The bit 19:16 contains the DLC for each mailbox. Below is the code snippet to change this value 

CAN_TX[Mailbox_No].txcmd.byte[2u] &= 0xF0; 

CAN_TX[Mailbox_No].txcmd.byte[2u] |= No_of_Data_Bytes;

Through the above register write it is possible to change the DLC field during run time .


user_78878863's picture
2553 posts

Such topics belong to the knowledge base, not to the forum (at least when nobody is asking about them). So please add them there, and don't spam the forum...

Log in to post new comments.