AnsweredAssumed Answered

Clarification with four CAN channels

Question asked by rahul krishna on Mar 11, 2015
Latest reply on Mar 12, 2015 by lama

Hi everyone,

There are four CAN channels in the S12xEQ512. Should a separate function be used for the CAN receive channels or a single function should be used. If a single function is provided then if the messages

are coming exactly at the same time from four different channels, then the same interrupt function will be called but with different parameters, how does the xgate or s12x handle this scenario. I mean to say does the code not become reentrant.

 

Example:

const xgate_vector XGATEVectorTable[] =

{

  {XGATE_CAN_Transmit, &XGCAN4},  // Channel 48 - CAN4 transmit           

  {XGATE_CAN_Receive, &XGCAN4},  // Channel 49 - CAN4 receive            

  {XGATE_CAN_Transmit, &XGCAN3},  // Channel 4C - CAN3 transmit           

  {XGATE_CAN_Receive, &XGCAN3},  // Channel 4D - CAN3 receive            

  {XGATE_CAN_Transmit, &XGCAN2},  // Channel 50 - CAN2 transmit

  {XGATE_CAN_Receive, &XGCAN2},  // Channel 51 - CAN2 receive

  {XGATE_CAN_Transmit, &XGCAN1},  // Channel 54 - CAN1 transmit

  {XGATE_CAN_Receive, &XGCAN1},  // Channel 55 - CAN1 receive

  {XGATE_CAN_Transmit, &XGCAN0},  // Channel 58 - CAN0 transmit

  {XGATE_CAN_Receive, &XGCAN0},  // Channel 59 - CAN0 receive

}

 

XGATE_CAN_Receive is the same function being used for all the channels. is it correct or do i need to use separate functions for each channel? Will there be any missing of messages if i use a single function.

 

Regards

Outcomes