Henrik,
Thanks for finishing that lesson, I got busy.

rmteo,
Good point about ASM interrupts. I am not sure if Dave can do that with the demo version. But when he gets the full version...

Dave,
We are not finished with PBP interrupts yet
As you saw things can move pretty fast with the hardware and if you want to have an event happen at a certain time no matter what an interrupt can help.

Many times it is not recommended to use PAUSEes because as you now know they block other things from happening. There are enough things that do this without adding more, but sometimes we have to use them. Every thing in its place.

Now try something like this...
Do a "MAIN_LOOP" that will TOGGLE a LED with a button press. Every time you press a button the LED changes state.

Then make a BYTE size variable and add the PBP interrupt routine for another LED. The new variable will increment a value of 1 every time the interrupt "triggers".

After a given amount of "trigger", the variable reaches 10 the second LED changes state.

This should happen whether the first LED and button has been activated or not.
By having the variable increment to change the second LED state you can now make it blink at any time frame you want.