PIT Timer clock source

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

PIT Timer clock source

跳至解决方案
1,517 次查看
Reyna_pan45
Contributor II

hi  ALL

I created a project about pit timer about 1 ms timer interrupt with RTD 3.0.0 ,S32DS 3.5, s32K312

PIT clock frequency is 30 MHz ,so 1 ms =1/( 30 MHz/30000) 

so PIT_PERIOD =  30000,but the timer is incorrect ,

and i debug the project find the PIT clock frequency ≈ 121 MHz

could you tell me was wrong with my project ?thanks

see attached file "pit_test.zip"

标签 (1)
标记 (1)
0 项奖励
回复
1 解答
1,506 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

your system is running out of FIRC not SPLL due to wrong clock init API used. 
So instead of Clock_Ip_InitClock(&Clock_Ip_aClockConfig[0]); use rather

Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);

then have #define PIT_PERIOD 30000U /* 1ms */ as you calculated

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,507 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

your system is running out of FIRC not SPLL due to wrong clock init API used. 
So instead of Clock_Ip_InitClock(&Clock_Ip_aClockConfig[0]); use rather

Clock_Ip_Init(&Clock_Ip_aClockConfig[0]);

then have #define PIT_PERIOD 30000U /* 1ms */ as you calculated

BR, Petr

0 项奖励
回复