This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CAN Tx/Rx

Other Parts Discussed in Thread: TMS320F28335

In ADSP-21065L we have IRQ2 pin which is connected to SJA1000 standalone CAN controller to check whether CAN is starting communication(Tx/Rx) with ADSP .

 

Is there any registers present in TMS320F28335 to implement the similar condition ……?

 

ECanbShadow.CANES.all = ECanbRegs.CANES.all;

 

 

 

 

if (ECanbShadow.CANES.bit.RM != 0)

{

 CAN_Rx();

 

ECanbRegs.CANES.all = ECanbShadow.CANES.all;

}

 

 

if (ECanbShadow.CANES.bit.TM= 0)

{

 CAN_Rx();

 

ECanbRegs.CANES.all = ECanbShadow.CANES.all;

}

 

CAN_Rx()

{

ECanbShadow.CANRMP.all = ECanbRegs.CANRMP.all;

 

 

if (ECanbShadow.CANRMP.bit.RMP31!= 1)

{

  Recive the frme ID and data from MBOX31

 }

 

}

 

CAN_Tx()

{

Place the data on MBOX30

ECanbShadow.CANRMP.all = ECanbRegs.CANRMP.all;

 

 

 

 

 

while

 

 

(ECanbShadow.CANTA.bit.TA30 == 0 );

}

 Where MBOX30 is used as Transmit Mailbox and MBOX31 is used as Recieve mailbox. i am using the DSP2833x_Ecan.c/h files for CAN initialization.

After these checks we are not getting the expected results..Please let us know if we can do any better checks to check whether the CAN is Tranmsitting or Recieving .

Regards,

Vishwanath B J

 

 

 

 

 

 

  • Well, your code doesn't look very healthy.

    For example, in your CAN_TX() function ypu copy the CANRMP register in a shadowed register. In your while instruction youw wait until the SHADOW register CANTA (bit TA30) will change. How on earth should that happen? It nonsense.

    Next, in your CAN_RX() function you ask if CANRMP.bit.RMP31 is not 1. Your comment says that In this case you read the Mailbox31. However, a full mailbox is indicated by RMP = 1, which is the opposite of what you've coded. .