Hi DT,
This question is not related to the current ongoing subject but is about your int routine.
Is it safe (or how safe) to call a subroutine inside your interrupt handler?
Or inside PBP int handler?
Thanks.
Hi DT,
This question is not related to the current ongoing subject but is about your int routine.
Is it safe (or how safe) to call a subroutine inside your interrupt handler?
Or inside PBP int handler?
Thanks.
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
I am not DT, but for sure it is not recommended in any way to do a call inside the int routine. Think of the delays to go forth and back plus whatever you are going to do inside the sub. Can you make it absolutely sure that the call will be a zap?
I am sure there is another wayto implement your project.
Ioannis
I agree with Ioannis.
It's not really recommended, but it is possible.
The worst case scenario is with a 16F PIC.
They only have 8 stack levels, and some of PBP's commands can use 4 of them. Which is why you can only nest gosubs 4 levels deep in any 16F program.
In your main program, it may already be 3-4 levels deep when an interrupt triggers. If you then ReEnter PBP, do a GOSUB and try to run a 4-level PBP command, the stack will definitely overflow.
Using the Software Stack can eliminate that problem.
With an 18F there are several more stack levels, so it's not as much of a problem. And of course, if you write the handlers and subroutines in ASM, it's even less of a problem.
<br>
DT
Thanks IO.
I already knew about delay issues but it takes approx. 30 seconds for my code to complete int routine. So my code is not time sensitive.
What I needed to know was DT's warnings about deep levels.
Thanks DT, that is what I now need to consider.
---------------------
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
Bookmarks