Unable to generate the Interrupt in the TIMER in LPC804

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Unable to generate the Interrupt in the TIMER in LPC804

2,450件の閲覧回数
VIGNESH_BABU
Contributor II

Hi,

I was worked with  Developed Board of LPC804 Micro-controller. Where i was using the Timer SDK Example to configure the timer and generate the interrupt in the Micro-controller.After I was developed the own timer code.In the code I didn't got the Interrupt in the code.I was attached below my configuration code.Please check and kindly reply us.

void timer0_Init(void)
{
SYSCON->SYSAHBCLKCTRL0|=1<<25; //ENABLE THE CLOCK FOR THE TIMER0
SYSCON->PRESETCTRL0|=1<<25; //RESET THE TIMER0;

CTIMER0->CTCR|=0X0;
CTIMER0->TC|= 0X0;
CTIMER0->PR|= 0X0;
CTIMER0->PC|= 0X0;

CTIMER0->MR[0]|=1500000;
CTIMER0->MCR|=1<<0; //An Interrupt is generated when MR0 matches the values in the TC
CTIMER0->MCR|=1<<1; //The TC will be reset if MR0 matches it.
CTIMER0->TCR|=1<<1; //Manually Reset Timer0
CTIMER0->TCR&=~(1<<1); //Stop resetting the timer.
CTIMER0->IR|=0XF; //Clear MR0 interrupt flag
CTIMER0->TCR|=1<<1; //Start the Timer
EnableIRQ( CTIMER0_IRQn); //Enable the Interrupt

}

0 件の賞賛
返信
5 返答(返信)

2,437件の閲覧回数
Miguel04
NXP TechSupport
NXP TechSupport

Hi @VIGNESH_BABU 

I recommend you to use the configuration/drivers provided by the SDK example, I'll look into the code provided and let you know if there is something you missed.

Best Regards, Miguel.

0 件の賞賛
返信

2,422件の閲覧回数
VIGNESH_BABU
Contributor II

Hi,

As you told to use the Timer SDK Example.I was generated the timer in the program and verified by Toggle the pin in the driver example.But I have a problem where I was unable  to use your own driver example program with our need.Where I was struggle to generate the Handler Function when I was configure on own myself. 

0 件の賞賛
返信

2,412件の閲覧回数
Miguel04
NXP TechSupport
NXP TechSupport

Hi @VIGNESH_BABU 

Could you tell me with detail the reason you cannot use the driver for your application? to be able to look for an alternaive.

 

Best Regards, Miguel

0 件の賞賛
返信

2,388件の閲覧回数
VIGNESH_BABU
Contributor II

Hi Miguel,

The reason in which the timer driver have default IRQ handler for Timer0,1,2,3,4. where I was able to use to generate the Interrupt inTimer 0 only.Remaining Handler function unable to generate the Interrupt.

1.First Image and Second Image(This Image have the Timer Initialization function for Timer 0 and which correctly generate the Interrupt in the Handler function).Timer0_Initilization(First Image)Timer0_Initilization(First Image)Timer0_Handler_FunctionTimer0_Handler_Function

 

 

 

 

 

 

 

Third Images(Third Images Indicates where I was Initialization the both Timer0 and Timer 1 function ).

Fourth Images(Fourth Images Indicates where I was Toggle the pin in both Timer0 and Timer 1 Handler function).

Timer 0 and Timer 1 Initialization FunctionTimer 0 and Timer 1 Initialization FunctionTimer 0 and Timer 1 Handler functionTimer 0 and Timer 1 Handler function

ii)User manual of LPC804 denotes one General purpose Timer function.But in software we having up to 5 Timer Handler function.How many timer Generally used in the LPC804?

iii)Here Below attached the whole project files for Timer configuration......

 

0 件の賞賛
返信

2,310件の閲覧回数
Miguel04
NXP TechSupport
NXP TechSupport

Hi @VIGNESH_BABU 

Thanks for the extra informations.

The LPC804's core only has one handler for CTIMER0, so you will need to evaluate which channel is triggering the interrupt using the (user manual 16.6.1) Interrupt Register, please take this into occunt while developing your custom driver. I recommend you to use the handler that the example has and inside the interrupt verify which flag is triggered on the register.

Best Regards, Miguel.

0 件の賞賛
返信