Flex CAN between 2 FRDM k64F boards

cancel
Showing results for 
Search instead for 
Did you mean: 

Flex CAN between 2 FRDM k64F boards

1,063 Views
niranjanravi
Contributor V

Hi,

      I was able to get the demo application of FlexCAN from TWR-K64 board using MCU xpresso as my IDE

(SDK_2.5.0_TWR-K64F120M\boards\twrk64f120m\driver_examples\flexcan).

 Further when I tried Internal loop-back program of flexCAN example in FRDM k64F,it was successful but when I run the interrupt mode method where I flashed flexCAN code in two FRDM k64F boards. One node being "a" and other being "b" as per the example , it was not successful.

 

    Connection wise I connected both TX together, Rx together and a common ground. I did not use CAN transreceiver with either of the boards. Am i missing something here?

 

   Is it because I do not have an external CAN transreceiver here?

 

   Saw a previous discussion here , something similar : TWR-K60f120m and FRDM-K64f CAN communication 

where it is mentioned I can do without a CAN transreceiver. Both my boards are less than 1m apart and I am using only 2 boards here.

Any directions would be helpful.

Thank you.

 

IDE: MCU xpresso.

Thanks and Regards

Niranjan

0 Kudos
4 Replies

662 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Niranjan,

If you want to communicate via CAN to each other (TWR-K64F120M <--> FRDM-K64F), external CAN transceiver is needed.

Architecture-of-CAN-Bus-.png

There is a CAN transceiver(TJA1050T) on TWR-SER board which can connect with TWR-K64F120M.

But you still need another CAN transceiver for FRDM-K64F.

TWR-SER.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

662 Views
niranjanravi
Contributor V

Hi,

1.I connected on frdm k64F board to TWR-SER CAN transreceiver board(TX and RX of K64F(PTB18,PTB19) to Tx and RX of TWR-SER board as mentioned above)

2.I connected another FRDM k64F board to waveshare SN65HVD230 CAN transreceiver. (TX and RX of K64F(PTB18,PTB19) to Tx and RX of SN65HVD230 CAN)


Finally CAN_H and CAN_L of two transreceivers are connected together.

I downloaded twrk64f120_flexcan_interrupt_transfer demo application from the SDK_2.5.0_TWR-K64F120M\boards\twrk64f120m\driver_examples\flexcan.

(thread reference for SDK source : CAN communication in Rapid IoT board )

As per the documentation in that demo, it should work when there are two nodes a and b. I also followed it, one board being node a and other being node b.

But
while (!txComplete)
{
};
keeps on going for infinite loop and I cannot see any output.

Can you please verify if the demo is working fine? I am not sure why this is happening.

I have attached the circuit pic below:

pastedImage_56.png

Please note I tried connecting all grounds together and adding 120 ohm as well.
Nothing helped me.

Any help would be appreciated.

Thank you

Thanks and Regards

Niranjan

0 Kudos

662 Views
niranjanravi
Contributor V

Hi,

   Pls ignore my previous post. I got it working. The issue was with Transreceivers. Thank you for your inputs.

Regards

Niranjan

0 Kudos

662 Views
niranjanravi
Contributor V

Hi,

     I am not using TWR-k64F-120M. I am using two FRDM k64F boards only. I understand I still have to use a CAN transreceiver on either sides.

Thank you.

Regards

Niranjan

0 Kudos