Error on PITn

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 
1,908件の閲覧回数
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,751件の閲覧回数
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,752件の閲覧回数
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,751件の閲覧回数
xavierbuhot
Contributor II

Thank you the response, it works properly now.

0 件の賞賛
返信