I looked at the MPC5748G Reference manual and the MPC5746 Reference manual. In MPC5746R, the field CTRL1[CLK_SRC] does not exist. That value is now specified in clock configuration as divider value for AuxClock8.
If the SerialClock is 20MHz and CAN_CLK is 40MHz, the value of PRESDIV should be 1.That matches the value used in code. Thanks for clarifying.
However, if I use the above values in the calculations described in MPC5746R RM Rev6, Pg1919, I cannot arrive at the register value used in the example. Have some followup questions:
1. If PE_Clock (what documents call "CAN serial Clock") is 20MHz, and CAN_Bit_Rate is 500Kbps, the Nominal bit time comes out to 40. But the example uses a Nominal bit time of 20 for all further calculations. Can you please explain?
2. Is the value you specified - 255us, the total_transmission_delay or the bus_propagation_delay ?
Per AN1798, the value of PROP_SEG field of register CTRL1, is determined by
PROP_SEG = (total_transmission_delay) / TimeQuantum.
total_transmission_delay = (physical Interface Rx/Tx delay) + bus_propagation_delay * bus_length.
3.Is the delay value 255us? Typical delays are stated in ns.
Thank you for answering.