I want to handle interrupts of a FRDM- K64F with code and without processor expert in codewarrior or kds

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

I want to handle interrupts of a FRDM- K64F with code and without processor expert in codewarrior or kds

873 Views
alejandrovelez
Contributor III

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

0 Kudos
3 Replies

485 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

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.

485 Views
alejandrovelez
Contributor III

Thank you Alice, it really helped me out :smileyhappy:

0 Kudos

485 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

You are welcome ! :smileyhappy:

BR

Alice

0 Kudos