Hi,
In PBP all variables are global, meaning they are always "in scope" and can be accessed by anything/everything at any time/all the time so the answer to your question is yes.
Pay special attention to what Art said, the total execution time of the interrupt code can not be allowed to be MORE than the time between interrupts. If you have a timer tripping an interrupt at 100Hz then the total execution time of the code in the interrupt service routine can not be more than 10ms. If it is then your main code will not run.
You'll see comments about never doing any "real work" in the interrupt code, quick in, quick out, set flags etc or you'll set the world on fire. These are generally good advice but there's absolutely no problems with spending 90% of your time in the ISR and 10% in the main code as long as you understand what that does to your code. A PAUSE 100 in the main code will pretty much turn into a PAUSE 900 due to the interrupt service routine "absorbing" 90% of the CPU power without the rest of the system knowing about it. The same goes for all the software times commands like SERIN, COUNT, PWM, DEBUG etc etc - as long you understand that and you're OK with it then no problem.
/Henrik.
Bookmarks