According to the MPC5744 reference manual ( Rev. 5, 04/2014 ):
I am using CMU_0 for the IRCOSC measurement and the reference clock is the XOSC.
When I write the value 0x64 in CMU_MDR[MD] register, I get the correct frequency which is, as per the above formula, 16 MHz given that the XOSC frequency is 40MHz.
When I write any other value in CMU_MDR[MD] register, I get incorrect values of the IRCOSC frequency. Do you have any explanation for this ?
Note: Also according to the reference manual,
MDR field is R/W and from my understanding we write into this register the number of clock cycles during which IROSC frequency measurement is done. Is that correct ?