PIT clock source setting RT1176

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

PIT clock source setting RT1176

跳至解决方案
1,177 次查看
auftrag2021
Contributor III

Hello, 

the PIT seems to be a very simple peripheral to use. But I couldn't find the clock source setting for PIT in the MCUXpresso configuration tools like other peripherals like ADC, CAN etc. Why?

What happen if I want to build a very very very long timer, like days? the default value 240MHz ist too fast.

Okay, maybe I can change the bus clock root setting, but there are many other devices like ADC_ETC also hanging on the (240MHz) bus clock root , which I dont want to change them. 

What should I do?

auftrag2021_0-1647124551389.png

 

0 项奖励
回复
1 解答
1,165 次查看
mjbcswitzerland
Specialist V

Hi

PIT1 is clocked from BUS_CLK_ROOT and so if you reduce this you will reduce it for all other modules using the same clock root.

PIT1 channels 0 and 1 can however be chained to build a 64 bit counter, which allows increasing the maximum period by 4Gx. Even at 240MHz this gives about 2'500 years before it overflows.

PIT 2 is clocked from BUS_LPSR_CLK_ROOT and so, if your design can use a much slower BUS_LPSR_CLK_ROOT, (much) longer 32 bit periods can be achieved. Also PIT 2's channels 0 and 1 can be chained to further increase the maximum period.
Eg. if BUS_LPSR_CLK can be set to (OSC_24M / 256) the PIT 2 can count up to 12.7 hours before overflowing.
The same using two chained channels can count to 6 million years before overflowing.

Whatever solution is used a PIT period interrupt can also be used as a counter so that software can further extend the period of software timers beyond that possible with the HW limitation.

Regards

Mark

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,166 次查看
mjbcswitzerland
Specialist V

Hi

PIT1 is clocked from BUS_CLK_ROOT and so if you reduce this you will reduce it for all other modules using the same clock root.

PIT1 channels 0 and 1 can however be chained to build a 64 bit counter, which allows increasing the maximum period by 4Gx. Even at 240MHz this gives about 2'500 years before it overflows.

PIT 2 is clocked from BUS_LPSR_CLK_ROOT and so, if your design can use a much slower BUS_LPSR_CLK_ROOT, (much) longer 32 bit periods can be achieved. Also PIT 2's channels 0 and 1 can be chained to further increase the maximum period.
Eg. if BUS_LPSR_CLK can be set to (OSC_24M / 256) the PIT 2 can count up to 12.7 hours before overflowing.
The same using two chained channels can count to 6 million years before overflowing.

Whatever solution is used a PIT period interrupt can also be used as a counter so that software can further extend the period of software timers beyond that possible with the HW limitation.

Regards

Mark

 

0 项奖励
回复