PDA

View Full Version : Question on DT_INT



financecatalyst
- 26th July 2011, 10:58
I am using DT_INT in my code, I am using RB0 -external interrupt. I never had problem before using interrupts of other types, but this external interrupt is causing problem :confused:

It works sometimes upto 4 times (i.e. 4 x RB0 interrupts) then stops working by itself. Sometimes it works upto 2 times or three. There is no statement in the code which is disabling it or anything like that.

Has anyone faced any similar problem?

mackrackit
- 26th July 2011, 12:20
What is the extenal circuit.?
As usual the code may help.

financecatalyst
- 26th July 2011, 12:55
It seems the problem is resolved for now, the problem was that, the following was in the ISR:

DEBUG "AT+CMGS=",34,STR ph1\13,34,",[145]",13,10
DEBUGIN 10000,Inform,[WAIT(">")] : pause 300
DEBUG "Intrusion", 26,10
Pause 10000 : error11=0
For some unknown reason the above statements were causing the problem. I have now taken them out of the ISR and placed them under a separate label. I only increment a simple variable in the ISR now. The main code looks after that variable, when it gets increments the above statements gets executed.

mackrackit
- 26th July 2011, 13:12
As a general rule you will want ti get in and out of an ISR as quick as possible, do only what is needed.
The above code was probably taking too much time causing a trigger to be missed.

mister_e
- 26th July 2011, 15:04
As a general rule you will want ti get in and out of an ISR as quick as possible, do only what is needed.


http://www.designofsignage.com/application/symbol/hands/image/600x600/hand-point-up-2.jpg


_______THIS!