Hi,
That looks to be correct but I haven't tried it. Obviously you have to write code in the interrupt handler to take care of whatever needs to be taken care of when it sees the signal but yes, interrupts work like that.
You declare the interrupt at the beginning of the program. Then, whenever PortB.0 goes high the execution will jump to the label you specify (Faultsignal in this case). It executes the code there and when it sees the Resume keyword it returns to where it left off.
Don't try to incorporate it in your application directly, play with it a bit first. Make a LED blink continously and have the interrupt toggle another LED so you see how it works, then move on to incorporate it in your application.
With that said ON INTERRUPT isn't the most effective of handling interrupts but I won't go into that right now. There are TONS of info on interrupts on this forum, do a little searching and reading.
Bookmarks