S32K344 CAN FD setup

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K344 CAN FD setup

3,634 Views
Ayaz
Contributor IV

Hi

I am currently working on setup the CAN FD on my project, i have some confusion regarding the CAN clock.

Skærmbillede 2024-07-04 124801.png

I am using AIPS_PLAT_CLK to provide a clock to FLEXCAN.

In the reference manual it mentioned that the FLEXCAN uses tow clock source .Skærmbillede 2024-07-04 124727.png

Skærmbillede 2024-07-04 125239.pngIs the FlexCANprotocol clock is same CAN_PE_CLK? what is the clock source for FlexCANprotocol clock and CAN_PE_CLK ? and what the Prescaler division factor role is?

0 Kudos
Reply
8 Replies

3,603 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ayaz,

The module clock is the control host interface clock, while the PE clock is the functional clock. The module clock is only used for the register access of the peripheral and is usually sourced from a fixed clock source. For the PE clock, you can select whether the internal clock is connected to the output of a crystal oscillator (Oscillator Clock) or to the Peripheral Clock. The oscillator clock should be selected whenever a tight tolerance (up to 0.1%) is required in the CAN bus timing. The crystal oscillator clock has better jitter performance than the peripheral clock.

Julin_AragnM_0-1720113378532.png

The Serial Clock (Sclock) period defines the 'time quantum' used to compose the CAN waveform, so the CAN bitrate is computed based on the frequency of the PE clock.

Please look at the following overview:

Julin_AragnM_1-1720113544095.png

Best regards,
Julián

0 Kudos
Reply

3,590 Views
Ayaz
Contributor IV

Thanks for explanation 

How to select the frequency for the module frequency (CHI) and the PE clock frequency ?

Which clock is this one ?

1000000022.jpg

0 Kudos
Reply

3,577 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ayaz,

You can look at the source for FlexCAN0_CLK from the Peripheral Clock View:

Julin_AragnM_0-1720131489600.png

Best regards,
Julián

0 Kudos
Reply

3,562 Views
Ayaz
Contributor IV

As I understood there are two different clock frequencies for FlexCAN.

 

1. CHI clock, which can be selected according to the photo you have sent.

2.  how do select the  PE clock frequency?

One last question which clock source is this one? Is it a CHI or PE clock?? should be the same as a module clock?

1000000022.jpg

0 Kudos
Reply

3,524 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ayaz,

FlexCAN has the following unique clocks:

  • CAN_CHI_CLK—FlexCAN controller host interface clock
  • CAN_PE_CLK—FlexCAN protocol engine clock

Julin_AragnM_2-1720202300211.png

CHI_CLK is fed by AIPS_PLAT_CLK, and PE_CLK can be selected as shown in my previous reply with the peripheral view.

Julin_AragnM_3-1720204036287.png

The one in config tools refers to PE_CLK

Best regards,
Julián

0 Kudos
Reply

3,505 Views
Ayaz
Contributor IV

One last question which clock source is this one? Is it a CHI or PE clock?? should be the same as a module clock?

1000000022.jpg

0 Kudos
Reply

3,500 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Ayaz,

That refers to the PE Clock. Yes, it should be the same as the module clock.

0 Kudos
Reply

3,496 Views
Ayaz
Contributor IV
Thanks for the explanation
0 Kudos
Reply