Core clock issue in mpc5746c

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

Core clock issue in mpc5746c

1,918 Views
Ehsaaan
Contributor III

Hello

I want to ensure that my mpc5746c core clock is 160Mhz(it's max) because I hesitate on it due to some problems with OS timings. 
So I wrote a code in the main.c as below:

Trig STM timer to start counting
while(1)

{

Counter++;

}
And store Counter when STM counter reach to 1 second.

 

But when I calculate the counter measured in 1 second(from STM timer) it seems the core clock which I configured to 160Mhz, is much lower, something like 80 or 40Mhz(due to Counter++ does not take exactly 1 clock cycle long)
I use this formula:
Core clokc= 1s / Counter 

Could DFS has an impact on this core clock?? or something else is the issue?
MPC574xB-C-G 

0 Kudos
Reply
5 Replies

1,902 Views
davidtosenovjan
NXP TechSupport
NXP TechSupport

STM runs at 80/40MHz with 160MHz core clock, as it runs at FS80 clock domain or directly from FXOSC.

davidtosenovjan_0-1737371408568.png

I would recommend to use following calculator tool:

https://www.nxp.com/docs/en/application-note/AN5392.pdf

 

 

 

0 Kudos
Reply

1,891 Views
Ehsaaan
Contributor III

Thank you....
but, I think my clock configurations are ok.... For example all the peripherals are working well such as timer and GPIOs. As a matter of fact they are working according the configure clocks!
But when I want to calculate the "core clock" through the procedure I told you before, it seems the core clock which is used for running instructions, is not 160 Mhz and is much lower.
One reason could be DFS....But I Didnt know how can I disable or deactivate this feature for example in the S32 Processor expert or through code!

0 Kudos
Reply

1,916 Views
Bernard295Clark
Contributor I

Hello!

It sounds like you're experiencing an issue with the core clock frequency of your MPC5746C. The discrepancy in the measured core clock could be due to Dynamic Frequency Scaling (DFS), which adjusts the clock frequency based on system load and power management requirements.

To ensure your core clock is set to 160 MHz, you might want to check the DFS settings and ensure that the core is not being throttled. Additionally, ensure that your code is accurately measuring the clock cycles and that there are no other system processes affecting the timing.

0 Kudos
Reply

1,890 Views
Ehsaaan
Contributor III
Thank you.
How can i disable or deactivate DFS??
0 Kudos
Reply

1,895 Views
Bernard295Clark
Contributor I

I hope this answer helps you resolve your issue. 

Best Regards,

Bernard

Frontline IEP

0 Kudos
Reply