How to calculate PIT PIT_LDVALn register value

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

How to calculate PIT PIT_LDVALn register value

Jump to solution
677 Views
irmantasbudrys
Contributor III

Hello All,

 

I am using FRDM DEV BRD KEAZ128 and S32. Bus frequency is 24MHz. Lets say I want interrupt every 1ms. Could you explain me how to calculate PIT_LDVALn register value to generate this interrupt? 

Best Regards,

IB

0 Kudos
1 Solution
493 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Irmantas Budrys,

   

     Actually, the calculation is very simple.

    You also can refer to the KEA128 reference manual, chapter 28.5 Initialization and application information.

   If your bus clock is 24Mhz, then you want to get 1ms, the pit clock is the bus clock, so:

  PIT_LDVALn = 1ms /bus clock =24000= 0x5dc0.

Wish it helps you!

If you still have problem, please contact me!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

1 Reply
494 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Irmantas Budrys,

   

     Actually, the calculation is very simple.

    You also can refer to the KEA128 reference manual, chapter 28.5 Initialization and application information.

   If your bus clock is 24Mhz, then you want to get 1ms, the pit clock is the bus clock, so:

  PIT_LDVALn = 1ms /bus clock =24000= 0x5dc0.

Wish it helps you!

If you still have problem, please contact me!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------