Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help on Timer Interrupt

Status
Not open for further replies.

devendra_devgupta

Member level 3
Joined
Apr 8, 2007
Messages
54
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,286
Activity points
1,632
Hello Friends

I am using ARM LPC2366

I am using a timer interrupt of 10 milli seconds.

Thats working very fine.
But i am confused about a particular thing:
When interrupt occurs i call a function which runs for arround 5 milliseconds.I need to know that does timer interrupt is disabled when i am in that timer interrupt itself.
If this is the case i will have next interrupt after 15 milliseconds.
Please help me sort out this confusion. I myself tried to find out the answer but i am really confused.
 

Looking at the data sheet - it looks like that is programmable..
Look for info on the MCR ('Match Control Register')

Sorry if that s wrong or I mis-understood.. :(
 

Hi,
Normal way to handle such a situation is to reenable the interrupt and either continue with the function or to set a flag and come out of the interrupt routine; and in the main routine check for the flag, clear the flag if set and execute the function.
Infact if timer is autoreload type you have no reason to worry since the timing will be taken care off by the autoreload so long as you do not stop the timer.
Regards,
Laktronics
 

How it is taken care off.

I wrote a statement while(1); in timer interrupt than checked for if timer interrupt reoccurs wihin the interrupt. But this does not occued and the program stucked over while(1); this means timer automatically get disabled when i enter interrupt routine.
 

Hi,
The timer will be running if you program the Match control register to Reset the Timer Counter and Interrupt. If the chip allows another same level interrupt inerrupt or not while being inside the interrupt routine is another issue, which you should find out. In any case the intruupt flag in the Interrupt Register should be cleared, if not automatically cleared on entry to the interrupt routine, for the next interrupt to occur.

Since you told that your routine execution time is shorter than the interrupt interval, if you set the Match Control Register bits for simultaneous Reset and Interrupt, you need not have to worry about the timing problem.

Regards,
Laktronics
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top