CAN with FRDM-K64F

cancel
Showing results for 
Search instead for 
Did you mean: 

CAN with FRDM-K64F

Jump to solution
2,301 Views
thomasolenik
Contributor III

I have a CAN interface circuit utilizing an MC33901 transceiver that I want to use with the K64 or K26 that I have used successfully with the KE06 at 1 Mbps. Has anyone successfully used a CAN transceiver with the FRDM-K64F board?  I'm successfully using the circuit with a FRDM-KE06 with no issues plugged into PTC6 and PTC7, but I get a "Error Passive" in CanKing when I try to do the same with FRDM-K64F. I suspect the issue is with my clock configuration. I'm trying to achieve a bus speed of 1 Mbps. I'm thinking maybe the FRDM-K64F just can't achieve an accurate enough clock for 1 Mbps or should it be possible? I'm trying to us Processor Expert for this test. It would be nice to get some CAN traffic working with the dev board before committing to a prototype of my PCB.

Tags (2)
1 Solution
687 Views
mjbcswitzerland
Specialist V

Hi

The FRDM-K64F uses a 50MHz clock input, which can be used for the CAN clock. It is the same as the Tower K60 as shown in this video:
https://www.youtube.com/watch?v=Ha8cv_XEvco

It is possible to achieve perfect 1Mb/s operation from this clock by using a /2 prescaler, phase buffer segment of 2 and length of 8, and symmetrical bit times of both 8 quanta each. The CAN_CTRL1 register value for this is 0x01bf0007.

A binary for the CAN reference as shown in the video, configured for CAN0 on the FRDM-K64F, and for 1Mb/s on pins PTB18 and PTB19, is available at http://www.uTasker.com/kinetis/FRDM-K64F/uTaskerV1.4.12_FRDM-K64F_CAN_on_PTB.bin  if you would like to check your HW with it.

Regards

Mark
Kinetis for professionals: http://www.utasker.com/kinetis.html

View solution in original post

3 Replies
688 Views
mjbcswitzerland
Specialist V

Hi

The FRDM-K64F uses a 50MHz clock input, which can be used for the CAN clock. It is the same as the Tower K60 as shown in this video:
https://www.youtube.com/watch?v=Ha8cv_XEvco

It is possible to achieve perfect 1Mb/s operation from this clock by using a /2 prescaler, phase buffer segment of 2 and length of 8, and symmetrical bit times of both 8 quanta each. The CAN_CTRL1 register value for this is 0x01bf0007.

A binary for the CAN reference as shown in the video, configured for CAN0 on the FRDM-K64F, and for 1Mb/s on pins PTB18 and PTB19, is available at http://www.uTasker.com/kinetis/FRDM-K64F/uTaskerV1.4.12_FRDM-K64F_CAN_on_PTB.bin  if you would like to check your HW with it.

Regards

Mark
Kinetis for professionals: http://www.utasker.com/kinetis.html

687 Views
thomasolenik
Contributor III

Thanks Mark. That gave me that clue I needed. I was just looking at the schematic for the FRDM-K64F and that source was not jumping out at me. I'm using Processor Expert though. So the set-up is a little different.

In processor Expert I set the system oscillator of "External reference clock" under clock source and selected RMII_RXCLK on PTA18 for the pin name. Once I did that I set the timing for CAN as follows:

Propagation segment = 1

Time Segment 1 = 4

Time Segment 2 = 4

Resync jump with = 1

That is a Time quantra per bit of 10 and a 1000 kbit/s bit rate which was my goal. 

Its working well now with no error frames reported by CanKing.

0 Kudos
687 Views
germanrivera
Contributor III

I would like to connect two FRDM-K64F boards back-to-back with CAN. Can you please tell me how I can do that?

Do I need a CAN transceiver shiled on each FRDM-K64F? and what kind of wires do I need to use connect the two boards?

Thanks,

German

0 Kudos