Re: XMC4500 CAN Communication

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Orla
Level 1
Level 1
First question asked First reply posted Welcome!

Hi Deni,

I just got the same problem like ermes.  I'm using XMC4500 relax kit and started with the example "CAN_EXAMPLE_XMC45". It works well in "loopback" mode. Then I disabled loopback mode, and connected Can1Tx with Can2Rx and Can1Rx with Can2Rx (ie P1.12 -> 1.5 and 1.13 -> 1.4) and both the Request_Node and React_Node returned "XMC_CAN_NODE_STATUS_LAST_ERROR_CODE".

So I followed your suggestion to  ermes and add the following Code "Request_Node_LMO_01_Config.mo_ptr->can_mo_ptr->MOCTR = CAN_MO_MOCTR_SETTXRQ_Msk | CAN_MO_MOCTR_SETTXEN0_Msk | CAN_MO_MOCTR_SETTXEN1_Msk;" right after CAN_transmit. in following are creenshots of the request (CAN_NODE1) and react (CAN_NODE0) nodes.

Orla_1-1657132217936.png

Orla_2-1657132431505.png

Can you tell me, why do I have the error after disable the loopback mode? Thank you!

 

 

0 Likes
1 Solution
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @Orla ,

  • To migrate from loopback mode to physical pins, it can be checked if all the pin configurations are properly configured for CAN TX, RX modes.
  • You can also check if the pins are connected with a transceiver in between or without a transceiver.
  • If they are connected with the transceiver connection would be as shown belowAlakananda_BG_0-1657252789295.png

     

  • If there is no transceiver involved. The connection would need to be as shown belowAlakananda_BG_1-1657252851661.png

     

You can follow the below steps for testing

 i) configure the pins properly as required for CAN,

ii) remove the loopback mode configuration.

Then do the following tests

a) Have a transceiver connected to the transmitting CAN node and check with a CAN analyzer.

b) Check the TX and RX lines of transmitting lines using Saleae and decode using inbuilt Saleae CAN analyzer and check if the CAN transmission is proper.

c) Connect the two CAN nodes via transceiver and check the behavior.

Regards,

Alakananda

View solution in original post

0 Likes
2 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @Orla ,

  • To migrate from loopback mode to physical pins, it can be checked if all the pin configurations are properly configured for CAN TX, RX modes.
  • You can also check if the pins are connected with a transceiver in between or without a transceiver.
  • If they are connected with the transceiver connection would be as shown belowAlakananda_BG_0-1657252789295.png

     

  • If there is no transceiver involved. The connection would need to be as shown belowAlakananda_BG_1-1657252851661.png

     

You can follow the below steps for testing

 i) configure the pins properly as required for CAN,

ii) remove the loopback mode configuration.

Then do the following tests

a) Have a transceiver connected to the transmitting CAN node and check with a CAN analyzer.

b) Check the TX and RX lines of transmitting lines using Saleae and decode using inbuilt Saleae CAN analyzer and check if the CAN transmission is proper.

c) Connect the two CAN nodes via transceiver and check the behavior.

Regards,

Alakananda
0 Likes
funkyluke
Level 2
Level 2
5 sign-ins First like received 10 replies posted

As Orla,

as Alakananda said, this wont work without Transceivers, this is no RS232. The CAN Controller Rx needs to see what's going on on the Tx line, but may only drive the bus low, hence the diodes suggested.

I would recommend using real transceivers.

Regards,
funkyluke

 

0 Likes