Error on PITn

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

Error on PITn

跳至解决方案
1,878 次查看
xavierbuhot
Contributor II

Hello,

I try to use PITn (periodic interrupt timer) for one of my application. I work with k60 kinetis with IAR IDE.

I program rthe PIT0 to generate a interrupt every N secondes but when I try to do the same think with the PIT1 I get an error.

As soon as I try to modify one of the register of PIT1 (PIT_LDVAL1 for example) the CPU generate an interrupt (vector 3 :Hard Fault).

I don't really understand the reason of that error... :smileyshocked:

Can someone explain me the reason of this? Or give me some advice about it?

Best regard.

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

Hi Xavier

A hard fault usually means that the clock to the module has not been enabled.

All PITs share the same control in SIM_SCGC6 but may be it was disabled when PIT0 finished using it and needs to be re-enabled in order to use PIT1 (?)

Regards

Mark

http://www.utasker.com/kinetis.html

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,722 次查看
mjbcswitzerland
Specialist V

Hi Xavier

A hard fault usually means that the clock to the module has not been enabled.

All PITs share the same control in SIM_SCGC6 but may be it was disabled when PIT0 finished using it and needs to be re-enabled in order to use PIT1 (?)

Regards

Mark

http://www.utasker.com/kinetis.html

0 项奖励
回复
1,721 次查看
xavierbuhot
Contributor II

Thank you the response, it works properly now.

0 项奖励
回复