S32K144 HSRUN Mode setting was not working.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K144 HSRUN Mode setting was not working.

跳至解决方案
1,212 次查看
cheoljin
Contributor III

Hi, 

I want to use S32K144 at HSRUN ( 112Mhz ) mode and set the clock as below and make timer interrupt  same as sample code. 

But the result is looks same as RUN mode( 48Mhz ). 

Do I need to add something for HSRUN mode? 

 

cheoljin_6-1635256677733.png

Timer Interrupt Setting  :  48000 / 112000000 * 1000 = 0.4286 msec  

                                         112000000 / (48000 * 2) = 1166.6667 HZ

cheoljin_7-1635256728315.png

 

Port Toggle Interval : 1.000msec    ==> Exptected :  0.4286msec 

LED Toggle Signal Frequency :  500Hz ==> Expected : 1166.6667 HZ

cheoljin_8-1635256773163.png

 

Clock Setting 

/* Initialize clock module */
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

 

 

Generated Code 


/* Global configuration of flexTimer_mc_1 InitConfig 0 */
ftm_user_config_t flexTimer_mc_1_InitConfig_0 =
{
{
true, /* Software trigger state */
false, /* Hardware trigger 1 state */
false, /* Hardware trigger 2 state */
false, /* Hardware trigger 3 state */
false, /* Max loading point state */
false, /* Min loading point state */
FTM_SYSTEM_CLOCK, /* Update mode for INVCTRL register */
FTM_SYSTEM_CLOCK, /* Update mode for SWOCTRL register */
FTM_SYSTEM_CLOCK, /* Update mode for OUTMASK register */
FTM_SYSTEM_CLOCK, /* Update mode for CNTIN register */
false, /* Automatic clear of the trigger*/
FTM_UPDATE_NOW, /* Synchronization point */
},
FTM_MODE_UP_TIMER, /* Mode of operation for FTM */
FTM_CLOCK_DIVID_BY_1, /* FTM clock prescaler */
FTM_CLOCK_SOURCE_SYSTEMCLK, /* FTM clock source */
FTM_BDM_MODE_11, /* FTM debug mode */
true, /* Interrupt state */
false /* Initialization trigger */
};

/* Timer mode configuration for flexTimer_mc_1 TimerConfig 0 */
ftm_timer_param_t flexTimer_mc_1_TimerConfig_0 =
{
FTM_MODE_UP_TIMER, /* Counter mode */
0, /* Initial counter value */
48000 /* Final counter value */
};

 

 

 

 

0 项奖励
回复
1 解答
1,206 次查看
cheoljin
Contributor III

I found the clue for HSRUN setting. 

After finishing initial clock mode setting,  I add HSRUN mode setting and it work as HSRUN mode. 

 

 

/* Initialize clock module */
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

==> ADD HSRUN Mode setting here.

 

cheoljin_1-1635285571682.png

 

Frequency : 1.116316Khz

Width        : 428.7usec

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,207 次查看
cheoljin
Contributor III

I found the clue for HSRUN setting. 

After finishing initial clock mode setting,  I add HSRUN mode setting and it work as HSRUN mode. 

 

 

/* Initialize clock module */
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);

==> ADD HSRUN Mode setting here.

 

cheoljin_1-1635285571682.png

 

Frequency : 1.116316Khz

Width        : 428.7usec

0 项奖励
回复
949 次查看
RehabSoliman
Contributor I

@cheoljin

Could you explain what are you mean about (add HSRUN mode setting here )because I have the same problem but I do not understand what is the solution 

 

0 项奖励
回复