K66 CAN controllers. Can I tie the 2 together?

cancel
Showing results for 
Search instead for 
Did you mean: 

K66 CAN controllers. Can I tie the 2 together?

Jump to solution
384 Views
larrydemuth
Contributor III

I'm trying to develop a CAN interface but don't have my boards yet. I have one board with a K66 on it and I was wondering if I can tie CAN0 Tx to CAN1 Rx, and CAN1 Tx to CAN0 Rx and be able to communicate via CAN to each other (CAN1 <--> CAN0). I tried it but when I send from CAN1 to CAN0 (haven't tried it the other way) I see on the scope the same pattern repeating about every 20mS even though I only send once. In the CAN0 interrupt, the interrupt is caused by ESR1 reg STFERR (stuff error) bit, which also keeps repeating, not by a message box interrupt. I'm using the CAN demo code as a base for my testing, so I'm pretty certain both CAN's are being configured properly.

I'm thinking I can't do my testing this way for some reason, but want to verify this one way or another.

Thanks,

Larry

Labels (1)
1 Solution
164 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Larry DeMuth,

If you want to communicate via CAN to each other (CAN1 <--> CAN0), external CAN transceiver is needed.
Due to there is no CAN transceiver on FRDM-K66F board, the flexcan examples in SDK_2.4.1_FRDM-K66F are in loopback mode.

Best Regards,

Robin

 

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

View solution in original post

6 Replies
164 Views
robertboys
Contributor IV

Hello

Actually, there is a "cheat" you can use to build a small CAN network.

The physical layer isn't really differential CAN, but for connecting two controllers together it works great.  You can't connect it to other genuine CAN networks.  You need CAN transceivers for this.

Here is my lab describing this technique: on page 4: needs only a couple of diodes and a resistor.

www.keil.com/appnotes/docs/apnt_247.asp

BTW:  when you see this: 

I see on the scope the same pattern repeating about every 20mS even though I only send once.

 This usually means the ACK signal is not put on the bus.  This is described on page 35 under

Four Newbie mistakes you can avoid:

 

Have fun !

Bob Boys

Arm

California

 

164 Views
larrydemuth
Contributor III

I marked the other answer as correct because technically, it is, but I love seeing work arounds, and your answer could be a good one.

0 Kudos
164 Views
robertboys
Contributor IV

OK

There is a better description of the ACK bit and your issue of multiple messages on the bus on page 7 of the lab.

Bob

0 Kudos
164 Views
larrydemuth
Contributor III

That's interesting. If I don't get my boards soon I may try this.

Thanks! 

0 Kudos
165 Views
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Larry DeMuth,

If you want to communicate via CAN to each other (CAN1 <--> CAN0), external CAN transceiver is needed.
Due to there is no CAN transceiver on FRDM-K66F board, the flexcan examples in SDK_2.4.1_FRDM-K66F are in loopback mode.

Best Regards,

Robin

 

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

View solution in original post

164 Views
larrydemuth
Contributor III

Thanks, That's what I was thinking, a transceiver would still be needed. Guess I have to wait on the boards.

0 Kudos