NXP S32K312 CAN0 – FIRC vs. FXOSC Clock Source Causing CAN Errors

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

NXP S32K312 CAN0 – FIRC vs. FXOSC Clock Source Causing CAN Errors

108 Views
Karthik_R
Contributor I

Hi everyone,

I am using CAN0 on the S32K312 at 500 kbps with an 87.5% sampling point.

Initially, I set up CAN0 to use the internal FIRC_CLK as the clock source. When I connected the S32K312 to a network with multiple CAN nodes, I noticed a lot of CAN error frames.

I then switched the CAN clock source from FIRC_CLK to the external FXOSC_CLK while keeping the CAN bitrate and sampling point the same. After this change, the communication became stable, and I stopped seeing the error frames.

Could anyone help me understand why switching the clock source from FIRC_CLK to FXOSC_CLK would fix the CAN errors?

0 Kudos
Reply
1 Reply

77 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hello @Karthik_R,

Usually, FIRC clock is not recommended for FlexCAN communication, as accuracy is over the ~1% requirement according to CAN protocol (ISO 11898-1). You can see from S32K3's Data Sheet that FIRC's deviation is +- 5%.

Recommendation is to use either FXOSC or PLL running from XOSC. You can refer to FlexCAN Bit Timing Calculation document, and MPC5xxx/S32Kxx/LPCxxxx: CAN / CAN FD bit timing calculation tool for clock and timing calculations.

Hope this is clear.

Best regards,
Julián

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2404460%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENXP%20S32K312%20CAN0%20%E2%80%93%20FIRC%20vs.%20FXOSC%20Clock%20Source%20Causing%20CAN%20Errors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2404460%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%20everyone%2C%3C%2FP%3E%3CP%3EI%20am%20using%20CAN0%20on%20the%20S32K312%20at%20500%20kbps%20with%20an%2087.5%25%20sampling%20point.%3C%2FP%3E%3CP%3EInitially%2C%20I%20set%20up%20CAN0%20to%20use%20the%20internal%20FIRC_CLK%20as%20the%20clock%20source.%20When%20I%20connected%20the%20S32K312%20to%20a%20network%20with%20multiple%20CAN%20nodes%2C%20I%20noticed%20a%20lot%20of%20CAN%20error%20frames.%3C%2FP%3E%3CP%3EI%20then%20switched%20the%20CAN%20clock%20source%20from%20FIRC_CLK%20to%20the%20external%20FXOSC_CLK%20while%20keeping%20the%20CAN%20bitrate%20and%20sampling%20point%20the%20same.%20After%20this%20change%2C%20the%20communication%20became%20stable%2C%20and%20I%20stopped%20seeing%20the%20error%20frames.%3C%2FP%3E%3CP%3ECould%20anyone%20help%20me%20understand%20why%20switching%20the%20clock%20source%20from%20FIRC_CLK%20to%20FXOSC_CLK%20would%20fix%20the%20CAN%20errors%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2404657%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20NXP%20S32K312%20CAN0%20%E2%80%93%20FIRC%20vs.%20FXOSC%20Clock%20Source%20Causing%20CAN%20Errors%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2404657%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F255495%22%20target%3D%22_blank%22%3E%40Karthik_R%3C%2FA%3E%2C%3C%2FP%3E%0A%3CP%3EUsually%2C%20FIRC%20clock%20is%20not%20recommended%20for%20FlexCAN%20communication%2C%20as%20accuracy%20is%20over%20the%20~1%25%20requirement%20according%20to%26nbsp%3BCAN%20protocol%20(ISO%2011898-1).%20You%20can%20see%20from%20S32K3's%20Data%20Sheet%20that%20FIRC's%20deviation%20is%20%2B-%205%25.%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERecommendation%20is%20to%20use%20either%20FXOSC%20or%20PLL%20running%20from%20XOSC.%20You%20can%20refer%20to%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.google.com%2Furl%3Fsa%3Dt%26amp%3Brct%3Dj%26amp%3Bq%3D%26amp%3Besrc%3Ds%26amp%3Bsource%3Dweb%26amp%3Bcd%3D%26amp%3Bved%3D2ahUKEwiC_IW5mJ6WAxXXlmoFHWR1LTAQFnoECB0QAQ%26amp%3Burl%3Dhttps%253A%252F%252Fcommunity.nxp.com%252Fpwmxy87654%252Fattachments%252Fpwmxy87654%252Fmpc5xxx%252540tkb%252F292%252F1%252FFlexCAN%252520bit%252520timing.pdf%26amp%3Busg%3DAOvVaw0709bky-w7TbDa1ql2Tz2v%26amp%3Bopi%3D89978449%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EFlexCAN%20Bit%20Timing%20Calculation%3C%2FA%3E%26nbsp%3Bdocument%2C%20and%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FMPC5xxx-S32Kxx-LPCxxxx-CAN-CAN-FD-bit-timing-calculation%2Fta-p%2F1119319%22%20target%3D%22_blank%22%3EMPC5xxx%2FS32Kxx%2FLPCxxxx%3A%20CAN%20%2F%20CAN%20FD%20bit%20timing%20calculation%3C%2FA%3E%26nbsp%3Btool%20for%20clock%20and%20timing%20calculations.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EHope%20this%20is%20clear.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EBest%20regards%2C%3CBR%20%2F%3EJuli%C3%A1n%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E