Logo

How to let M467HJ CAN FD work with MCP2515 CAN?

, 2024年11月1日|
0
23
1

How do I set bit rate on M467HJ in order to send/reveive CAN data (Not CAN FD) to/from MCP2515?

My MCP2515 settings are CAN speed: 500Mbps and CAN clock: 8MHz

And from sample code of M467:


Can you tell me how to modify the function above?

Thanks.

回覆

  •    You could revise the red part to the frequency you want.

    /* Get the CAN configuration value */
        CANFD_GetDefaultConfig(&sCANFD_Config, CANFD_OP_CAN_MODE);
        sCANFD_Config.sBtConfig.sNormBitRate.u32BitRate = 1000000;
        sCANFD_Config.sBtConfig.sDataBitRate.u32BitRate = 0;
        /* Open the CAN feature */
        CANFD_Open(g_pCanfd, &sCANFD_Config);

    Thanks.