LPC15 MRT IRQ not working

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

LPC15 MRT IRQ not working

Jump to solution
795 Views
andreasschnitze
Contributor II

Hi,

on a project with FreeRTOS and RTI i would like to add a MRT Timer.

The debugger shows the timer is running, interupt flag pending but the ISR is not  called.

Any idia?

pastedImage_1.png

For a first test a added the example code + the first 2 lines. NVIC_EnableIRQ(MRT_IRQn) at the end of the init fnchas also no effect.

void MRT_init()
{
    Chip_Clock_EnablePeriphClock(SYSCTL_CLOCK_MRT);
    Chip_SYSCTL_PeriphReset(RESET_MRT);

   

    int mrtch;

    Chip_MRT_Init();

    for (mrtch = 0; mrtch < MRT_CHANNELS_NUM; mrtch++)
    {
        Chip_MRT_SetDisabled(Chip_MRT_GetRegPtr(mrtch));
    }


    NVIC_EnableIRQ(MRT_IRQn);

    LPC_MRT_CH_T *pMRT;

    pMRT = Chip_MRT_GetRegPtr(0);

    /* Setup timer with rate based on MRT clock */
    Chip_MRT_SetInterval(pMRT, (Chip_Clock_GetSystemClockRate() / 20000) | MRT_INTVAL_LOAD);

    Chip_MRT_SetMode(pMRT, MRT_MODE_REPEAT);

    Chip_MRT_IntClear(pMRT);
    Chip_MRT_SetEnabled(pMRT);
}

void MRT_IRQHandler(void)
{
    uint32_t int_pend;

    /* Get and clear interrupt pending status for all timers */
    int_pend = Chip_MRT_GetIntPending();
    Chip_MRT_ClearIntPending(int_pend);

    DIO_SW2_TOGGLE;

}

0 Kudos
1 Solution
627 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Andreas Schnitzer

To provide the fastest possible support, I'd highly recommend you to refer to the periph_mrt demo of the LPCXpresso LPC1549 board's LPCOpen library.

Have a great day,
TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
628 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Andreas Schnitzer

To provide the fastest possible support, I'd highly recommend you to refer to the periph_mrt demo of the LPCXpresso LPC1549 board's LPCOpen library.

Have a great day,
TIC

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
627 Views
andreasschnitze
Contributor II

Hi jermyzhou,

thank you. I took the example again its running now. . I obvious missed something and/or a breakpoint inside the isr for first ivestigation was optimiced out.

0 Kudos