MPC5775E CAN Communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5775E CAN Communication

1,596 Views
bk13
Contributor III

Hello NXP Community,

I am trying to implement CAN communication on MPC5775E. My Transmite and Receive functions are as follows. While debugging, I see that it is stuck in the while loop inside the TransmitMsg function.

 

while ( CAN_A.IFLAG1.B.BUF31TO8I == 0) { } // wait until the tx is completed.

 

 

bk13_0-1676882692230.png 

bk13_1-1676882748516.png

 

Could you pelase help me how to solve these problems?

 

Best Regards,

 

Berfin.

5 Replies

1,582 Views
bk13
Contributor III

Hello @PetrS @martin_kovar,

I have studied your examples on this subject, but I could not solve these problems. Could you please help me?

 

Best Regards.

1,572 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

this while statement is checking if MB flag is set, that is, if message is successfully transmitted without error.
So check that, if any error is detected (ESR1, ECR registers), check MB CODE field.
Do you have node (MPC5775E with active CAN transceiver) connected to any other node and bus properly terminated?  

BR, Petr

1,545 Views
bk13
Contributor III

Hello,

I expect CAN communication to occur between the computer and the evaluation board. There is no other node in between and bus properly terminated. 

 

Best Regards

0 Kudos
Reply

1,539 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

ESR1 cannot be zero if module is in Normal mode. At that case at least SYNC and IDLE bits should be set for free bus. So either you are not in normal mode or for example pins are not properly set. Check the MCR as well, if FZRACK and NOTRDY indicate normal mode, then you can try to disconnect TX/RX pins from transceiver and connect it together, to test pin setting. Send a message and you should get ACK error with TX error counter at 0x80 value. If this is true connect transceiver back and do the same with disconnecting from bus. You should get the same behavior as above.

BR, Petr 

 

0 Kudos
Reply

1,569 Views
bk13
Contributor III

Hello Petr,

Thank you so much for your help and interest. ESR1 and ECR registers are zero. 

bk13_0-1676898091421.png

MB Registers are as below. It seems to be true

bk13_1-1676898345488.png

Best Regards