hello everyone. I am doing the CAN communication fucntion on the MPC5643L platform and encounter a problem. I set MB[0] of CAN_0 as Tx MailBox and set baud rate equals to 500K. I can receive cam message using CANOE but all the data area are 0 and ID too. This bothered me for some days. I don't know where is wrong. My whole project is in attachment.
Thank you very much.
Original Attachment has been moved to: vcu_5in1.zip
Hi,
Selected clocking config could bring an issue. You set the Peripheral set 0 clock to 10Mhz and CAN CPI clock running from FMPLL0 (120Mhz). Note: from Table 10.1 of the device RM the FlexCAN clock should be <= 60MHz.
But there are others more important requirements stated in the FlexCAN chapter 24.4.8.5 Arbitration and Matching Timing
• A valid CAN bit timing must be programmed
• The peripheral clock frequency can not be smaller than the CPI clock frequency
• There must be a minimum ratio between the peripheral clock frequency and the CAN bit rate, as specified in Table 24-11
You do not fulfill the first and second one. Thus I recommend you to increase the Peripheral clock frequency, run the CPI clock from XTAL and recalculate CAN bit timing to reflect XTAL as a source clock and provide valid Bit timing setting.
BR, Petr
Thank you. This problem has been solved.