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.

Timer0 LPC2368 interrupt problem

Status
Not open for further replies.

gdtron

Newbie level 3
Joined
Nov 8, 2011
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,308
Hi all, I`m working on a project using LPC2368 and CrossStudio Release 1.6 Build 2. The project is simple. A function is executed at regular intervals. These intervals is done by interrupt. I'm using Timer0 and Match0 register to make the interrupt. The problem is that when I start program in free running (debuging mode using JTAG) the interrupt is not executed. When I put break point in the interrupt function during program working in free running, execution stop at the break point and after that the function is executed and the interrupt starts to work. But it happens only when i put a break point or pause running program and start again. Has anybody faced with a such problem?
Thank you in advance!
 
Last edited:

you can check the execution of interrupt by putting another logic in it.

check if interrupt is coming or not, or give interrupt manually and check..
 

Thank you very much shreyas_patel21, for you answer! The problem is partly solved.First I disabled all interrupts VICIntEnClr = 0xFFFFFFFF;. Then I enabled only the interrupts from Timer0 and ...... what a surprise! The interrupt works OK and the function is executed. Then I put break point before VICIntEnClr = 0xFFFFFFFF; and when execution stopped at the break point I checked register VICIntEnable to find out if there are another interrupts enabled. I saw that the interrupt from Timer1 is also enabled. When I disable it everything works OK. Now I have to find out why it is enabled.
 

thank you, gdtron!

you are saying that you have not enabled the timer 1 interrupt and though it us enabled?
I think it is not possible..
 

The problem is solved!!!!! Now I realize what exactly has happened. A friend of mine gave me the project.He had enabled interrupt from Timer1. In the interrupt function of Timer1 he had written
Code:
 if (T0TC > 600) T0TC = 0;
, but the value that i write in the Match0 register is bigger then 600. So every time when interrupt from Timer1 occurs and T0TC > 600, T0TC is cleared and Timer0 counter cannot reach the value in Match0 register. I removed this code
Code:
 if (T0TC > 600) T0TC = 0;
and everything start to work correct.
Thank you very much for help shreyas_patel21!!!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top