Nxp S32k312 CAN bit timing parameters Issue

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

Nxp S32k312 CAN bit timing parameters Issue

Jump to solution
829 Views
Anitha7
Contributor III

Hi, @lukaszadrapa 

We are using the FlexCAN0 module for CAN communication. To configure the baud rate, we are using bit timing parameters.

Configuration Details

DeviceS32K3xx - CAN FDfpe_clk [MHz]40
TransceiverTJA1046bitrate [kbps]500
propTXRX [ns]150bitrate FD [kbps]2000
bus length [m]40samp. point [%]90

 

Our requirement is to achieve a tolerance of ≤ 0.4% for the following parameters:

1. Nominal Bitrate: 500 kbps

  • Prescaler: 4

  • PropSeg: 7

  • PhaseSeg1: 10

  • PhaseSeg2: 2

  • RJW: 2

2. Data Bitrate (for BRS): 2000 kbps

  • Prescaler: 1

  • PropSeg: 7

  • PhaseSeg1: 6

  • PhaseSeg2: 6

  • RJW: 6

Issue Description

The CAN communication works correctly without Bit Rate Switching (BRS). However, when BRS is enabled, we encounter TX errors.

We are using an FXOSC input clock of 40 MHz for the CAN module.

Could you please help us fine-tune the bit timing parameters to achieve a tolerance ≤ 0.4% with BRS enabled, using the 40 MHz FXOSC input clock?

Tags (2)
0 Kudos
Reply
1 Solution
797 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi, 

you can try below tool for CAN bit timing parameter calculation;
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5xxx-S32Kxx-LPCxxxx-CAN-CAN-FD-bit-timing-cal...

Also see some hints below...
- If possible, select same prescalers for both nominal and data phases.
- If have TDC enabled, try to disable it as it is not needed for this rates.
- Be sure all node use same CAN protocol (non-ISO vs ISO CANFD).
- Have bus properly terminated.

BR, Petr

View solution in original post

0 Kudos
Reply
1 Reply
798 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi, 

you can try below tool for CAN bit timing parameter calculation;
https://community.nxp.com/t5/MPC5xxx-Knowledge-Base/MPC5xxx-S32Kxx-LPCxxxx-CAN-CAN-FD-bit-timing-cal...

Also see some hints below...
- If possible, select same prescalers for both nominal and data phases.
- If have TDC enabled, try to disable it as it is not needed for this rates.
- Be sure all node use same CAN protocol (non-ISO vs ISO CANFD).
- Have bus properly terminated.

BR, Petr

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2169707%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ENxp%20S32k312%20CAN%20bit%20timing%20parameters%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2169707%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37795%22%20target%3D%22_blank%22%3E%40lukaszadrapa%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20are%20using%20the%20%3CSTRONG%3EFlexCAN0%20module%3C%2FSTRONG%3E%20for%20CAN%20communication.%20To%20configure%20the%20baud%20rate%2C%20we%20are%20using%20%3CSTRONG%3Ebit%20timing%20parameters%3C%2FSTRONG%3E.%3C%2FP%3E%3CH3%20id%3D%22toc-hId-1974869213%22%20id%3D%22toc-hId-1999685205%22%3EConfiguration%20Details%3C%2FH3%3E%3CTABLE%20width%3D%22438.124981880188px%22%3E%3CTBODY%3E%3CTR%3E%3CTD%20width%3D%22122.292px%22%3E%3CSTRONG%3EDevice%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22133.523px%22%3E%3CSTRONG%3ES32K3xx%20-%20CAN%20FD%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22132.367px%22%3E%3CSTRONG%3Efpe_clk%20%5BMHz%5D%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%2249.3371px%22%3E%3CSTRONG%3E40%3C%2FSTRONG%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22122.292px%22%3E%3CSTRONG%3ETransceiver%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22133.523px%22%3E%3CSTRONG%3ETJA1046%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22132.367px%22%3E%3CSTRONG%3Ebitrate%20%5Bkbps%5D%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%2249.3371px%22%3E%3CSTRONG%3E500%3C%2FSTRONG%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22122.292px%22%3E%3CSTRONG%3EpropTXRX%20%5Bns%5D%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22133.523px%22%3E%3CSTRONG%3E150%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22132.367px%22%3E%3CSTRONG%3Ebitrate%20FD%20%5Bkbps%5D%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%2249.3371px%22%3E%3CSTRONG%3E2000%3C%2FSTRONG%3E%3C%2FTD%3E%3C%2FTR%3E%3CTR%3E%3CTD%20width%3D%22122.292px%22%3E%3CSTRONG%3Ebus%20length%20%5Bm%5D%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22133.523px%22%3E%3CSTRONG%3E40%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%22132.367px%22%3E%3CSTRONG%3Esamp.%20point%20%5B%25%5D%3C%2FSTRONG%3E%3C%2FTD%3E%3CTD%20width%3D%2249.3371px%22%3E%3CSTRONG%3E90%3C%2FSTRONG%3E%3C%2FTD%3E%3C%2FTR%3E%3C%2FTBODY%3E%3C%2FTABLE%3E%3CBR%20%2F%3E%3CP%3EOur%20requirement%20is%20to%20achieve%20a%20%3CSTRONG%3Etolerance%20of%20%E2%89%A4%200.4%25%3C%2FSTRONG%3E%20for%20the%20following%20parameters%3A%3C%2FP%3E%3CH4%20id%3D%22toc-hId--1629536609%22%20id%3D%22toc-hId--1604720617%22%3E1.%20%3CSTRONG%3ENominal%20Bitrate%3A%20500%20kbps%3C%2FSTRONG%3E%3C%2FH4%3E%3CUL%3E%3CLI%3E%3CP%3EPrescaler%3A%204%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPropSeg%3A%207%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPhaseSeg1%3A%2010%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPhaseSeg2%3A%202%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3ERJW%3A%202%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CH4%20id%3D%22toc-hId-857976224%22%20id%3D%22toc-hId-882792216%22%3E2.%20%3CSTRONG%3EData%20Bitrate%20(for%20BRS)%3A%202000%20kbps%3C%2FSTRONG%3E%3C%2FH4%3E%3CUL%3E%3CLI%3E%3CP%3EPrescaler%3A%201%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPropSeg%3A%207%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPhaseSeg1%3A%206%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3EPhaseSeg2%3A%206%3C%2FP%3E%3C%2FLI%3E%3CLI%3E%3CP%3ERJW%3A%206%3C%2FP%3E%3C%2FLI%3E%3C%2FUL%3E%3CH3%20id%3D%22toc-hId-847473120%22%20id%3D%22toc-hId-872289112%22%3EIssue%20Description%3C%2FH3%3E%3CP%3EThe%20CAN%20communication%20works%20correctly%20without%20%3CSTRONG%3EBit%20Rate%20Switching%20(BRS)%3C%2FSTRONG%3E.%20However%2C%20when%20BRS%20is%20enabled%2C%20we%20encounter%20%3CSTRONG%3ETX%20errors%3C%2FSTRONG%3E.%3C%2FP%3E%3CP%3EWe%20are%20using%20an%20%3CSTRONG%3EFXOSC%20input%20clock%20of%2040%20MHz%3C%2FSTRONG%3E%20for%20the%20CAN%20module.%3C%2FP%3E%3CP%3ECould%20you%20please%20help%20us%20fine-tune%20the%20bit%20timing%20parameters%20to%20achieve%20a%20%3CSTRONG%3Etolerance%20%E2%89%A4%200.4%25%3C%2FSTRONG%3E%20with%20%3CSTRONG%3EBRS%20enabled%3C%2FSTRONG%3E%2C%20using%20the%2040%20MHz%20FXOSC%20input%20clock%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2169744%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20Nxp%20S32k312%20CAN%20bit%20timing%20parameters%20Issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2169744%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eyou%20can%20try%20below%20tool%20for%20CAN%20bit%20timing%20parameter%20calculation%3B%3CBR%20%2F%3E%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%3Ehttps%3A%2F%2Fcommunity.nxp.com%2Ft5%2FMPC5xxx-Knowledge-Base%2FMPC5xxx-S32Kxx-LPCxxxx-CAN-CAN-FD-bit-timing-calculation%2Fta-p%2F1119319%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EAlso%20see%20some%20hints%20below...%3CBR%20%2F%3E-%20If%20possible%2C%20select%20same%20prescalers%20for%20both%20nominal%20and%20data%20phases.%20%3CBR%20%2F%3E-%20If%20have%20TDC%20enabled%2C%20try%20to%20disable%20it%20as%20it%20is%20not%20needed%20for%20this%20rates.%20%3CBR%20%2F%3E-%20Be%20sure%20all%20node%20use%20same%20CAN%20protocol%20(non-ISO%20vs%20ISO%20CANFD).%20%3CBR%20%2F%3E-%20Have%20bus%20properly%20terminated.%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E