PIT Timer clock source

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

PIT Timer clock source

Jump to solution
740 Views
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"

Labels (1)
Tags (1)
0 Kudos
Reply
1 Solution
729 Views
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

View solution in original post

0 Kudos
Reply
1 Reply
730 Views
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 Kudos
Reply