Error on PITn

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

Error on PITn

Jump to solution
742 Views
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 Kudos
1 Solution
585 Views
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

View solution in original post

0 Kudos
2 Replies
586 Views
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 Kudos
585 Views
xavierbuhot
Contributor II

Thank you the response, it works properly now.

0 Kudos