CAN FD max data rate

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

CAN FD max data rate

Jump to solution
1,593 Views
黎明孟
Contributor II

What's the max CANFD databandrate?  I can't find the define in the User manual and Data sheet; the demo give max 4M; when i try to set to 5M, it seems someting error;

Labels (1)
1 Solution
1,232 Views
黎明孟
Contributor II

Hi  Alexis,

Thanks for your help!

I have changed the transiver to TJA1057G, it seems works well with 0.5/5M baudrate;

It feels very good that with your professional help, sometime I think the uP is not avaliable but your help give me the confidence to resolve the problem.

Next can you help to confirm if the TJA1059 is support 5M data rate? That's not the key point for me. I can change the transiver if can't be used.

Best Regards,

Liming

View solution in original post

0 Kudos
7 Replies
1,232 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi  黎明 孟,

Can you let me know which LPC, SDK version and IDE are you using for your implementation? For reference, I'm using the LPCXpresso54628, SDK 2.5.0 and MCUXpresso.

Also don't forget that the register add one more to the number you set, in your second example the quantum total are 14, instead of 12. Also for the preDivider is the same

This is the total configuration for the CAN module:

 CLOCK_SetClkDiv(kCLOCK_DivCan0Clk, 2U, true);

    BOARD_InitPins();
    BOARD_BootClockPLL180M();
    BOARD_InitDebugConsole();

    PRINTF("\r\n==MCAN loopback functional example -- Start.==\r\n\r\n");

    MCAN_GetDefaultConfig(&mcanConfig);
#if (defined(USE_CANFD) && USE_CANFD)
    mcanConfig.enableCanfdNormal = true;
#endif
    MCAN_Init(EXAMPLE_MCAN, &mcanConfig, MCAN_CLK_FREQ);

   timingConfigA.preDivider = 1;
   timingConfigA.seg1 = 0x4U;
   timingConfigA.seg2 = 0x2U;
   timingConfigA.rJumpwidth = 0x2U;

   /* Update actual timing characteristic. */
   MCAN_SetArbitrationTimingConfig(EXAMPLE_MCAN, &timingConfigA);

This is the data decoded:

pastedImage_2.png

I hope this helps you.

Best Regards,

Alexis Andalon

0 Kudos
1,233 Views
黎明孟
Contributor II

Hi  Alexis,

Thanks for your help!

I have changed the transiver to TJA1057G, it seems works well with 0.5/5M baudrate;

It feels very good that with your professional help, sometime I think the uP is not avaliable but your help give me the confidence to resolve the problem.

Next can you help to confirm if the TJA1059 is support 5M data rate? That's not the key point for me. I can change the transiver if can't be used.

Best Regards,

Liming

0 Kudos
1,232 Views
黎明孟
Contributor II

Hi  Alexis,

 

Confirmed with TJA1059 also can be work under 5M data baudrate,thanks!

 

Best Regards,

Liming

0 Kudos
1,232 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi  黎明 孟,

In the example, the CAN clock is set at 8MHz, and the core clock is set at 48MHz, if you want to improve th baudrate you'll need to use the 96MHz or 180MHz, and set the clock dividers to minimum to supply the CAN module.

Unfortunately, the max bit rate isn't mentioned in the reference manual but if you change the core frequency and the CAN core clock, you could obtain the 5Mbit/s.

I hope this can help you.

Best Regards,

Alexis Andalon

1,232 Views
黎明孟
Contributor II

Hi Alexis

 i have tried to chang the sys clk to 180M with ext osc 12M, and try some clock dividers, but the 5M dataBaudRate can't work yet!

The clock tree set as follow: 

pastedImage_1.png

and the divider set to 1,2....9 18,36.., but can't work at 5M, when switch to 4M, data can be transferred;

pastedImage_2.png

Data can be send with 4M dataBaudRate ;

pastedImage_3.png

The base line used is the demo "fd_msgobjs" and just replace the clock_config.c clock_config.h files generated by the MCUXpress;

Hope you can help to confirm with this question, thanks!

Best Regards,

Liming

0 Kudos
1,232 Views
Alexis_A
NXP TechSupport
NXP TechSupport

Hi  黎明 孟,

Please check this code:

   mcan_timing_config_t timingConfigA;

   timingConfigA.preDivider = 1;
   timingConfigA.seg1 = 0x4U;
   timingConfigA.seg2 = 0x2U;
   timingConfigA.rJumpwidth = 0x2U;

   /* Update actual timing characteristic. */
   MCAN_SetArbitrationTimingConfig(EXAMPLE_MCAN, &timingConfigA);

In my example I'm using the 180 MHz PLL, with a clock divider = 2.

After calling the init function, I call this function to set how many quantums, I need in each segment. You can see how the bit time is segment in the next image: 

pastedImage_1.png

The Sync_Seg is 1 Quantum for default in this MCU.

The Prop_Seg + Phase_Seg1 is set at the seg1.

The Phase_Seg2 is set at the seg2.

The preDivider is the divider applied to the CAN supply clock. In this case, I use 1 but the register add 1 more. 

The clock in this case for quantum would be 45 MHz, so you will need 9 quantum to set the frequency at 5 MHz.

The seq1 and seq2 as the preDivider add 1 more to the number of quantums.

So in this case:

Prop_Seg + Phase_Seg1 = 5

Phase_Seg2  = 3

 

You should have something like this:

pastedImage_5.png

I hope this information helps you.

Best Regards,

Alexis Andalon

0 Kudos
1,232 Views
黎明孟
Contributor II

Hi Alexis

i have checke the resgister also,but seems the parameters are right to generater the 5M data bitrate;

The paratermeters auto calculated in 

static int CAN_CalculateTimingValues(..........) 

and when set to 180M 

The 4M data rate;

pastedImage_1.png

The 5M data rate:

pastedImage_2.png

Then change to manual fill, the 0.5/4M works well;

pastedImage_3.png

but can't work with 5M no matter what the groups for the timingConifg setting;

Do you have the decoded data to demonstrate the communication is OK, or can you send your Demo to me for test?

My email is 08-meng@163.com

My board is 12M ext crystal and CAN ports config as follow:

/* configure P3_18 for CAN0_TX and P3_19 for CAN0_RX */
IOCON_PinMuxSet(IOCON, 3, 18, IOCON_MODE_INACT | IOCON_FUNC4 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);
IOCON_PinMuxSet(IOCON, 3, 19, IOCON_MODE_INACT | IOCON_FUNC4 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);

/* configure P1_17 for CAN1_TX and P1_18 for CAN1_RX */
IOCON_PinMuxSet(IOCON, 1, 17, IOCON_MODE_INACT | IOCON_FUNC5 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);
IOCON_PinMuxSet(IOCON, 1, 18, IOCON_MODE_INACT | IOCON_FUNC5 | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);

I doublt if the CAN transiver(TJA059) with bug?    I'm crazy......!!!

But also appreciate for your help, thanks!

Best Regards,

Liming

0 Kudos