AnsweredAssumed Answered

Timer interrupt frequency Limit ?

Question asked by LEE Young Jae on May 22, 2017
Latest reply on Jul 16, 2017 by jeremyzhou

HI

I am using Timer1 to generate an interrupt at every 0.125 us ( 8MHz timer counter )

I modify timer setup code of Periph_blinky in LPCOpen.

Problem : I couldn’t generate an INT at Every 0.125us even through modify timer match value

 

MCU : LPC4370

Test Board: LPC-Link2 (included LPC4370)

 

 

Please check the following code that is set up timer INT for 0.125us (micro second)

 

static void timer_setup(void)

{

       /* Enable timer 1 clock and reset it */

       Chip_TIMER_Init(LPC_TIMER1);

       Chip_RGU_TriggerReset(RGU_TIMER1_RST);

       while (Chip_RGU_InReset(RGU_TIMER1_RST)) {}

 

       /* Timer setup for match and interrupt at SAMPLERATE */

 

       Chip_TIMER_Reset(LPC_TIMER1);

       Chip_TIMER_MatchEnableInt(LPC_TIMER1, 1);

 

 

//     Chip_TIMER_SetMatch(LPC_TIMER1, 1, (Chip_Clock_GetRate(CLK_MX_TIMER1) / SAMPLERATE));

// Chip_Clock_GetRate(CLK_MX_TIMER1): 204000000

// SAMPLERATE : 5

 

// Modified code for 0.125us (8MHZ) timer INT

Chip_TIMER_SetMatch(LPC_TIMER1, 1, (Chip_Clock_GetRate(CLK_MX_TIMER1) / 25000000 ));

 

       Chip_TIMER_ResetOnMatchEnable(LPC_TIMER1, 1);

       Chip_TIMER_Enable(LPC_TIMER1);

 

       /* Enable timer interrupt */

       NVIC_EnableIRQ(TIMER1_IRQn);

       NVIC_ClearPendingIRQ(TIMER1_IRQn);

}

 

result frequency: 1.6MHz (maximum).

 

Question

1. Is there any limit for timer Interrupt frequency ?

- I want to generate 8Mhz timer Interrupt

2. How can I generate timer Interrupt at every 0.125us ( 8MHz ) ?

 

Thanks for you review.

Outcomes