AnsweredAssumed Answered

LPC15 MRT IRQ not working

Question asked by Andreas Schnitzer on Oct 11, 2017
Latest reply on Oct 14, 2017 by Andreas Schnitzer

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?

 

 

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;

}

Outcomes