PDA

View Full Version : INT interrupt problem



netstranger.nz
- 11th October 2009, 06:20
Hi Everyone,

I am having difficulties with INT_interrupt. I am using Darrel Taylor Instant interrupt system. I found that very often you can use assembly level interrupts while still using Basic language statements. It makes the program smaller and works faster. I used this technique on 16F877a. But I found that the chip is very bulky if you want to make simple project so I moved on to 12F683 and 16F684. The problem is that once the program enters interrupt handler it doesn’t return to the main program anymore but still responds to the INT_interrupt. So in other words it returns somewhere but not to the main program. I found two decisions to the problem one is to add DEBUG " " before @INT_RETURN and the other is to use PBP level interrupts and include "ReEnterPBP.bas". If someone came across the same problem can you please share your experience. Thanks in advance.

Darrel Taylor
- 11th October 2009, 06:34
... I found that very often you can use assembly level interrupts while still using Basic language statements. It makes the program smaller and works faster. ...
Yes, if you are VERY careful you can do that.

But using PAUSE in an ASM handler exceeds the "Careful" status.
Can't do that.
Make it a PBP type, and include ReEnterPBP.bas.
<br>

netstranger.nz
- 12th October 2009, 07:37
Hi Darrel,
Thanks a lot for your answer it works. I should also add that I looked at my old 16F877a code I mentioned above and sure enough there is no PAUSE. I scoped the time that the interrupt handler takes off the main program in PBP and ASM modes. The interrupt handler is “TOGGLE LED1” and the PIC runs of the internal 8Mhz oscillator.
None of my small projects would run without Instant Interrupts, I wouldn’t have a nice Bargraph on my LCD, I wouldn’t know how to set all the pins to Digital and would not share my experience if I didn’t have the examples of the others who spent their time to answer the questions.

Darrel Taylor
- 12th October 2009, 21:16
netstranger,

It's nice to know that stuff is getting used by somebody. :)

Do you still have the set-up you used for the scope picture?

I've finished the update to DT_INTS-14, and am doing the testing now.
I've tried to optimize the time it takes to get in and out of the handlers as much as possible, but I don't have a fancy digital scope to see if it helped or not.

If you could run the same test on the new version I would greatly appreciate it.

If you can, I'll send you the files.

Thanks,

netstranger.nz
- 13th October 2009, 07:38
No Problem, I will do my best.

Darrel Taylor
- 13th October 2009, 07:52
Thanks,

They're on they're way.
<br>