set the system clock from program

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

set the system clock from program

1,362 Views
pierpaolo_dini
Contributor III

Hello, everybody,
I am using the can_pal example for nxp s32k144 and would like to know how to change the system clock explicitly.
I saw that in flex_Can you can use a Normal_Model_80 (or similar) function, but I don't see it in can_pal.
Can you tell me how to make explicit whether to run at 80Mhz or 112Mhz ?
Thank you in advance.

Labels (1)
Tags (1)
0 Kudos
4 Replies

1,277 Views
Jeremy_He
NXP Employee
NXP Employee

Hi Pierpaolo,

1. How to set HSRUN mode?

Please add a new component in Processor Expert and new a Power mode configurations as below.

pastedImage_3.png

Then in the code call ROWER_SYS_Setmode, and fill in the power mode index which indicates the HSRUN mode, in my case it's 1.

pastedImage_4.png

2. How to set RUN mode to 80MHZ from 48MHZ?

Please set SPLL_CLK - Multiply to 40 and choose SYS_CLK RUN mode to SPLL_CLK/2.

pastedImage_5.png

3. How to know your current system clock frequency?

You can use the clock output feature.

 In PIN_MUX component you can set maxim 4 pins as clock output 

pastedImage_7.png

Then go to clock manager component, choose the clock source you want to monitor

pastedImage_8.png

Hope it will help. Any question please feel free to reply.

0 Kudos

1,277 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Pierpaolo,

You can change the frequency of the system clock directly in the Processor Expert clock component. 

pastedImage_1.png

Regards, 

Victor 

0 Kudos

1,277 Views
pierpaolo_dini
Contributor III

Hi Victor,

First of all, thank you for your answer.

However, I don't understand where I can explain that my code can run in normal or highspeed mode.

Also because from the component inspector I can't change the frequency value (48 MHz for Normal Mode and 112MHz for High Speed are values that I can't decide).

pastedImage_4.png

I mean that in the SYS_CLK row of the interface clocks table I can't change the values indicated (at least I think it doesn't give me any option and I don't do it).

Maybe in the table below (Clock Sources) I can change the values. But if I try, it shows me a lot of Warnings (?).

Thanks for your attention,

Pierpaolo.

0 Kudos

1,277 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Pierpaolo,

Please refer to the following community thread: https://community.nxp.com/thread/537933 

Regards, 

Victor 

0 Kudos