3 Replies Latest reply on May 1, 2018 11:28 PM by user_475952480

    CAN Controller


      I have gone through all the details and frame structure of CAN controller but unable to figure out that in case of multiple  node of CAN how the receiver end will get to know which type of message i have to receive and discard rest others.? Does the transmit and receive buffer in CAN (PSOC) does the same? if not how it can be done? Help me out...

        • 1. Re: CAN Controller

          Hi Anupam,


          Each node will have one or multiple Identifiers set for itself. The received messages will be filtered out based on Identifier values set.

          While developing a network user has to define which type of message will be assigned to which identifier. Also you need to set priority of those messages while assigning the Identifiers.


          In case of CAN in PSoC 3/5lp/4M/4L, you can configure Identifier in CAN component itself. Kindly have a look at figure 13. , page 10 of following document:



          Following is the screen shot of the same:

          Here the Identifier set is 0x2ff.

          Please feel free to update for any query.




          1 of 1 people found this helpful
          • 2. Re: CAN Controller

            thanks for your attention, 1)i know in case of full mode we can do hardware based filtering with the help of receive buffers but what if i have more than 8 nodes and in that one single node is sending more than 3 type of message so it concludes to (let us suppose 3*8=24 types of messages) and one controller has to receive all these messages. so i cannot do this in full mode so basic mode will be suitable... and in this how message is processed? and how controller node will respond to all those messages?


            2) and while defining identifiers do we really need any hardware addressing technique as we do in case of I2C?

            • 3. Re: CAN Controller
              1. There is a callback for basic mailboxes. The callback CAN_ReceiveMsg_Callback(); is in the function CAN_ReceiveMsg( rxMailbox );
                Normaly you should just use this one to handle the received CAN frame.
                Read the ID of the CAN message with ID = CAN_GET_RX_ID( rxMailbox ); and filter as needed in your code.

                Unfortunately, the parameter for the current mailbox is missing. So you need to add code to CAN_ReceiveMsg_Callback();
                Generated Code with Fix

                void CAN_ReceiveMsg(uint8 rxMailbox)


                      #if (CY_PSOC3 || CY_PSOC5)

                          if ((CAN_RX[rxMailbox].rxcmd.byte[0u] & CAN_RX_ACK_MSG) != 0u)

                      #else  /* CY_PSOC4 */

                          if ((CAN_RX_CMD_REG(rxMailbox) & CAN_RX_ACK_MSG) != 0u)

                      #endif /* CY_PSOC3 || CY_PSOC5 */


                              /* `#START MESSAGE_BASIC_RECEIVED` */

                              CAN_ReceiveMsg_Callback_fix( rxMailbox );

                              /* `#END` */


                              #ifdef CAN_RECEIVE_MSG_CALLBACK

                                  CAN_ReceiveMsg_Callback();                   // Parameter rxMailbox is missing

                              #endif /* CAN_RECEIVE_MSG_CALLBACK */

                              #if (CY_PSOC3 || CY_PSOC5)

                                  CAN_RX[rxMailbox].rxcmd.byte[0u] |= CAN_RX_ACK_MSG;

                              #else  /* CY_PSOC4 */

                                  CAN_RX_CMD_REG(rxMailbox) |= CAN_RX_ACK_MSG;

                              #endif /* CY_PSOC3 || CY_PSOC5 */



              2. The CAN frame header is defined in HW and includes a CAN frame ID. You can use it as you like.