Modifying the FULL CAN Mailbox’s Identifier in the Program | Cypress Semiconductor
Modifying the FULL CAN Mailbox’s Identifier in the Program
Question: Is it possible to change the identifier of a FULL CAN Mailbox in the program to virtually have more than 8 FULL CAN mailboxes?
Answer: Yes it is possible to change the identifier of the FULL CAN mailbox dynamically in the program. The identifier can be changed by writing to the CAN Tx Msg Identifier register. This is a 32 bit register which is used to store the identifier value.
In case of using a standard CAN, the Most Significant 11 bits of the CAN Tx Msg register will contain the Identifier value. So before writing to the CAN Tx Msg Register you have to shift it by 21 bits for the standard CAN. Similarly if you are using the Extended CAN, the MSB 29 bits contain the identifier value. In this case you have to shift by 3 bits before writing to the register.
You can write to the above mentioned register using the following functions.
In case of using Standard FULL CAN use
CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (ID
In case of using Extended FULL CAN use
CY_SET_REG32((reg32 *)&CAN_TX[mailbox].txid, (IDE
Where ID – standard 11 bit Identifier; IDE – Extended 29 bit Identifier
Thus using the above function will allow you to have more than 8 FULL CAN messages. Attached along with this post is the example project .