Thanks for the reply Mel. (Read next message before replying)
First by Hardware interrupt I meant ASM interrupt. And software interrupt should have been PBP interrupt. Sorry for the mixup in words.
So here is my confusion. With PBP interrupts, I thought that if the interrupt event happend during the processing of another command it would simply not be flagged and never be triggered.
The pin that I have changing states, only does so for a few milliseconds.
This is why when doing a 1 second pauses for example, I do a loop 1000 times of a 1ms pause.
I did not realize that it will still handle the event after whatever command executes.
I did notice in the asm files that basically PBP simply adds a line after every statement to look for the interrupt (as read in the manual) which explains the huge increase in code size.
So basically what happends here is if the interrupt is received (pin changing states etc.) a flag is set by the PIC no matter what is being executing when the interrupt is received. Once the current instruction is processed PBP will look to see if the flag is set and go to the interrupt routine. Once that routine is completed the interrupt flag is reset. Am I correct?
Just making sure here! :-)
I have used PBP interrupts before waiting for serial input and it worked great for those projects.
Actually in this project, I do want the sound to be interrupted. So basically I would need to use the ASM interrupt. And that I have not done yet besides using one that Darrel Taylor graciously supplied to me.
So to continue a question from my earlier post. Can I have the ASM code simply "GOTO" a routine in PBP. My biggest hurddle here is ASM. I understand it, but am not really at a functional level to use it.
Also if not, once the interrupt routine is completed, I imagine it will then return to the same place in my PBP code as where it left off. Is that right? If so I guess I will still have to look for a flag in my PBP routine to know to stop executing that specific set of instructions. So lets say for the sound... If it's playing a 1 second sound and it receives the interrupt after .5 seconds, after the ASM interrupt routine is executed, will it jump back and finish the other .5 seconds of the sound command, or will it simply goto the next line.
Does this make sense?
In simpler terms. I have a bunch of code executing that will take about 10 seconds. If at anytime the interrupt is received while processing that code, I want that series of code to stop executing and jump to another PBP routine immediately.
I don't suppose you have some simple example somewhere of a ASM interrupt? Anything I can play with on the dev board just to get the hang of it.
In the meantime, I think I will go and re-read the chapters on ASM interrupts I have. Although in the books I own, they are all quite slim sections.
Thanks again,
Mike
P.S. Is the mail list totally defunct. Although this is great for searching and all, there seemed to be alot more involment when we were using the e-mail list. Just want to make sure I didn't miss something about have to re-signup or something.
Bookmarks