Implementing CAN communication with K22 flexcan - timing wrong?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Implementing CAN communication with K22 flexcan - timing wrong?

697件の閲覧回数
ulrich_schmidt
Contributor I

I try to implement a CAN communication with the K22 flexcan. I used the clocks tool from the MCUxpresso IDE to setup the bus clocks. The programm compiles well. The communication runs in callback, but when I try to use external PEAK CAN USB adapter I receive only "kStatus_FLEXCAN_ErrorStatus". All experts I asked, have no idea. The code I mainly copied from the SDK examples. Only my board works with 16 Mhz crystal (the board from the example works with 8 Mhz). Which timing setups are important for correct CAN communication? I added the to files generated by the clocks tool. Do anybody see a mistake in the clock setup? What could I check to find the mistake? Thanks for all your help or tips, Ulrich

タグ(1)
0 件の賞賛
返信
1 返信

612件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Ulrich Schmidt,

The clock source of flexcan is OSCERCLK or Bus clock.

FlexCAN clock generation.png

Clocking diagram.png

That example using 8MHz OSCERCLK(from crystal).

Since the frequency of crystal has increased to 16MHz, have you you modify the values of flexcanConfig?

You can refer: FlexCAN 800K Baud issue in KinetisK series

flexcanConfig.png

Best Regards,

Robin

 

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

0 件の賞賛
返信