Hello, I follow the K64F datasheet and configure the registers in codewarrior like this:
NVICISER1 = 0x10000;
NVICICER1 = 0x10000;
NVICISPR1 = 0x10000;
NVICICPR1 = 0x10000;
NVICIABR1 = 0x10000;
NVICIP12 = 0xF0;
PIT_MCR = 0;
PIT_LDVAL0 = 1000000;
PIT_TFLG1=1;
PIT_TCTRL0 = PIT_TCTRL_TIE_MASK | PIT_TCTRL_TEN_MASK; //To enable Timer interrupts
to generate PIT CH0 interrupts, but when i run or start to debug the system keeps looping in this method of kinetis_sysinit.c
void Default_Handler()
{
__asm("bkpt");
}
and I don't know how to handle the interrupt for the timer
Hello ,
Firstly , please enable the PIT module clock, SIM_SCGC6|=SIM_SCGC6_PIT_MASK;
And i recommend you refer to the demo under CodeWarrior installation directory (...\CW MCU v10.6\MCU\CodeWarrior_Examples\Kinetis_Examples\k60\lptmr) , refer to the interrupt configure :
/* LPTMR Interrupt Example */
lptmr_interrupt();
Best Regards,
Alice
------------------------------------------------------------------------------------------
If this post answers your question, please click the Correct Answer button.
-----------------------------------------------------------------------------------
If this post help your question, please click the helpful Answer button.
Thank you Alice, it really helped me out :smileyhappy:
You are welcome ! :smileyhappy:
BR
Alice