It looks like you've put the includes in there twice.
Yes that's true. I just figured that out few minutes ago only. My code is streched so long that it's getting difficult to spot small errors and also I can be excused because it's the first time I am trying to use your interrupts. Anyways, thanks for the reply.
Can you please also brief me about T4 error? Though the Build succeed is appearing fine, but so is the error of T4. Should I try to reduce the code or the variables? Should I don't worry about it as far Build Succeed is there?Thanks
As long as none of the complex math or logical conditions are in the Interrupt handlers themselves, ...
you can open the ReEnterPBP.bas file and comment the ERROR "Temp variables exceeding T4" line with a semicolon (;).
DT
Just to understand it correctly, I want to ask you few more questions:
1) Can I use the following statements:
2) Will the next interrupt only be enabled after the code encounters @INT_ENABLE (Regardless of where I put it in the code)?Code:ToggleLED1: goto main ' Is it ok to send the program to a label. Also no complex match or logical conditions here @ INT_RETURN main: 'All complex code and calculations are here @INT_ENABLE INT_INT 'Can I place this statement here? @SLEEP 'Since my application is battery powered, so PIC to sleep if no command is present Goto main
BIG thanks for the help upto now.
Last edited by Megahertz; - 22nd December 2009 at 14:59.
NO! That is not OK at all.
And if all you want to do is restart the program after an interrupt, then you don't even need interrupts.
<hr>
Once enabled, interrupts will continue to fire.
They do not need to be enabled again, unless manually DISABLED in your program.
DT
Well, I don't think I can manage without interrupts. In my code the program waits for serial data on one pin from an RF receiver. And if RI pin of my modem attached to RB0 pin goes low, the code should check any sms received as well. So, interrupt is needed..... if all you want to do is restart the program after an interrupt, then you don't even need interrupts.
How I can do that-disable the interrupts (Is it by adding DISABLE before the code) ? and also can they be enabled again when needed by using @INT_ENABLE?Once enabled, interrupts will continue to fire.
They do not need to be enabled again, unless manually DISABLED in your program.
Regards
ENABLE and DISABLE have no effect with DT_INTS.
Those are only for ON INTERRUPT.
With DT_INTS there are two commands ...
They can be used anywhere in your program.Code:@ INT_ENABLE TMR1_INT @ INT_DISABLE TMR1_INT
Once disabled, you will not receive any interrupts from that source or peripheral until you execute another @ INT_ENABLE.
When you INT_ENABLE, the flag is automatically cleared so you don't get an interrupt immediately if the flag was set.
<br>
DT
Bookmarks